issue#1 Support error screen. Support notification balloon for neflix service preparing. Going on tune up UI.

This commit is contained in:
Paul Kim
2022-06-08 02:22:39 +09:00
parent 8b0160bfda
commit cf95ff42b0
16 changed files with 628 additions and 250 deletions

View File

@@ -6,7 +6,7 @@
* @summary short description for the file
* @author Joel <joel.kim@centirm.com>
*
* Created at : 2020-11-26 02:21:56
* Created at : 2020-11-26 02:21:56
* Last modified : 2020-11-26 15:31:40
*/
@@ -21,7 +21,8 @@ HotelTV.api = (function() {
_token = "aLc*eBgTijklRnopq4s",
_registered = false,
_exist = false,
_svr_port = 0;
_svr_port = 0,
_1stBoot = false;
//// 비공개 프로퍼티
@@ -29,7 +30,7 @@ HotelTV.api = (function() {
//// 비공개 매써드
/**
*
*
*/
function __apifxn_init(param) {
_api_ver = param.api_ver;
@@ -41,6 +42,7 @@ HotelTV.api = (function() {
_token = param.apikey;
_registered = param.registered;
_exist = param.exist;
_1stBoot = param.firstBoot;
}
@@ -200,17 +202,17 @@ HotelTV.api = (function() {
return new Promise((resolve, reject) => {
if (HotelTV.state.token) {
let _token = HotelTV.state.token;
__apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': _token.version, "license": _token.license, "apikey": _token.apikey, "registered": _token.registered, "exist": _token.exist });
__apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': _token.version, "license": _token.license, "apikey": _token.apikey, "registered": _token.registered, "exist": _token.exist, "firstBoot": false });
resolve(0);
} else {
// licenses api format
// licenses api format
// <svr ip:svr port>/api/licenses/us761h0n/103INLV4B896
var sz_api_url = "http://" + ip + ":" + port + "/api/licenses" + "/" + model + "/" + serial;
console.log("Debug: request token url:" + sz_api_url);
__apifxn_CallCmsApi("GET", sz_api_url, "GetToken", null).then(_result => {
//console.log(`Success::>${_result.data}`);
HotelTV.state.token = JSON.parse(_result.data);
__apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': HotelTV.state.token.version, "license": HotelTV.state.token.license, "apikey": HotelTV.state.token.apikey, "registered": HotelTV.state.token.registered, "exist": HotelTV.state.token.exist });
__apifxn_init({ 'dev_familly': model, 'serial_num': serial, 'svr_ip': ip, 'svr_port': port, 'api_ver': HotelTV.state.token.version, "license": HotelTV.state.token.license, "apikey": HotelTV.state.token.apikey, "registered": HotelTV.state.token.registered, "exist": HotelTV.state.token.exist, "firstBoot": HotelTV.state.token.firstBoot });
resolve(0);
}).catch(_error => {
console.log(`Failure::>${_error.reason}`);
@@ -506,7 +508,7 @@ HotelTV.api = (function() {
},
/**
* HotelTV API ::> order amenity
* HotelTV API ::> order amenity
* @param {dictionary} _cart_id if _item_id isn't null it will return specified info with _item_id
*/
PutAmenityOrders: function(_cart_item) {
@@ -607,7 +609,7 @@ HotelTV.api = (function() {
},
/**
* HotelTV API ::> order room service
* HotelTV API ::> order room service
* @param {dictionary} _cart_id if _item_id isn't null it will return specified info with _item_id
*/
PutRoomserviceOrders: function(_cart_item) {

View File

@@ -649,7 +649,7 @@ HotelTV.hcap = (function() {
hcap.channel.setStartChannel({
"channelType": hcap.channel.ChannelType.UNKNOWN,
"onSuccess": function() {
console.log("onSuccess::StartChanell Cetting");
console.log("onSuccess::StartChanell Setting");
},
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
@@ -810,6 +810,7 @@ HotelTV.hcap = (function() {
// mode : bridge, securityType : psk
hcap.network.setSoftAP({
"channel": Number(_wlan_cfg.channel),
"vlanId": 0,
"signalStrength": Number(_wlan_cfg.signalStrength),
"mode": "bridge",
"securityType": (_wlan_cfg.securityType == "open") ? "open" : "psk",
@@ -1004,14 +1005,14 @@ HotelTV.hcap = (function() {
for (let i = 0; i < _ret.length; i++) {
let _set_item = _ret[i];
let no_need_reboot_param = ["wifi_screen_share", "soft_ap", "soft_ap_ui", "osd_layer_id"];
if (no_need_reboot_param.indexOf(_set_item.key) !== -1) {
if (no_need_reboot_param.indexOf(_set_item.key) == -1) {
//Needed reboot the system
need_to_reboot = true;
}
console.log(`Device config[${_set_item.key}] set to ${_set_item.value}`);
}
resolve(need_to_reboot);
});
resolve(need_to_reboot);
} else {
resolve(need_to_reboot);
}
@@ -1200,7 +1201,30 @@ HotelTV.hcap = (function() {
},
PreAppGetInfo: function(_en_show_msg) {
if (g_hcap_info.preapp == null) {
// if (g_hcap_info.preapp == null) {
// hcap.preloadedApplication.getPreloadedApplicationList({
// "onSuccess": function(s) {
// if (_en_show_msg == true) {
// console.log("onSuccess : list length = " + s.list.length);
// for (var i = 0; i < s.list.length; i++) {
// console.log(
// "list[" + i + "].id = " + s.list[i].id +
// "list[" + i + "].title = " + s.list[i].title +
// "list[" + i + "].iconFilePath = " + s.list[i].iconFilePath
// );
// }
// }
// if (s.result == true) {
// g_hcap_info.preapp = s.list;
// }
// },
// "onFailure": function(f) {
// console.log("onFailure : errorMessage = " + f.errorMessage);
// }
// });
// }
return new Promise((resolve, reject) => {
hcap.preloadedApplication.getPreloadedApplicationList({
"onSuccess": function(s) {
if (_en_show_msg == true) {
@@ -1215,13 +1239,15 @@ HotelTV.hcap = (function() {
}
if (s.result == true) {
g_hcap_info.preapp = s.list;
resolve({ "error": 0, "applist": g_hcap_info.preapp });
}
},
"onFailure": function(f) {
console.log("onFailure : errorMessage = " + f.errorMessage);
resolve({ "error": -1, "applist": null });
}
});
}
});
},
LaunchPreApp: function(_name, _param) {
@@ -1245,7 +1271,7 @@ HotelTV.hcap = (function() {
if (item.title == 'Netflix') {
hcap.preloadedApplication.launchPreloadedApplication({
"id": item.id, // NETFLIX
"parameter": "{'params': {'hotel_id':'CENTIRM-Demo','launcher_version':'1.0'}",
"parameter": `{'params': {'hotel_id':${_param.hotel_name},'launcher_version':'1.0'}`,
"onSuccess": function() {
console.log("onSuccess");
},

View File

@@ -6,7 +6,7 @@
* @summary short description for the file
* @author Joel <joel.kim@centirm.com>
*
* Created at : 2020-11-26 02:21:56
* Created at : 2020-11-26 02:21:56
* Last modified : 2020-11-26 15:31:40
*/
@@ -74,7 +74,7 @@ var HotelTV = HotelTV || {
HotelTV.namespace = function(ns_string) {
var parts = ns_string.split('.'),
parent = HotelTV,
i; // 처음에 중복되는 전역 객체명은 제거한다.
i; // 처음에 중복되는 전역 객체명은 제거한다.
if (parts[0] == 'HotelTV') {
parts = parts.slice(1);
}
@@ -157,7 +157,7 @@ function __fxn_Set_DebugOpt() {
HotelTV.Init = async function() {
console.log("Start Initialization:: ");
//STEP#01::> Shutdown Channel
//STEP#01::> Shutdown Channel
HotelTV.hcap.ChannelShutDown();
//SETP#02::> Set Debug Options
@@ -169,7 +169,24 @@ HotelTV.Init = async function() {
await HotelTV.hcap.GetDevInfo();
//await HotelTV.hcap.ShowDevInfo();
} catch (_error) {
console.log("Fail to get device information");
let _tmval = 10;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-devinfo",
"SYSTEM ERROR",
"Fail to get System Information.\r\nplease contact your system administrator.", {
"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 reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
}
});
}
//STEP#04::> API Module INIT
@@ -179,7 +196,24 @@ HotelTV.Init = async function() {
let __apiRet = await HotelTV.api.CheckRegistration();
HotelTV.state['registration'] = await HotelTV.api.CheckRegistration();
} catch (_error) {
console.log("Display Error page for check registration");
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.check-registration",
"SYSTEM ERROR",
"Un registered device.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
if (HotelTV.state['registration'].registered != true) {
@@ -195,30 +229,115 @@ HotelTV.Init = async function() {
if (need_reboot == true) {
console.log("System Need to Reboot");
HotelTV.ui_utils.SetBusy(false);
HotelTV.ui_utils.ShowErrMsg(true, "", "");
setTimeout(HotelTV.hcap.Reboot(), 3000);
let _tmval = 20;
HotelTV.ui_utils.ShowErrMsg(true,
"system.info.change-configuration",
"SYSTEM INFO",
`System configuration was changed.\r\n\r\nSystem information summary::\r\nDevice Serial Number: ${HotelTV.devinfo.serial_number}\r\nThe Device Model Name: ${HotelTV.devinfo.model_name}\r\nNetwork Configuration:${HotelTV.devinfo.network_info.ip_address}/${HotelTV.devinfo.network_info.subnet_mask}/${HotelTV.devinfo.network_info.gateway}`, {
"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 reboot in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.Reboot(), 500);
}
});
return;
}
} catch (_error) {
console.log("Display Error page for get stttings");
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.set-devinfo",
"SYSTEM ERROR",
"Fail to configure device.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
try {
HotelTV.hotelinfo = await HotelTV.api.GetHotelInfo();
} catch (_error) {
console.log("Display Error page for get hotel info");
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-hotelinfo",
"SYSTEM ERROR",
"Fail to get hotel information.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
try {
HotelTV.guestinfo = await HotelTV.api.GetGuestInfo();
} catch (_error) {
console.log("Display Error page for get Guest info");
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-guestinfo",
"SYSTEM ERROR",
"Fail to get guest information.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
try {
HotelTV.opening = await HotelTV.api.GetOpeningCtz();
} catch (_error) {
console.log("Display Error page for get Opening Contents");
let _tmval = 50;
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-openingctzinfo",
"SYSTEM ERROR",
"Fail to get opening contents information.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
try {
@@ -236,7 +355,24 @@ HotelTV.Init = async function() {
try {
HotelTV.tvguide = await HotelTV.api.GetProgramCtz();
} catch (_error) {
console.log("Display Error page for get tvguide info");
//console.log("Display Error page for get tvguide info");
HotelTV.ui_utils.ShowErrMsg(true,
"system.error.get-tvguideinfo",
"SYSTEM ERROR",
"Fail to get tv program contents information.\r\nplease contact your system administrator.", {
"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(`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);
}
});
}
try {
@@ -403,30 +539,44 @@ HotelTV.LoadAppFull = async function() {
//STEP#03: INIT HCAP for HotelTV FullAPP
try {
let siAppToken = null;
let siAppName = null;
// siApp Token Authentication
let _progam = HotelTV.tvguide.program;
for (let _i = 1; _i <= _progam.length; _i++) {
if (_progam[_i].type == "application" && _progam[_i].service == "netflix") {
siAppToken = await HotelTV.api.DownloadData(_progam[_i].license.file.download);
siAppName = _progam[_i].service;
//siAppToken = _progam[_i].service;
if (siAppName && siAppToken) {
HotelTV.hcap.siAppAuth(siAppName, siAppToken, false);
}
let tmrAppAuth = setInterval(async function() {
let _foundNetflix = false;
let _hcapAppInfo = await HotelTV.hcap.PreAppGetInfo(false);
HotelTV.state['hcap_app'] = _hcapAppInfo.applist;
for (_i = 0; _i < HotelTV.state['hcap_app'].length; _i++) {
if (HotelTV.state['hcap_app'][_i].title == "Netflix") {
console.log("Found out netflix among of pre hcap app-list.")
clearInterval(tmrAppAuth);
}
}
} catch (_error) {
console.log("Display Error page for get siApp Auth");
}
if (_foundNetflix == false) {
try {
let siAppToken = null;
let siAppName = null;
// siApp Token Authentication
let _progam = HotelTV.tvguide.program;
for (let _i = 1; _i <= _progam.length; _i++) {
if (_progam[_i].type == "application" && _progam[_i].service == "netflix") {
siAppToken = await HotelTV.api.DownloadData(_progam[_i].license.file.download);
siAppName = _progam[_i].service;
//siAppToken = _progam[_i].service;
if (siAppName && siAppToken) {
HotelTV.hcap.siAppAuth(siAppName, siAppToken, false);
}
}
}
} catch (_error) {
console.log("Display Error page for get siApp Auth");
}
}
}, 5000);
//STEP#05: Set Display size
let _res = HotelTV.devinfo.display_resolution.split("x");
HotelTV.ui_appfull.Init(_res[0], _res[1]);
HotelTV.hcap.PreAppGetInfo(false);
//STEP#06; Show UI
//await HotelTV.hcap.ShowDevInfo();
@@ -470,28 +620,28 @@ HotelTV.LoadAppFull = async function() {
// }
// } else if (recvMsg.event == "update_weather") {
// } else if (recvMsg.event == "update_report") {
// // HotelTV.hcap.GetUptime();
// // HotelTV.hcap.GetDeviceUsage().then(_usage => {
// // //console.log(`USAGE::> CPU[${_usage.cpu}%] RAM[${_usage.mem}%]`);
// // //HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage);
// // });
// } else if (recvMsg.event == "mqtt_events") {
// console.log(`MQTTMSG::> ${recvMsg.data}`);
// }
// if (recvMsg.event == "update_report") {
// HotelTV.hcap.GetUptime();
// HotelTV.hcap.GetDeviceUsage().then(_usage => {
// console.log(`USAGE::> CPU[${_usage.cpu}%] RAM[${_usage.mem}%]`);
// //HotelTV.api.ReportBrief(HotelTV.devinfo, HotelTV.guestinfo, _usage);
// });
// }
}
} else {
console.log('Your browser doesn\'t support web workers.')
}
//STEP#07 MQTT Service
//STEP#07 MQTT Service
if (HotelTV.services) {
if (HotelTV.services.mqtt) {
let _mqttSvcInfo = HotelTV.services.mqtt;
if (_mqttSvcInfo.protocol == "ws") {
var client = mqtt.connect(
//'ws://' + HotelTV.svrinfo.ipaddr + ':9001',
//'ws://' + HotelTV.svrinfo.ipaddr + ':9001',
'ws://' + _mqttSvcInfo.host + ':' + _mqttSvcInfo.port, {
clean: true, // retain session
connectTimeout: 4000, // Timeout period
@@ -502,20 +652,6 @@ HotelTV.LoadAppFull = async function() {
);
client.on('connect', function() {
// let sz_topic = ['ctlxb0_' + HotelTV.devinfo.serial_number + '/topic', 'ctlxb0_all/topic'];
// client.subscribe(sz_topic[0], function(err) {
// if (err) {
// console.log(`Fail to subscribe::TOPIC[${sz_topic[0]}]`);
// }
// });
// client.subscribe(sz_topic[1], function(err) {
// if (err) {
// console.log(`Fail to subscribe::TOPIC[${sz_topic[1]}]`);
// }
// })
client.subscribe(_mqttSvcInfo.topic, function(err) {
if (err) {
console.log(`Fail to subscribe::TOPIC[${_mqttSvcInfo.topic}]`);

View File

@@ -129,9 +129,9 @@ HotelTV.ui_appfull = (function() {
let _typeAppFocusEvt = _evt.eventType;
if (_typeAppFocusEvt == "focused") {
HotelTV.hcap.SetSoftAp({
"enable": false,
});
// HotelTV.hcap.SetSoftAp({
// "enable": false,
// });
}
}
@@ -301,7 +301,7 @@ HotelTV.ui_appfull = (function() {
// Free count value
_elAmItemTblRecRoot.children('div#details').children(`div#freecnt_val`).text(__fxn_fmvalue(_carts.items, "freeCount", _amItem.id));
// Price value
_elAmItemTblRecRoot.children('div#details').children(`div#price_val`).text(__fxn_fmvalue(_carts.items, "price", _amItem.id)[_state.lang] + _amenity.currency[_state.lang]);
_elAmItemTblRecRoot.children('div#details').children(`div#price_val`).text(__fxn_fmvalue(_carts.items, "price", _amItem.id)[_state.lang].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + _amenity.currency[_state.lang]);
// Order Count
_elAmItemTblRecRoot.children(`div#quantity_val`).text(__fxn_fmvalue(_carts.items, "quantity", _amItem.id));
}
@@ -778,7 +778,7 @@ HotelTV.ui_appfull = (function() {
let _elRsItemTblRecRoot = _elRsMnRoot.children('div.items').children('table').children(`tr#${_rsItem.id}`).children('div.products');
if (_carts.items.length && __fxn_fmexist(_carts.items, _rsItem.id) == true) {
// amount value
_elRsItemTblRecRoot.children('div#details').children('#price').text(__fxn_fmvalue(_carts.items, "amount", _rsItem.id)[_state.lang] + _roomservice.currency[_state.lang]);
_elRsItemTblRecRoot.children('div#details').children('#price').text(__fxn_fmvalue(_carts.items, "amount", _rsItem.id)[_state.lang].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + _roomservice.currency[_state.lang]);
// Order Count
_elRsItemTblRecRoot.children('div#details').children('#quantity').children(`#value`).text(__fxn_fmvalue(_carts.items, "quantity", _rsItem.id));
}
@@ -1876,7 +1876,7 @@ HotelTV.ui_appfull = (function() {
HotelTV.api.SetMessageStatus(_cur_msgdesc._id);
_cur_msgdesc.read = true;
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').filter("[msgidx='" + _cur_msglst_idx.toString() + "']").children('td#num').addClass('read');
__uifxn_AppFull_Widjet_ShowMsgCnt();
__uifxn_AppFull_TopWidjet_BuildMsgCnt();
});
}
}
@@ -2956,7 +2956,7 @@ HotelTV.ui_appfull = (function() {
//
if (_state.menu.stage == "popup_message_card") {
//HIDE NEWS and USER GUIDE TIPS
if (_newsInfo == null || Object.keys(_newsInfo).length == 0) {
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
@@ -2968,7 +2968,7 @@ HotelTV.ui_appfull = (function() {
return;
} else if (_state.menu.stage == "tvCtgHide") {
//HIDE NEWS and USER GUIDE TIPS
if (_newsInfo == null || Object.keys(_newsInfo).length == 0) {
if (_newsInfo == null || newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
@@ -3041,7 +3041,7 @@ HotelTV.ui_appfull = (function() {
if ($('.guide>.tips').css('display') == "none") {
$('.guide>.tips').fadeIn(500, function() {
//SHOW NEWS
if (_newsInfo == null || Object.keys(_newsInfo).length == 0) {
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
@@ -3069,20 +3069,26 @@ HotelTV.ui_appfull = (function() {
}
} else {
//HIDE TIPS and then SHOW NEWS
if (_newsInfo == null || Object.keys(_newsInfo).length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
} else {
if ($('.guide>.tips').css('display') == "block") {
$('.guide>.tips').fadeOut(500, function() {
if ($('.guide>.tips').css('display') == "block") {
$('.guide>.tips').fadeOut(500, function() {
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
} else {
if ($('.news').css('display') != "block") {
$('.news').fadeIn(500, function() {
__uifxn_AppFull_BldNews();
$('.news>.newsctz #hoteltv-news-ticker').webTicker('cont');
});
}
});
}
});
} else {
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
} else {
if ($('.news').css('display') != "block") {
$('.news').fadeIn(500, function() {
@@ -3095,7 +3101,7 @@ HotelTV.ui_appfull = (function() {
}
} else {
//HIDE NEWS and USER GUIDE TIPS
if (_newsInfo == null || Object.keys(_newsInfo).length == 0) {
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
@@ -3104,15 +3110,20 @@ HotelTV.ui_appfull = (function() {
if ($('.guide>.tips').css('display') != "none") {
$('.guide>.tips').fadeOut(500, function() {
if ($('.news').css('display') != "none") {
if ($('.news>.newsctz #hoteltv-news-ticker').children().length > 0) {
$('.news>.newsctz #hoteltv-news-ticker').webTicker('stop');
$('.news').fadeOut(500);
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
$('.news').hide();
}
} else {
if ($('.news').css('display') != "none") {
if ($('.news>.newsctz #hoteltv-news-ticker').children().length > 0) {
$('.news>.newsctz #hoteltv-news-ticker').webTicker('stop');
$('.news').fadeOut(500);
}
}
}
});
}
}
}
@@ -3186,7 +3197,7 @@ HotelTV.ui_appfull = (function() {
* HotelTV UI Wrapper Function::> Show Top Widjet Weather
* @param {boolean} _en show/hide
*/
function __uifxn_AppFull_Widjet_ShowWeather(_en) {
function __uifxn_AppFull_TopWidjet_BuildWeather() {
let _weather = HotelTV.weather;
$('.widjet .top .weather #icon').css({ "background-image": "url(" + _weather.smallicon_image[_weather.item.condition.code] + ")" });
$('.widjet .top .weather #temp').text(_weather.item.condition.temp + "°C");
@@ -3198,7 +3209,7 @@ HotelTV.ui_appfull = (function() {
* HotelTV UI Wrapper Function::> Show Top Widjet Message Cnt(Unread)
* @param {boolean} _en show/hide
*/
function __uifxn_AppFull_Widjet_ShowMsgCnt(_en) {
function __uifxn_AppFull_TopWidjet_BuildMsgCnt(_en) {
let _msgCnt = 0;
const _state = HotelTV.state;
const _guest = HotelTV.guestinfo;
@@ -3224,6 +3235,22 @@ HotelTV.ui_appfull = (function() {
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msgCnt.toString()));
}
/**
* HotelTV UI Wrapper Function::> Show Top Widjet Weather
* @param {boolean} _show show/hide
*/
function __uifxn_AppFull_TopWidjetShow(_show) {
if (_show == true) {
if ($('.widjet .top').css("display") == "none") {
$('.widjet .top').fadeIn(300);
}
} else {
if ($('.widjet .top').css("display") != "none") {
$('.widjet .top').fadeOut(300);
}
}
}
/**
* HotelTV UI Wrapper Function::> Build Main Menu::> Flight
@@ -3517,10 +3544,10 @@ HotelTV.ui_appfull = (function() {
$('.widjet .top .hotellogo').css({ "background-image": "url(" + HotelTV.hotelinfo.subLogo.download + ")" });
//상단 날씨 아이콘 및 온도 표시
__uifxn_AppFull_Widjet_ShowWeather();
__uifxn_AppFull_TopWidjet_BuildWeather();
//상단 메시지(unread)개수 표시
__uifxn_AppFull_Widjet_ShowMsgCnt();
__uifxn_AppFull_TopWidjet_BuildMsgCnt();
// //상단 시계 표시
_hndl_widget_topTime = setInterval(() => {
@@ -3530,6 +3557,8 @@ HotelTV.ui_appfull = (function() {
$('.widjet .top .datetime .date').text(_szCurTm.date);
}, 1000);
__uifxn_AppFull_TopWidjetShow(true);
//Weather Contents Buildup
__uifxn_AppFull_MM_BldWeather();
@@ -3609,14 +3638,27 @@ HotelTV.ui_appfull = (function() {
} else if (_program[Number(_state.menu.main.cur)].type.toLowerCase() == "application") {
console.log("Preparing TV APP::>" + _program[Number(_state.menu.main.cur)].service);
if (_program[Number(_state.menu.main.cur)].service == "youtube") {
console.log(`Type:${_program[Number(_state.menu.main.cur)].type} preparing WIFI AP...`);
HotelTV.hcap.SetSoftAp({
"enable": true,
"ssid": "TVWIFI-" + HotelTV.guestinfo.room,
"password": "12345678",
});
// console.log(`Type:${_program[Number(_state.menu.main.cur)].type} preparing WIFI AP...`);
// HotelTV.hcap.SetSoftAp({
// "enable": true,
// "ssid": "TVWIFI-" + HotelTV.guestinfo.room,
// "password": "12345678",
// });
HotelTV.hcap.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null);
} else if (_program[Number(_state.menu.main.cur)].service == "netflix") {
let _foundNetflix = false;
for (_i = 0; _i < _state['hcap_app'].length; _i++) {
if (_state['hcap_app'][_i].title == 'Netflix') {
_foundNetflix = true;
}
}
if (_foundNetflix == true) {
HotelTV.hcap.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, { "hotel_name": HotelTV.hotelinfo.name });
} else {
HotelTV.ui_utils.ShowNotificationMsgBalloon("서비스를 중비 중입니다. 잠시후에 이용해 주세요.", 5);
}
}
HotelTV.hcap.LaunchPreApp(_program[Number(_state.menu.main.cur)].service, null);
} else {
console.log(`Type:${_program[Number(_state.menu.main.cur)].type} doen's have sub menu...`);
}
@@ -3628,6 +3670,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_red').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_red";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.red.type == "amenity") {
$('.popup .amenity').show(0, function() {
@@ -3654,6 +3697,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_green').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_green";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.green.type == "amenity") {
$('.popup .amenity').show(0, function() {
@@ -3680,6 +3724,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_yellow').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_yellow";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.yellow.type == "amenity") {
$('.popup .amenity').show(0, function() {
@@ -3706,6 +3751,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_blue').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_blue";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.blue.type == "amenity") {
$('.popup .amenity').show(0, function() {
@@ -3777,6 +3823,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_red').css({ "background-color": "" });
_state.menu.stage = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
@@ -3792,6 +3839,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_green').css({ "background-color": "" });
_state.menu.stage = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
@@ -3811,6 +3859,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_yellow').css({ "background-color": "" });
_state.menu.stage = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
@@ -3830,6 +3879,7 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_blue').css({ "background-color": "" });
_state.menu.stage = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
@@ -4140,7 +4190,7 @@ HotelTV.ui_appfull = (function() {
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msg_unread_cnt.toString()));
//widjet 상단 메시지(unread)개수 표시
__uifxn_AppFull_Widjet_ShowMsgCnt();
__uifxn_AppFull_TopWidjet_BuildMsgCnt();
}).catch(_error => {
console.log("Fail to get Message info");
});
@@ -4172,6 +4222,7 @@ HotelTV.ui_appfull = (function() {
UpdateEpg: function() {
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
if (_state.menu.stage != 'tvCtgHide') {
return;
@@ -4187,7 +4238,7 @@ HotelTV.ui_appfull = (function() {
if (_epg_inf != null) {
_ch.text(_egp_prog_inf.name);
} else {
_ch.text(HotelTV.ui_utils.Get_String('epg_none', _state.lang));
_ch.text(_trTbl.ui.tv.epg.msg.none_epg_info[_state.lang]);
}
});
});

View File

@@ -15,50 +15,12 @@ HotelTV.ui_utils = (function() {
//// 의존 관계 선언
//// 비공개 프로퍼티
let g_uiTbl_imgPath_Brochure_buttons = {
'ko-KR': "./images/brochure/bt_brochure_ko.png",
'en-US': "./images/brochure/bt_brochure_en.png",
'zh-CN': "./images/brochure/bt_brochure_ch01.png",
'zh-TW': "./images/brochure/bt_brochure_ch02.png",
'ja-JP': "./images/brochure/bt_brochure_jp.png"
};
let g_uiTbl_imgPath_InRoomDining_buttons = {
'ko-KR': "./images/IRD/bt_inroom_ko.png",
'en-US': "./images/IRD/bt_inroom_en.png",
'zh-CN': "./images/IRD/bt_inroom_ch01.png",
'zh-TW': "./images/IRD/bt_inroom_ch02.png",
'ja-JP': "./images/IRD/bt_inroom_jp.png"
};
let g_uiTbl_String = {
// //Words & Sentance for Menu & Contents
// 'guide_flightschedule': {
// 'kr': '화살표를 사용하여 제주국제공항 출발, 도착하는 항공 스케줄을 확인하세요.',
// 'en': 'Use the arrows to check flight schedules arriving and leaving from Jeju International Airport.',
// 'ch': '请用箭头查看济州国际机场出发、到达航班的时刻表。',
// 'tw': '請用箭頭查看濟州國際機場出發、到達航班的時刻表。',
// 'jp': '矢印を使って済州国際空港出発便、到着便の航空スケジュールをご確認ください。'
// },
// //EPG
// 'epg_none': {
// 'kr': "프로그램 정보가 없습니다",
// 'en': "No program information",
// 'ch': "没有节目信息",
// 'tw': "沒有節目信息",
// 'jp': "プログラム情報はありません"
// },
};
var g_uiVar_Clock = {
time: '',
date: ''
};
var g_uiVar_NotifyBallon = null;
/// 초기화 루틴
@@ -67,6 +29,58 @@ HotelTV.ui_utils = (function() {
//// 비공개 매써드
/**
* HotelTV UI Wrapper Function::> Countdown timer for Error screen
* @param {boolean} enable enable/disable
*/
const __uiFxn_TmrCDnErrScreen = function(end_of_date, _cbFxn1, _cbFxn2) {
var _vDate = new Date(end_of_date); // 전달 받은 일자
var timer;
function ____rn_cb() {
var now = new Date();
var distDt = _vDate - now;
if (distDt < 0) {
clearInterval(timer);
if (_cbFxn2) {
_cbFxn2();
}
return;
}
if (_cbFxn1) {
_cbFxn1();
}
}
timer = setInterval(____rn_cb, 1000);
}
/**
* HotelTV UI Wrapper Function::> Countdown timer for Error notification ballon
* @param {boolean} enable enable/disable
*/
const __uiFxn_TmrCDnNotiBallon = function(end_of_date, _cbClose) {
var _vDate = new Date(end_of_date); // 전달 받은 일자
function ____rn_cb() {
var now = new Date();
var distDt = _vDate - now;
if (distDt < 0) {
clearInterval(g_uiVar_NotifyBallon);
if (_cbClose) {
_cbClose();
}
g_uiVar_NotifyBallon = null;
return;
}
}
g_uiVar_NotifyBallon = setInterval(____rn_cb, 1000);
}
/**
* HotelTV UI Wrapper Function::> Show(Build) Busy(loading) animation
* @param {boolean} enable enable/disable
@@ -103,10 +117,21 @@ HotelTV.ui_utils = (function() {
__uifxn_BusyAnimation(show);
},
ShowErrMsg: function(_show, _title, _msg) {
ShowErrMsg: function(_show, _type, _title, _msg, _cdn_obj) {
if (_show) {
$('.error').css("background-color", "rgb(255,0,0)");
const typ_info = ['system.info.change-configuration'];
if (typ_info.indexOf(_type) >= 0) {
$('.error #details #message').addClass("info");
}
$('.error').css("background-image", "url('./images/hoteltv_service_error.png')");
$('.error #details #title').text(_title);
$('.error #details #message').text(_msg);
$('.error').fadeIn(500);
if (_cdn_obj) {
var dt = new Date();
dt.setSeconds(dt.getSeconds() + Number(_cdn_obj.timeout));
__uiFxn_TmrCDnErrScreen(dt, _cdn_obj.cb_disp, _cdn_obj.cb_eoe);
}
} else {
$('.error').fadeOut(500, function() {
$(this).css("background-image", "None");
@@ -122,18 +147,6 @@ HotelTV.ui_utils = (function() {
return g_uiVar_Clock;
},
Get_String: function(_key, _lang) {
return g_uiTbl_String[_key][_lang];
},
Brochure_GetBtn: function(_lang) {
return g_uiTbl_imgPath_Brochure_buttons[_lang];
},
IRD_GetBtn: function(_lang) {
return g_uiTbl_imgPath_InRoomDining_buttons[_lang];
},
Get_Airline: function(_obj, _airline, _lang) {
if (_obj) {
if (_obj[_airline]) {
@@ -183,5 +196,21 @@ HotelTV.ui_utils = (function() {
}
return _cvt_speed.toString() + " " + _szDir;
},
ShowNotificationMsgBalloon: function(_msg, _tmoutInSec) {
if (g_uiVar_NotifyBallon) {
clearInterval(g_uiVar_NotifyBallon);
}
var dt = new Date();
dt.setSeconds(dt.getSeconds() + Number(_tmoutInSec));
if (_msg) {
$('.popup>.notification .balloon #message').text(_msg);
__uiFxn_TmrCDnNotiBallon(dt, function() {
$('.popup>.notification').fadeOut(300);
});
$('.popup>.notification').fadeIn(300);
}
},
}
})();