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

@@ -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);
}
},
}
})();