7 Commits

16 changed files with 2461 additions and 1631 deletions

View File

@@ -1,179 +0,0 @@
body {
overflow: hidden;
}
.welcome {
position: absolute;
top: 0px;
left: 0px;
width: 1920px;
height: 1080px;
padding: 0px;
display: none;
z-index: 1;
}
.welcome .frame {
position: absolute;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
padding: 0px;
background-color: rgba(0, 0, 0, 1);
background-image: none;
background-size: cover;
background-repeat: no-repeat;
display: none;
}
.welcome .frame .msgwin {
position: absolute;
top: 98px;
left: 519px;
width: 884px;
height: 648px;
padding: 0px;
/* background-image: url(./images/bg_language_welcome_box.png);
background-size: cover; */
background-repeat: no-repeat;
background: linear-gradient(rgba(45,45,45,0.6),rgba(16,16,16,0.7));
border-radius: 11px;
filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.5));
}
.welcome .frame .msgwin #hotellogo {
position: absolute;
top: 108px;
left: 135px;
width: 634px;
height: 270px;
padding: 0px;
background-image: none;
background-size: contain;
background-repeat: no-repeat;
/* background-position: center; */
background-position: top;
}
.welcome .frame .msgwin #guestname {
position: absolute;
top: 424px;
left: 0px;
width: 804px;
height: 65px;
padding: 0px 0px 5px 0px;
margin: 0px 40px 0px 40px;
background-image: none;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
border-bottom: solid rgb(192,192,192) 3px;
font-size: 65px;
justify-content: center;
text-align: center;
color: rgb(235, 235, 235);
line-height: 65px;
max-width: 864px;
display: none;
}
.welcome .frame .msgwin #welcomemsg {
position: absolute;
top: 516px;
left: 0px;
width: 804px;
height: 44px;
/* padding: 0px; */
margin: 0px 40px 0px 40px;
background-image: none;
background-size: contain;
background-repeat: no-repeat;
background-position: center;
font-size: 33px;
justify-content: center;
text-align: center;
color: rgb(235, 235, 235);
line-height: 33px;
max-width: 864px;
display: none;
}
.welcome .frame .guide#langsel {
position: absolute;
top: 1037px;
left: 0px;
width: 1920px;
height: 54px;
background-color: rgba(0, 0, 0, 0.8);
display: inline-block;
color: rgba(200, 200, 200, 1);
font-size: 32px;
line-height: 43px;
text-align: center;
border-top: solid rgb(128, 128, 128);
}
.welcome #lst_langsel {
position: absolute;
top: 962px;
left: 0;
height: 76px;
line-height: 76px;
margin: 0;
padding: 0;
overflow: hidden;
display: none;
}
.welcome #lst_langsel .item {
color: rgba(200, 200, 200, 1);
font-size: 44px;
text-align: center;
background-repeat: no-repeat;
background-size: cover;
}
.welcome #lst_langsel .owl-item.active.center div {
background-image: var(--btn_focus);
}
.welcome #lst_langsel .owl-item.active div {
background-image: var(--btn_unfocus);
}
.control .skip_video {
z-index: 10000;
position: absolute;
z-index: 10000;
top: 927px;
left: 1579px;
width: 246px;
height: 68px;
padding: 0px;
background-color: rgba(0, 0, 0, 0.0);
background-image: none;
background-size: contain;
background-repeat: no-repeat;
display: none;
}
#debugwin {
z-index: 10000;
position: absolute;
top: 11px;
bottom: 22px;
right: 11px;
font-size: 12px;
background-color: rgba(18, 18, 18, 0.3);
text-align: left;
color: rgb(235, 235, 235);
line-height: 24px;
padding-left: 5px;
padding-top: 5px;
display: inline-flex;
max-width: 500px;
overflow-wrap: break-word;
word-wrap: break-word;
display: none;
}

View File

@@ -802,7 +802,7 @@ HotelTV.api = (function() {
"mac_wifi": "",
"mac_bt": "",
"speed": 0,
"manufacture": "LG",
"manufacture": _dev_inf['manufacture'],
"model": "",
"hw_ver": "1.00",
"sw_ver": "1.1.5",
@@ -812,7 +812,7 @@ HotelTV.api = (function() {
"second": 344632,
"string": "03d23h43m52s"
},
"api_ver": "v1"
"api_ver": "v3"
};
const _fxn_cvtDateFmt1 = function(_date) {

View File

@@ -36,6 +36,7 @@ HotelTV.hcap = (function() {
'clock_display', 'teletext', 'secure_mmr_pairing', 'dial', 'alljoyn', 'clock_source', 'xait_version',
'asl_mode', 'screensaver_control', 'rms_trusted_ip', 'lg_service_xml_version', 'cec_device_control',
'input_splash_image', 'block_usb', 'tv_channel_attribute_floating_ui',
'room_number',
'instant_power', 'hardware_version',
'network_info',
'tv_channel_ui', "mute_on_tv_input",
@@ -298,6 +299,50 @@ HotelTV.hcap = (function() {
hcap.property.getHotelMode(param);
};
/**
* HCAP Wrapper Function::> Set Device Power Mode(Realted HCAP API:hcap.power.setPowerMode)
* @param {string} sz_key property key name.
* @param {object} value is object to setting property
*/
function __hcapfxn_set_powermode(sz_key, value) {
return new Promise((resolve, reject) => {
let _pwrMode = null;
try {
hcap.power.getPowerMode({
"onSuccess" : function(s) {
console.log("onSuccess power mode " + s.mode);
if ( s.mode!=value )
{
hcap.power.setPowerMode({
"mode" : value,
"onSuccess" : function() {
console.log("onSuccess set power mode to " + value);
_pwrMode = s.mode;
resolve({ "key": sz_key, "value": value });
},
"onFailure" : function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "key": sz_key, "value": "unknown" });
}
});
}
else
{
_pwrMode = s.mode;
resolve({ "key": sz_key, "value": value });
}
},
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "key": sz_key, "value": "unknown" });
}
});
} catch {
resolve({ "key": sz_key, "value": "unknown" });
}
});
};
/**
* HCAP Wrapper Function::> Get Cpu TIme
* @param {callback} callback is callback object
@@ -856,33 +901,50 @@ HotelTV.hcap = (function() {
});
})
// STEP#004::> Power Mode
// SETP#004::> Room Number(Device Name)
let _str_newDevName = _devinfo['manufacture'] + "[" + _devconfig.roomNumber.toString() + "]";
if ( _devinfo['room_number']!=_str_newDevName ){
console.log("Set device name and room number as " + _str_newDevName );
_pmFxnArProperty.push(__hcapfxn_set_property('room_number', _str_newDevName));
}
// STEP#005::> Power Mode
if (_devinfo["instant_power"] !== undefined) {
if (_devinfo["instant_power"] != 0) {
let _instant_pwr_target_mode = 2;
if (_devinfo["instant_power"] != _instant_pwr_target_mode) {
console.log("INSTANT POWER MODE::> off");
__hcapfxn_set_property('instant_power', 0).then(_result => {
hcap.power.getPowerMode({
"onSuccess": function(s) {
console.log("onSuccess power mode " + s.mode);
if (s.mode != hcap.power.PowerMode.WARM) {
hcap.power.setPowerMode({
"mode": hcap.power.PowerMode.WARM,
"onSuccess": null,
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
}
});
}
},
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
}
});
__hcapfxn_set_property('instant_power', _instant_pwr_target_mode).then(_result => {
_devinfo["instant_power"] = _instant_pwr_target_mode;
console.log("instant_power mode set as " + _devinfo["instant_power"]);
});
}
if ( _instant_pwr_target_mode==2 ){
__hcapfxn_set_powermode('power_mode', hcap.power.PowerMode.NORMAL).then(_result => {
_devinfo["power_mode"] = hcap.power.PowerMode.NORMAL;
console.log("power_mode mode set as " + _devinfo["power_mode"]);
});
// hcap.power.getPowerMode({
// "onSuccess": function(s) {
// console.log("onSuccess power mode " + s.mode);
// if (s.mode != hcap.power.PowerMode.NORMAL) {
// hcap.power.setPowerMode({
// "mode": hcap.power.PowerMode.NORMAL,
// "onSuccess": null,
// "onFailure": function(f) {
// console.log("onFailure : errorMessage = " + f.errorMessage);
// }
// });
// }
// },
// "onFailure": function(f) {
// console.log("onFailure : errorMessage = " + f.errorMessage);
// }
// });
}
}
// STEP#00X::> SERVICE RELATED PARAMETERS
// STEP#006::> SERVICE RELATED PARAMETERS
for (let _cfg in _devconfig) {
if (_cfg == 'video') {
for (let _item in _devconfig.video) {
@@ -1033,42 +1095,42 @@ HotelTV.hcap = (function() {
}
}
//Specifial parameters
// STEP#007::> Specifial parameters
if (_devinfo["boot_sequence_option"] !== undefined) {
if (_devinfo["boot_sequence_option"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('boot_sequence_option', 1));
}
}
// Clock Display
// STEP#008::> Clock Display
if (_devinfo["clock_display"] !== undefined) {
if (_devinfo["clock_display"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('clock_display', 0));
}
}
// Input splash Image
// STEP#009::> Input splash Image
if (_devinfo["input_splash_image"] !== undefined) {
if (_devinfo["input_splash_image"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('input_splash_image', 0));
}
}
// USB Device Blocking
// STEP#010::> USB Device Blocking
if (_devinfo["block_usb"] !== undefined) {
if (_devinfo["block_usb"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('block_usb', 1));
}
}
// WOL
// STEP#011::> WOL
if (_devinfo["wol_m"] !== undefined) {
if (_devinfo["wol_m"] != "normal") {
_pmFxnArProperty.push(__hcapfxn_set_property('wol_m', "normal"));
}
}
// WIFI SCREEN SHARE
// STEP#012::> WIFI SCREEN SHARE
if (_devinfo["wifi_screen_share"] !== undefined) {
// if (_devinfo["wifi_screen_share"] != 1) {
// _pmFxnArProperty.push(__hcapfxn_set_property('wifi_screen_share', 1));
@@ -1080,77 +1142,77 @@ HotelTV.hcap = (function() {
}
}
// SMART SHARE
// STEP#013::> SMART SHARE
if (_devinfo["smart_share"] !== undefined) {
if (_devinfo["smart_share"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('smart_share', 0));
}
}
// SMART PARING
// STEP#014::> SMART PARING
if (_devinfo["smart_pairing"] !== undefined) {
if (_devinfo["smart_pairing"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('smart_pairing', 0));
}
}
// DIAL
// STEP#015::> DIAL
if (_devinfo["dial"] !== undefined) {
if (_devinfo["dial"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('dial', 1));
}
}
// DMR
// STEP#016::> DMR
if (_devinfo["dmr"] !== undefined) {
if (_devinfo["dmr"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('dmr', 0));
}
}
// SOFTAP UI
// STEP#017::> SOFTAP UI
if (_devinfo["soft_ap_ui"] !== undefined) {
if (_devinfo["soft_ap_ui"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('soft_ap_ui', 0));
}
}
// SOFTAP
// STEP#018::> SOFTAP
if (_devinfo["soft_ap"] !== undefined) {
if (_devinfo["soft_ap"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('soft_ap', 0));
}
}
// APPLICATION CHANNEL CONTROL
// STEP#019::> APPLICATION CHANNEL CONTROL
if (_devinfo["application_channel_control"] !== undefined) {
if (_devinfo["application_channel_control"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('application_channel_control', 1));
}
}
// TV CHANNEL UI
// STEP#020::> TV CHANNEL UI
if (_devinfo["tv_channel_ui"] !== undefined) {
if (_devinfo["tv_channel_ui"] != 0) {
_pmFxnArProperty.push(__hcapfxn_set_property('tv_channel_ui', 0));
}
}
// MUTE ON TV INPUT: Prevent TV channel auto play when exit OTT
// STEP#021::> MUTE ON TV INPUT: Prevent TV channel auto play when exit OTT
if (_devinfo["mute_on_tv_input"] !== undefined) {
if (_devinfo["mute_on_tv_input"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('mute_on_tv_input', 1));
}
}
// SECURITY LEVEL
// STEP#022::> SECURITY LEVEL
if (_devinfo["security_level"] !== undefined) {
if (_devinfo["security_level"] != 1) {
_pmFxnArProperty.push(__hcapfxn_set_property('security_level', 1));
}
}
// // OSD LAYER ID
// STEP#0XX::> OSD LAYER ID
// if (_devinfo["osd_layer_id"] !== undefined) {
// if (_devinfo["osd_layer_id"] != 0) {
// _pmFxnArProperty.push(__hcapfxn_set_property('osd_layer_id', 0));
@@ -1657,19 +1719,33 @@ HotelTV.hcap = (function() {
},
// _type은 hcap.externalinput.ExternalInputType형이고, 현재는 HDMI로 고정
// _index는 HDMI포트 번호
/**
* _type은 hcap.externalinput.ExternalInputType형이고, 현재는 HDMI로 고정
* _index는 HDMI포트 번호
* @param {string} _type
* @param {Number} _index
* @returns
* true: Success
* false: Failure
*/
SetExternalInput: function(_type, _index) {
hcap.externalinput.setCurrentExternalInput({
"type" : hcap.externalinput.ExternalInputType.HDMI,
"index" : _index,
"onSuccess" : function() {
console.log("onSuccess");
},
"onFailure" : function(f) {
console.error("onFailure : errorMessage = " + f.errorMessage);
}
});
try {
hcap.externalinput.setCurrentExternalInput({
"type" : hcap.externalinput.ExternalInputType.HDMI,
"index" : _index,
"onSuccess" : function() {
console.log("onSuccess");
return true;
},
"onFailure" : function(f) {
console.error("onFailure : errorMessage = " + f.errorMessage);
return false;
}
});
} catch(_err) {
console.log(`fail to perform getCurrentExternalInput() ${_err}`);
return false;
}
},
Test: function() {

View File

@@ -57,6 +57,13 @@ var HotelTV = HotelTV || {
'scroll_offset': null,
},
},
'external_input':{
'connected': false,
'last_input': {
'type': 0,
'index': 0
}
},
'hotkey': {
"mm": {}
},
@@ -86,9 +93,10 @@ var HotelTV = HotelTV || {
},
'dbginfo': {
'en': false,
'emulator': false, //PC 브라우저를 이용할때, true로 설정, 타겟 셋트에서는 false로 설정할것
'hcap_ipc': false,
'output': 'osd'
'emulator': false, //PC에서 emulation할때, true로 설정, 타겟 셋트에서는 false로 설정할것
'hcap_ipc': false, //WEBOS HCAP 라이브러리 내부 메시치 출력 enable/disable
'output': 'osd',
'webdebugger': true //WEBOS 웹 디버거 enable/disable
},
'media_hndl': null,
};
@@ -120,9 +128,9 @@ HotelTV.namespace = function(ns_string) {
* @param {string} sz_key property key name.
* @param {callback} callback is callback object
*/
function __fxn_Set_DebugOpt() {
HotelTV.dbginfo['en'] = true;
HotelTV.dbginfo['output'] = 'native';
function __fxn_Set_DebugOpt(_enable, _out_option, _init) {
HotelTV.dbginfo['en'] = _enable;
HotelTV.dbginfo['output'] = _out_option;
HotelTV.hcap.Init();
@@ -130,15 +138,27 @@ function __fxn_Set_DebugOpt() {
console.log("OPT" + navigator.appVersion);
if (navigator.appVersion.includes("Web0S") == true) {
HotelTV.dbginfo['emulator'] = false;
HotelTV.devinfo['manufacture'] = "LG";
HotelTV.devinfo['tvOS'] = "Web0S";
/** Set HCAP Debug Options */
if (HotelTV.dbginfo['emulator'] == false) {
//Enable/Disable browser debug mode
HotelTV.hcap.SetBrowserDebug(HotelTV.dbginfo['hcap_ipc'], HotelTV.dbginfo['webdebugger']);
}
} else if (navigator.appVersion.includes("Tizen") == true) {
HotelTV.dbginfo['emulator'] = false;
HotelTV.devinfo['manufacture'] = "SAMSUNG";
HotelTV.devinfo['tvOS'] = "Tizen";
} else {
HotelTV.dbginfo['emulator'] = true;
}
if (HotelTV.dbginfo['output'] == 'osd') {
if (HotelTV.dbginfo['en'] == true) {
(function() {
var old = console.log;
var logger = document.getElementById('debugwin');
var logger = document.getElementById('debugwin');
if ( logger!=null )
{
var dateNow = new Date();
var hours = dateNow.getHours();
var minutes = dateNow.getMinutes();
@@ -152,6 +172,11 @@ function __fxn_Set_DebugOpt() {
if (seconds < 10) {
seconds = "0" + seconds;
}
if(logger.style.display!='block'){
logger.style.display = 'block';
}
console.log = function(logmsg) {
var _dispMsg = hours + ":" + minutes + ":" + seconds + "-> ";
if (typeof logmsg == 'object') {
@@ -160,18 +185,14 @@ function __fxn_Set_DebugOpt() {
_dispMsg += logmsg + '<br />';
}
_dispMsg += logger.innerHTML;
logger.innerHTML = _dispMsg;
}
})();
}
}
} else {
/** Set HCAP Debug Options */
if (HotelTV.dbginfo['emulator'] == false) {
//Enable/Disable browser debug mode
HotelTV.hcap.SetBrowserDebug(HotelTV.dbginfo['hcap_ipc'], HotelTV.dbginfo['en']);
} else {
//Below for Non WebOS
if (HotelTV.dbginfo['en'] != true) {
console.log = function(logmsg) {
}
}
}
};
@@ -186,7 +207,8 @@ HotelTV.Init = async function() {
HotelTV.hcap.ChannelShutDown();
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt();
__fxn_Set_DebugOpt(false, 'osd', false);
//__fxn_Set_DebugOpt(true, 'native', true);
//STEP#03::> Get Device Info
HotelTV.ui_utils.SetBusy(true);
@@ -194,7 +216,7 @@ HotelTV.Init = async function() {
await HotelTV.hcap.GetDevInfo();
//await HotelTV.hcap.ShowDevInfo();
} catch (_error) {
let _tmval = 10;
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-devinfo",
"SYSTEM ERROR",
@@ -209,7 +231,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`System will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -236,7 +258,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -270,7 +292,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`System will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
return;
@@ -291,7 +313,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -314,7 +336,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -343,7 +365,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -366,7 +388,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -386,6 +408,7 @@ HotelTV.Init = async function() {
try {
HotelTV.widget = await HotelTV.api.GetWidgetCtz();
} catch (_error) {
let _tmval = 50;
//console.log("Display Error page for get widget info");
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-widget",
@@ -401,7 +424,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -409,6 +432,7 @@ HotelTV.Init = async function() {
try {
HotelTV.tvguide = await HotelTV.api.GetProgramCtz();
} catch (_error) {
let _tmval = 50;
//console.log("Display Error page for get tvguide info");
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-tvguideinfo",
@@ -424,7 +448,7 @@ HotelTV.Init = async function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem will be reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
setTimeout(HotelTV.hcap.Reboot, 500);
}
});
}
@@ -478,7 +502,25 @@ HotelTV.Init = async function() {
}
}
} else {
console.error("Display Error page for invalid license type.");
let _tmval = 30;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.unregistered-device",
"SYSTEM ERROR",
"This device is not a registered device or is an invalid licensed device.\r\nplease contact your system administrator.",
{
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nSystem need to be reboot`);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
},
"cb_eoe": function() {
$('.error #countdown #message').text(`The Device ID is ${HotelTV.devinfo.serial_number}.\r\n\r\nPlease reboot the device by manualy(using remote contoller)`);
}
}
);
}
console.log("Initialization:: Done");
HotelTV.ui_utils.SetBusy(false);
@@ -491,6 +533,10 @@ HotelTV.LoadWelCome = async function() {
extDisableHcapConsoleLog = true;
HotelTV.dbginfo = await JSON.parse(sessionStorage.getItem("dbginfo"));
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt(false, 'native', true);
//__fxn_Set_DebugOpt(true, 'native', true);
HotelTV.devinfo = await JSON.parse(sessionStorage.getItem("devinfo"));
HotelTV.svrinfo = await JSON.parse(sessionStorage.getItem("svrinfo"));
//STEP#03:API Module INIT
@@ -624,6 +670,9 @@ HotelTV.LoadAppFull = async function() {
//STEP#01: Load session info
HotelTV.dbginfo = await JSON.parse(sessionStorage.getItem("dbginfo"));
//SETP#02::> Set Debug Options
__fxn_Set_DebugOpt(false, 'native', true);
HotelTV.devinfo = await JSON.parse(sessionStorage.getItem("devinfo"));
HotelTV.svrinfo = await JSON.parse(sessionStorage.getItem("svrinfo"));
HotelTV.services = await JSON.parse(sessionStorage.getItem("services"));
@@ -648,13 +697,15 @@ HotelTV.LoadAppFull = async function() {
}
try {
let _result = await HotelTV.api.DeleteAmenityCarts(null);
HotelTV.carts.amenity = await HotelTV.api.GetAmenityCarts(null);
} catch (_error) {
console.error("Display Error page for get amenity carts info");
}
HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts();
try {
let _result = await HotelTV.api.DeleteRoomserviceCarts(null);
HotelTV.carts.roomservice = await HotelTV.api.GetRoomserviceCarts();
} catch (_error) {
console.error("Display Error page for get roomservicec carts info");
}

View File

@@ -65,7 +65,7 @@ HotelTV.ui_appfull = (function() {
var _hndl_tmrCtzBgAni = null;
var _hndl_tmrAmenityThumbAni = null;
var _hndl_tmrRoomserviceThumbAni = null;
const _lastTm = {
const _tmrEvt = {
'tvchannel_changed': null,
'keyevt': {
'tv_num' :null,
@@ -300,13 +300,13 @@ HotelTV.ui_appfull = (function() {
let _cur_date = new Date();
if ( __uifxn_Utils_CheckKeyisNumber(_evt.keyCode)==true ){
_lastTm.keyevt.tv_num = _cur_date;
_tmrEvt.keyevt.tv_num = _cur_date;
} else if ( _evt.keyCode == gRmtKey.up || _evt.keyCode == gRmtKey.down ||
_evt.keyCode == gRmtKey.left || _evt.keyCode == gRmtKey.right ||
_evt.keyCode == gRmtKey.chup || _evt.keyCode == gRmtKey.chdown ) {
_lastTm.keyevt.tv_ctrl = _cur_date;
_tmrEvt.keyevt.tv_ctrl = _cur_date;
}
_lastTm.keyevt.last = _cur_date;
_tmrEvt.keyevt.last = _cur_date;
}
@@ -485,20 +485,40 @@ HotelTV.ui_appfull = (function() {
if ( _evt.connected==true ){
_state.menu.stage.prev = _state.menu.stage.cur;
_state.menu.stage.cur = "external_av_hdmi";
_state.external_input.connected = true;
_state.external_input.last_input.index = Number(_evt.index)-1;
setTimeout(function(){
$('body,html').fadeOut(500, function(){
HotelTV.hcap.SetExternalInput("HDMI", Number(_evt.index)-1);
let __retSuccess = HotelTV.hcap.SetExternalInput("HDMI", Number(_evt.index)-1);
if ( __retSuccess==false ){
_state.external_input.connected = false;
_state.external_input.last_input.index = 0;
if ( $('body,html').css('display')=="none" ){
$('body,html').fadeIn(500, function(){
__uifxn_AppFull_BuildNews();
if ( _state.menu.stage.prev!=null ){
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
}
__uifxn_AppFull_RefreshNews(500);
});
}
}
});
}, 1000);
HotelTV.ui_utils.ShowNotificationMsgBalloon(_trTbl.system.notice.event.external_input.hdmi_connected[_state.lang], 5);
}else{
_state.external_input.connected = false;
_state.external_input.last_input.index = 0;
if ( $('body,html').css('display')=="none" ){
$('body,html').fadeIn(500);
if ( _state.menu.stage.prev!=null ){
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
}
$('body,html').fadeIn(500, function(){
__uifxn_AppFull_BuildNews();
if ( _state.menu.stage.prev!=null ){
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
}
__uifxn_AppFull_RefreshNews(500);
});
}
}
}
@@ -512,16 +532,52 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
// Set tv playing flag
_state.tv.playing = true;
// {Boolean} param.result - true if the current channel is changed successfully, else false.
// {String} param.errorMessage - in case of failure, this message provides the details.
console.log(
"Event 'channel_changed' is received. " +
"Result = " + _evt.result + "Error message = " + _evt.errorMessage
);
if ( _evt.result==true ) {
_state.tv.playing = true;
} else {
console.log("Event 'channel_changed' is failure::> " + _evt.errorMessage );
}
}
/**
* HotelTV UI Wrapper Function::> received event handling function
*/
function __uifxn_AppFull_OnPwrModeChangeEvt() {
let _state = HotelTV.state;
let _tvMenu_stages = "tvCtgHide tvCtgShow tvShortcut tvPreparing";
if ( _tvMenu_stages.includes(_state.menu.stage.cur)==true ){
hcap.power.getPowerMode({
"onSuccess" : function(s) {
console.log("onSuccess power mode " + s.mode);
if ( s.mode==hcap.power.PowerMode.NORMAL ){
console.log("Need to restart channel...");
__uifxn_AppFull_TVRequestChannel(null, null);
}
},
"onFailure" : function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
}
});
} else if ( _state.menu.stage.cur=="external_av_hdmi" ) {
let __retSuccess = HotelTV.hcap.SetExternalInput("HDMI", _state.external_input.last_input.index);
if ( __retSuccess==false ){
_state.external_input.connected = false;
_state.external_input.last_input.index = 0;
if ( $('body,html').css('display')=="none" ){
$('body,html').fadeIn(500);
if ( _state.menu.stage.prev!=null ){
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
}
}
}
}
console.log("Event 'power_mode_changed' is received. ");
}
/**
@@ -3794,6 +3850,25 @@ HotelTV.ui_appfull = (function() {
return;
}
/**
* HotelTV UI[AppFull] Wrapper Function::> refresh news
*/
function __uifxn_AppFull_RefreshNews(_tmDelay) {
let _hndlNewsTicker = $('.news>.newsctz #hoteltv-news-ticker');
const __ifxn_refreshNewsTicker = function(_timeDelay=2000){
_hndlNewsTicker.webTicker('stop');
_hndlNewsTicker.children().remove();
setTimeout(__uifxn_AppFull_BuildNews, _timeDelay);
}
try {
__ifxn_refreshNewsTicker( _tmDelay );
} catch ( _err ){
console.error(`Fail to update::> ${_err}`);
}
}
/**
* HotelTV UI[AppFull] Wrapper Function::> build news
@@ -3810,9 +3885,17 @@ HotelTV.ui_appfull = (function() {
let sz_li_news = "";
for (let _nwsIdx = 1; _nwsIdx <= _newsInfo.length; _nwsIdx++) {
if (_newsInfo[_nwsIdx].logo.download != "") {
sz_li_news += `<li data-update=item${_nwsIdx}><img src=" ${_newsInfo[_nwsIdx].logo.download}"/>${_newsInfo[_nwsIdx].content[_state.lang]}</li>`;
if (_newsInfo[_nwsIdx].multilanguage == true) {
sz_li_news += `<li data-update=item${_nwsIdx}><img src=" ${_newsInfo[_nwsIdx].logo.download}"/>${_newsInfo[_nwsIdx].content[_state.lang]}</li>`;
} else {
sz_li_news += `<li data-update=item${_nwsIdx}><img src=" ${_newsInfo[_nwsIdx].logo.download}"/>${_newsInfo[_nwsIdx].content.default}</li>`;
}
} else {
sz_li_news += `<li data-update=item${_nwsIdx}>${_newsInfo[_nwsIdx].content[_state.lang]}</li>`;
if (_newsInfo[_nwsIdx].multilanguage == true) {
sz_li_news += `<li data-update=item${_nwsIdx}>${_newsInfo[_nwsIdx].content[_state.lang]}</li>`;
} else {
sz_li_news += `<li data-update=item${_nwsIdx}>${_newsInfo[_nwsIdx].content.default}</li>`;
}
}
}
_hndlNewsTicker.html(sz_li_news);
@@ -3820,6 +3903,7 @@ HotelTV.ui_appfull = (function() {
height: '26px',
speed: 100
});
_hndlNewsTicker.webTicker('update');
} else {
let sz_li_news = "";
for (let _nwsIdx = 1; _nwsIdx <= _newsInfo.length; _nwsIdx++) {
@@ -3926,14 +4010,14 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
let _tm_diff_ms_tvctrl = 0;
if (_lastTm.keyevt.tv_ctrl == null) {
if (_tmrEvt.keyevt.tv_ctrl == null) {
return;
}
let _tm_cur = new Date();
_tm_diff_ms_tvctrl = Math.floor(_tm_cur.getTime() - _lastTm.keyevt.tv_ctrl.getTime());
_tm_diff_ms_tvctrl = Math.floor(_tm_cur.getTime() - _tmrEvt.keyevt.tv_ctrl.getTime());
//마지막 KEY 이벤트 수신 시간 갱신
//console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt.tv_ctrl} TMDiff::> ${_tm_diff_ms}`);
//console.log(`KeyDn Event Recoreded::> ${_tmrEvt.keyevt.tv_ctrl} TMDiff::> ${_tm_diff_ms}`);
// TV Channel UI 지속 시간 2초
if ( _state.menu.stage.cur=="tvShortcut" )
@@ -4526,6 +4610,7 @@ HotelTV.ui_appfull = (function() {
}
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').removeClass('focus');
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').filter("[msgidx='" + __curMsgDspIdx + "']").addClass('focus');
HotelTV.ui_utils.ShowNotificationMsgBalloon(_trTbl.ui.guide.navi_mypageMsgSel[_state.lang], 5);
} else if (_mp_sm == "mpsel_replaywelcome") {
_state.menu.main[_mmIdx].cur = __ifxn_getMyPaggeItemIndex(_mpinfo,'replaywelcome');
}
@@ -4567,14 +4652,14 @@ HotelTV.ui_appfull = (function() {
let _need_to_changeTVChannel = false;
let _tm_diff_ms = 0;
if (_lastTm.tvchannel_changed == null) {
_lastTm.tvchannel_changed = new Date();
if (_tmrEvt.tvchannel_changed == null) {
_tmrEvt.tvchannel_changed = new Date();
_need_to_changeTVChannel = true;
} else {
let _tm_cur = new Date();
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _lastTm.tvchannel_changed.getTime());
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _tmrEvt.tvchannel_changed.getTime());
//마지막 TV채널 변경 시간 갱신
_lastTm.tvchannel_changed = _tm_cur;
_tmrEvt.tvchannel_changed = _tm_cur;
if (_tm_diff_ms > 200) {
_need_to_changeTVChannel = true;
@@ -5580,8 +5665,8 @@ HotelTV.ui_appfull = (function() {
}
// 초기 채널 카테고리 슬라이더 표시 시간 증가
_lastTm.keyevt.tv_ctrl = new Date();
_lastTm.keyevt.tv_ctrl.setSeconds(_lastTm.keyevt.tv_ctrl.getSeconds() + 3);
_tmrEvt.keyevt.tv_ctrl = new Date();
_tmrEvt.keyevt.tv_ctrl.setSeconds(_tmrEvt.keyevt.tv_ctrl.getSeconds() + 3);
if (!(_mmIdx in _state.menu.main)) {
_state.menu.main[_mmIdx] = {
@@ -5759,10 +5844,10 @@ HotelTV.ui_appfull = (function() {
}
}
} else if (_state.menu.stage.cur == "tvCtgHide") {
if (event.keyCode == gRmtKey.chup) {
if (event.keyCode == gRmtKey.up || event.keyCode == gRmtKey.chup) {
// 채널 리스트 아이탬 이동(CHUP)
__ifxn_moveTvChannel(_tvProg, "ch_up");
} else if (event.keyCode == gRmtKey.chdown) {
} else if (event.keyCode == gRmtKey.down || event.keyCode == gRmtKey.chdown) {
// 채널 리스트 아이탬 이동(CHDOWN)
__ifxn_moveTvChannel(_tvProg, "ch_down");
} else if (event.keyCode == gRmtKey.back) {
@@ -5791,8 +5876,8 @@ HotelTV.ui_appfull = (function() {
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
_lastTm.keyevt.tv_ctrl = new Date();
_lastTm.keyevt.tv_ctrl.setSeconds(_lastTm.keyevt.tv_ctrl.getSeconds() - 3);
_tmrEvt.keyevt.tv_ctrl = new Date();
_tmrEvt.keyevt.tv_ctrl.setSeconds(_tmrEvt.keyevt.tv_ctrl.getSeconds() - 3);
} else {
__uifxn_AppFull_TVDrawShortCutList(true, "move", event.keyCode);
console.log("TVSHORTCUT CHNUM: " + _state.tv.shortkey.ch_item_idx);
@@ -5806,6 +5891,7 @@ HotelTV.ui_appfull = (function() {
$('#lst_tvCtgbg').on('translated.owl.carousel', function(event) {
__uifxn_AppFull_TVUpdateChList("on_load");
HotelTV.ui_utils.ShowNotificationMsgBalloon(_trTbl.ui.guide.navi_tvcategory[_state.lang], 10);
});
@@ -5849,16 +5935,16 @@ HotelTV.ui_appfull = (function() {
let _tm_diff_ms = 0;
if (_lastTm.keyevt.last == null) {
_lastTm.keyevt.last = new Date();
if (_tmrEvt.keyevt.last == null) {
_tmrEvt.keyevt.last = new Date();
console.log("keyevt.last is NULL");
return;
}
let _tm_cur = new Date();
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _lastTm.keyevt.last.getTime());
_tm_diff_ms = Math.floor(_tm_cur.getTime() - _tmrEvt.keyevt.last.getTime());
//마지막 KEY 이벤트 수신 시간 갱신
//console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt.last} TMDiff::> ${_tm_diff_ms}`);
//console.log(`KeyDn Event Recoreded::> ${_tmrEvt.keyevt.last} TMDiff::> ${_tm_diff_ms}`);
if (_state.menu.stage.cur == "mypage_popup_message_card") {
//HIDE NEWS and USER GUIDE TIPS
@@ -6951,6 +7037,8 @@ HotelTV.ui_appfull = (function() {
document.addEventListener("hdmi_connection_changed", __uifxn_AppFull_OnHdmiConChangeEvt, false);
//ADD Event for the result of channel changed
document.addEventListener("channel_changed", __uifxn_AppFull_OnTvChChgChangeEvt, false);
//ADD power mode changed
document.addEventListener("power_mode_changed", __uifxn_AppFull_OnPwrModeChangeEvt, false);
},
Show: function() {
@@ -7124,13 +7212,34 @@ HotelTV.ui_appfull = (function() {
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff, 500);
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-CHECKIN") {
let _tmval = 10;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
} else if (_evt == "COMMAND-GUEST-CHECKOUT") {
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.system_reboot[_state.lang], {
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-CHECKOUT" || _evt == "COMMAND-SYSTEM-STOP") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
@@ -7171,10 +7280,10 @@ HotelTV.ui_appfull = (function() {
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff, 500);
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});

View File

@@ -364,7 +364,7 @@ HotelTV.ui_welcome = (function() {
"video/mp4",
1,
() => {
HotelTV.ui_utils.SetBusy(false);
setTimeout(HotelTV.ui_utils.SetBusy, 2000, false);
console.log("STARTUP Done CB.");
//Shows up skip button
let _elmnt_btn_skip = $(".control .skip_video");
@@ -479,13 +479,34 @@ HotelTV.ui_welcome = (function() {
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff, 500);
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-CHECKIN") {
let _tmval = 10;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
} else if (_evt == "COMMAND-GUEST-CHECKOUT") {
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.system_reboot[_state.lang], {
"timeout": _tmval,
"cb_disp": function() {
_tmval -= 1;
console.log("time..." + _tmval);
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "COMMAND-GUEST-CHECKOUT" || _evt == "COMMAND-SYSTEM-STOP") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
@@ -526,10 +547,10 @@ HotelTV.ui_welcome = (function() {
if ($('.error #countdown').css("display") == "none") {
$('.error #countdown').fadeIn(1000);
}
$('.error #countdown #message').text(`System will be shutdown in ${_tmval} second...`);
$('.error #countdown #message').text(`System will be restart in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff, 500);
setTimeout(HotelTV.hcap.Reboot, 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});

View File

@@ -171,7 +171,7 @@ div#lst_mypagebg div #mp_hotel_infowin {
}
div#lst_mypagebg div #mp_hotel_infowin .hotelinfo_item {
width: 506px;
width: 32%;
height: 100%;
display: inline-block;
padding: 5px;

View File

@@ -35,8 +35,8 @@
background-image: none;
background-size: contain;
background-repeat: no-repeat;
background-position: left center;
margin: 10px 0 4px 20px;
background-position: center center;
margin: 10px 0 4px 10px;
display: block;
}

View File

@@ -157,23 +157,3 @@ body {
background-repeat: no-repeat;
display: none;
}
#debugwin {
z-index: 10000;
position: absolute;
top: 11px;
bottom: 22px;
right: 11px;
font-size: 12px;
background-color: rgba(18, 18, 18, 0.3);
text-align: left;
color: rgb(235, 235, 235);
line-height: 24px;
padding-left: 5px;
padding-top: 5px;
display: inline-flex;
max-width: 500px;
overflow-wrap: break-word;
word-wrap: break-word;
display: none;
}

View File

@@ -157,23 +157,3 @@ body {
background-repeat: no-repeat;
display: none;
}
#debugwin {
z-index: 10000;
position: absolute;
top: 11px;
bottom: 22px;
right: 11px;
font-size: 12px;
background-color: rgba(18, 18, 18, 0.3);
text-align: left;
color: rgb(235, 235, 235);
line-height: 24px;
padding-left: 5px;
padding-top: 5px;
display: inline-flex;
max-width: 500px;
overflow-wrap: break-word;
word-wrap: break-word;
display: none;
}

View File

@@ -171,7 +171,7 @@ div#lst_mypagebg div #mp_hotel_infowin {
}
div#lst_mypagebg div #mp_hotel_infowin .hotelinfo_item {
width: 506px;
width: 32%;
height: 100%;
display: inline-block;
padding: 5px;

View File

@@ -1055,6 +1055,8 @@
width: 50%;
float: left;
padding: 0px 0px 0px 20px;
text-overflow: ellipsis;
overflow: hidden;
}
.popup .amenity .bg .owl-carousel .owl-stage .am_item_sel_cart_win .winright>.cart_table>.tbl_record tbody tr>.cartItem>#quantity {
@@ -2730,6 +2732,8 @@
.popup>.mypage {
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
}

View File

@@ -157,23 +157,3 @@ body {
background-repeat: no-repeat;
display: none;
}
#debugwin {
z-index: 10000;
position: absolute;
top: 11px;
bottom: 22px;
right: 11px;
font-size: 12px;
background-color: rgba(18, 18, 18, 0.3);
text-align: left;
color: rgb(235, 235, 235);
line-height: 24px;
padding-left: 5px;
padding-top: 5px;
display: inline-flex;
max-width: 500px;
overflow-wrap: break-word;
word-wrap: break-word;
display: none;
}

View File

@@ -118,4 +118,26 @@
100% {
opacity: 0;
}
}
#debugwin {
z-index: 10000;
position: absolute;
top: 11px;
bottom: 22px;
right: 11px;
font-size: 12px;
background-color: rgba(18, 18, 18, 0.3);
text-align: left;
color: rgb(235, 235, 235);
line-height: 24px;
padding-left: 5px;
padding-top: 5px;
display: inline-flex;
max-width: 500px;
overflow-wrap: break-word;
word-wrap: break-word;
display: none;
}

View File

@@ -60,6 +60,9 @@
<div></div>
</div>
</div>
<!-- Debug frame Layout -->
<div id="debugwin"></div>
</body>