issue #10 HDMI입력시 화면 전환 기능 추가. Welcome에서 MQTT메시지 처리 로직 추가.

This commit is contained in:
Paul Kim
2023-02-27 22:02:12 +09:00
parent 1e0bafafde
commit 29efea9b97
9 changed files with 583 additions and 283 deletions

View File

@@ -76,7 +76,7 @@ HotelTV.ui_appfull = (function() {
console.log("media_event_received = " + _evt.eventType);
let _stateMedia = _evt.eventType;
if (_state.menu.stage == "ctzgen") {
if (_state.menu.stage.cur == "ctzgen") {
switch (_stateMedia) {
case 'play_start':
_state.media.playing = true;
@@ -155,9 +155,6 @@ HotelTV.ui_appfull = (function() {
// HotelTV.hcap.SetSoftAp({
// "enable": false,
// });
// 현재 재생중인 TV채널 종료
console.log("Try to channel shutdown..");
HotelTV.hcap.ChannelShutDown();
}else if (_typeAppFocusEvt == "unfocused") {
}
@@ -169,14 +166,51 @@ HotelTV.ui_appfull = (function() {
*/
function __uifxn_AppFull_OnHdmiConChangeEvt(_evt) {
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
// {Number} param.index - index of the HDMI which was connected or disconnected.
// {Boolean} param.connected - true if the HDMI is connected, else false.
console.log(
console.warn(
"Event 'hdmi_connection_changed' is received.\n" +
"HDMI-" + param.index + " : " + "connected = " + param.connected
"HDMI-" + _evt.index + " : " + "connected = " + _evt.connected
);
if ( _evt.connected==true ){
_state.menu.stage.prev = _state.menu.stage.cur;
_state.menu.stage.cur = "external_av_hdmi";
setTimeout(function(){
$('body,html').fadeOut(500, function(){
HotelTV.hcap.SetExternalInput("HDMI", Number(_evt.index)-1);
});
}, 1000);
HotelTV.ui_utils.ShowNotificationMsgBalloon(_trTbl.system.notice.event.external_input.hdmi_connected[_state.lang], 5);
}else{
$('body,html').fadeIn(500);
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
}
}
/**
* HotelTV UI Wrapper Function::> received event handling function
* @param {dictionary} _evt event information
*/
function __uifxn_AppFull_OnTvChChgChangeEvt(_evt) {
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.\n" +
"Result = " + _evt.result + "\n" +
"Error message = " + _evt.errorMessage
);
}
/**
* HotelTV UI[AppFull] Wrapper Function::> show/hide special hotkey(red/yellow/green/blue/etc...) btn
* @param {boolean} e event
@@ -2382,12 +2416,12 @@ HotelTV.ui_appfull = (function() {
el_width = (el_width + 100) * -1;
if ($('.main .tv .bg .owl-carousel .owl-stage-outer').position().left == el_width) {
$('.main .tv .bg .owl-carousel .owl-stage-outer').stop().animate({ left: '0px' }, 800, function() {
_state.menu.stage = "tvCtgShow";
_state.menu.stage.cur = "tvCtgShow";
});
}
} else {
if ($('.main .tv .bg .owl-carousel .owl-stage-outer').position().left == 0) {
_state.menu.stage = "tvCtgHide";
_state.menu.stage.cur = "tvCtgHide";
let el_width = $('.main .tv .bg .owl-carousel .owl-stage-outer .owl-stage .item').width();
el_width = (el_width + 100) * -1;
$('.main .tv .bg .owl-carousel .owl-stage-outer').stop().animate({ left: el_width.toString() + 'px' }, 800);
@@ -2477,7 +2511,7 @@ HotelTV.ui_appfull = (function() {
}
// 초기 메인 메뉴 KEY설정
_state.menu.stage = "preparing_mypage";
_state.menu.stage.cur = "preparing_mypage";
if (_state.menu.main[_mmIdx].cur == null) {
_state.menu.main[_mmIdx].cur = Object.keys(_mpinfo)[0];
}
@@ -2711,7 +2745,7 @@ HotelTV.ui_appfull = (function() {
$('#lst_mypagesel').trigger('translate.owl.carousel', [0]);
$(document.activeElement).keydown(function(event) { //attach event listener
if (_state.menu.stage == "mypage") {
if (_state.menu.stage.cur == "mypage") {
if (event.keyCode == gRmtKey.left) {
$('#lst_mypagesel').trigger('prev.owl')
$('#lst_mypagebg').trigger('prev.owl')
@@ -2772,7 +2806,7 @@ HotelTV.ui_appfull = (function() {
//SHOW ANIMATION
if ($('.popup>.mypage>.message').css('display') == "none") {
_state.menu.stage = "popup_message_card";
_state.menu.stage.cur = "popup_message_card";
$('.main>.mypage>.slider').animate({ top: 1080, left: 0 }, 1000, function() {
$('.popup>.mypage>.message').fadeIn(500);
@@ -2801,7 +2835,7 @@ HotelTV.ui_appfull = (function() {
$('.main .mypage').hide();
_hndl_mpSel = null;
_hndl_mpBg = null;
_state.menu.stage = "main"
_state.menu.stage.cur = "main"
setTimeout(function() {
__uifxn_AppFull_ShowMMHotKeyBtn(true);
}, 500);
@@ -2809,11 +2843,11 @@ HotelTV.ui_appfull = (function() {
} else {
console.log("MYPAGE KEYEVT: Skip events::>" + event.keyCode);
}
} else if (_state.menu.stage == "popup_message_card") {
} else if (_state.menu.stage.cur == "popup_message_card") {
if (event.keyCode == gRmtKey.back) {
if ($('.popup>.mypage>.message').css('display') != "none") {
$('.popup>.mypage>.message').fadeOut(500, function() {
_state.menu.stage = "mypage";
_state.menu.stage.cur = "mypage";
$('.main>.mypage>.slider').animate({ top: 864, left: 0 }, 1000)
});
}
@@ -2821,10 +2855,10 @@ HotelTV.ui_appfull = (function() {
console.log("POPUP MESSAGE CARD KEYEVT: Skip events::>" + event.keyCode);
}
} else {
console.log("INVALID MYPAGE SUBMENU STAGE::>" + _state.menu.stage);
console.log("INVALID MYPAGE SUBMENU STAGE::>" + _state.menu.stage.cur);
}
});
_state.menu.stage = "mypage";
_state.menu.stage.cur = "mypage";
});
$('#lst_mypagesel').on('translate.owl.carousel', function(event) {
@@ -2996,7 +3030,7 @@ HotelTV.ui_appfull = (function() {
_el_target.each(function(index, item) {
$($(item).children()[tv_chElIdx]).addClass("focused");
});
_state.menu.stage = "tvCtgShow";
_state.menu.stage.cur = "tvCtgShow";
console.log("1st time ....");
}
} else if (_action == "ch_up") {
@@ -3079,7 +3113,7 @@ HotelTV.ui_appfull = (function() {
}
// UI State Flag 설정
_state.menu.stage = "preparing_ctz_general";
_state.menu.stage.cur = "preparing_ctz_general";
if (_state.menu.main[_mmIdx][_smIdx].cur == null) {
_state.menu.main[_mmIdx][_smIdx].cur = Object.keys(_ctzinfo)[0];
}
@@ -3145,6 +3179,24 @@ HotelTV.ui_appfull = (function() {
_div_ctz_item.appendChild(_div_ctz_frame);
// 나중에 구현하기로 하고 조선프로젝트에서 우선 스킵
// // 컨텐트 IMAGE VIEWER DIV 삽입
// let _div_ctz_imgvwr = document.createElement('div');
// _div_ctz_imgvwr.setAttribute("class", "ctz_imgvwr_frame");
// _div_ctz_item.appendChild(_div_ctz_imgvwr);
// // 이미지 뷰어를 사용하는 경우 경우, PLAY안내 버튼 노출
// if (_ctzinfo[_ctzidx].images.enable == true && _ctzinfo[_ctzidx].images.files[_state.lang]) {
// let _div_ctz_vwrctrl = document.createElement('div');
// _div_ctz_vwrctrl.setAttribute("class", "ctz_mv_ctrl");
// // _div_ctz_vwrctrl.setAttribute("video_url", _ctzinfo[_ctzidx].video.files[_state.lang].download);
// _sz_styleOpt = '--playmsg: "' + _trTbl.ui.player.watch_imgshow[_state.lang] + '";';
// _sz_styleOpt += '--stopmsg: "' + _trTbl.ui.player.stop_imgshow[_state.lang] + '";';
// _div_ctz_vwrctrl.setAttribute("style", _sz_styleOpt);
// _div_ctz_item.appendChild(_div_ctz_vwrctrl);
// }
// 동영상이 있는 경우, PLAY안내 버튼 노출
if (_ctzinfo[_ctzidx].video.enable == true && _ctzinfo[_ctzidx].video.files[_state.lang]) {
let _div_ctz_mvctrl = document.createElement('div');
@@ -3181,7 +3233,7 @@ HotelTV.ui_appfull = (function() {
$('.main .sub').fadeOut(600);
//$('#lst_ctzgenbg').trigger('translate.owl.carousel', [0]);
$('#lst_ctzgenbg').trigger('translate.owl.carousel', [0, 500, true]);
_state.menu.stage = "ctzgen";
_state.menu.stage.cur = "ctzgen";
});
});
});
@@ -3290,7 +3342,7 @@ HotelTV.ui_appfull = (function() {
}
// 초기 메인 메뉴 KEY설정
_state.menu.stage = "preparing_sub";
_state.menu.stage.cur = "preparing_sub";
if (_state.menu.main[_mmIdx].cur == null) {
_state.menu.main[_mmIdx].cur = Object.keys(_sminfo)[0];
}
@@ -3426,7 +3478,7 @@ HotelTV.ui_appfull = (function() {
$('#lst_smsel').trigger('translate.owl.carousel', [0, 500, true]);
$(document.activeElement).keydown(function(event) { //attach event listener
if (_state.menu.stage == "sub") {
if (_state.menu.stage.cur == "sub") {
if (event.keyCode == gRmtKey.left) {
$('#lst_smsel').trigger('prev.owl', 700);
} else if (event.keyCode == gRmtKey.right) {
@@ -3478,13 +3530,13 @@ HotelTV.ui_appfull = (function() {
$('.main .sub').hide();
_hndl_smSel = null;
_hndl_smBg = null;
_state.menu.stage = "main"
_state.menu.stage.cur = "main"
setTimeout(function() {
__uifxn_AppFull_ShowMMHotKeyBtn(true);
}, 500);
});
}
} else if (_state.menu.stage == "ctzgen") {
} else if (_state.menu.stage.cur == "ctzgen") {
if (event.keyCode == gRmtKey.left) {
$('#lst_ctzgenbg').trigger('prev.owl', 700);
} else if (event.keyCode == gRmtKey.right) {
@@ -3503,7 +3555,7 @@ HotelTV.ui_appfull = (function() {
$('#lst_ctzgenbg').owlCarousel('destroy');
$('.main .ctzgen .bg #lst_ctzgenbg div').remove();
_hndl_ctzGenBg = null;
_state.menu.stage = "sub";
_state.menu.stage.cur = "sub";
$('#lst_smsel').trigger('translate.owl.carousel', [0]);
});
} else if (event.keyCode == gRmtKey.start) {
@@ -3544,7 +3596,7 @@ HotelTV.ui_appfull = (function() {
console.log("SUBMENU KEYEVT: Skip events");
}
});
_state.menu.stage = "sub";
_state.menu.stage.cur = "sub";
});
});
@@ -3606,7 +3658,7 @@ HotelTV.ui_appfull = (function() {
}
// 초기 메인 메뉴 KEY설정
_state.menu.stage = "preparing_tv";
_state.menu.stage.cur = "preparing_tv";
if (_state.menu.main[_mmIdx].cur == null) {
_state.menu.main[_mmIdx].cur = Object.keys(_tvProg)[0];
@@ -3741,7 +3793,7 @@ HotelTV.ui_appfull = (function() {
$('#lst_tvCtgbg').trigger('translated.owl.carousel', [0]);
$(document.activeElement).keydown(function(event) { //attach event listener
if (_state.menu.stage == "tvCtgShow") {
if (_state.menu.stage.cur == "tvCtgShow") {
if (event.keyCode == gRmtKey.left) {
$('#lst_tvCtgbg').trigger('prev.owl', [1000])
} else if (event.keyCode == gRmtKey.right) {
@@ -3799,7 +3851,7 @@ HotelTV.ui_appfull = (function() {
$('.main .tv .bg #lst_tvCtgbg div').remove();
_hndl_tvCtg = null;
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
setTimeout(function() {
__uifxn_AppFull_ShowMMHotKeyBtn(true);
@@ -3807,7 +3859,7 @@ HotelTV.ui_appfull = (function() {
}, 500);
});
}
} else if (_state.menu.stage == "tvCtgHide") {
} else if (_state.menu.stage.cur == "tvCtgHide") {
if (event.keyCode == 427) {
// 채널 리스트 아이탬 이동(UP)
let _mmIdx = _state.menu.main.cur;
@@ -3858,7 +3910,7 @@ HotelTV.ui_appfull = (function() {
$('.main .tv .bg #lst_tvCtgbg div').remove();
_hndl_tvCtg = null;
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
setTimeout(function() {
__uifxn_AppFull_ShowMMHotKeyBtn(true);
@@ -3869,7 +3921,7 @@ HotelTV.ui_appfull = (function() {
console.log("event.keyCode::>" + event.keyCode);
}
} else {
console.log("TVMENU KEYEVT: Skip events::> Invalid menu stage:" + _state.menu.stage);
console.log("TVMENU KEYEVT: Skip events::> Invalid menu stage:" + _state.menu.stage.cur);
}
});
});
@@ -3933,7 +3985,7 @@ HotelTV.ui_appfull = (function() {
//console.log(`KeyDn Event Recoreded::> ${_lastTm.keyevt} TMDiff::> ${_tm_diff_ms}`);
//
if (_state.menu.stage == "popup_message_card") {
if (_state.menu.stage.cur == "popup_message_card") {
//HIDE NEWS and USER GUIDE TIPS
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
@@ -3945,7 +3997,7 @@ HotelTV.ui_appfull = (function() {
$('.guide>.tips').fadeOut(500);
}
return;
} else if (_state.menu.stage == "tvCtgHide") {
} else if (_state.menu.stage.cur == "tvCtgHide") {
//HIDE NEWS and USER GUIDE TIPS
if (_newsInfo == null || _newsInfo.length == 0) {
if ($('.news').css('display') != "none") {
@@ -3964,8 +4016,8 @@ HotelTV.ui_appfull = (function() {
//SHOW USER GUIDE TIPS
let show_stages = ["hotkey_mm_red", "hotkey_mm_green", "hotkey_mm_yellow", "hotkey_mm_blue", "main", "sub", "ctzgen", "tvCtgShow", "mypage"];
let sz_msg = null;
if (show_stages.includes(_state.menu.stage) == true) {
switch (_state.menu.stage) {
if (show_stages.includes(_state.menu.stage.cur) == true) {
switch (_state.menu.stage.cur) {
case "hotkey_mm_red":
sz_msg = _trTbl.ui.guide.navi_brochure[_state.lang];
if ($('.guide>.tips').text() != sz_msg) {
@@ -4161,7 +4213,7 @@ HotelTV.ui_appfull = (function() {
}
} else {
$('.main .mm .flight').each(function (index, docObjFlight) {
console.log(index);
//console.log(index);
if ( $(docObjFlight).css("display")!="none" ){
if ( $(docObjFlight).find('#record').length>0 ){
$(docObjFlight).find('#record').scrollTop(0);
@@ -4451,137 +4503,6 @@ HotelTV.ui_appfull = (function() {
$(`.main .mm #flight_${_program[_mm_idx].location} #caution`).text(_trTbl.ui.flight.caution.body[_state.lang]);
}
}
// let _elWeatherToday = _elWeatherRoot.children('.today');
// let _elWeatherForcast = _elWeatherRoot.children('.forcast');
// let _elWeatherCation = _elWeatherRoot.children('#caution');
// $('.main .mm .flight .departure #title').text(_trTbl.ui.flight.title.departure[_state.lang]);
// $('.main .mm .flight .arrival #title').text(_trTbl.ui.flight.title.arrival[_state.lang]);
// let _tblHdr = $('.main .mm .flight table th')
// for (let _i = 0; _i < _tblHdr.length; ++_i) {
// if (_tblHdr[_i].id == "airline") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.airline[_state.lang];
// } else if (_tblHdr[_i].id == "flight") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.flight_no[_state.lang];
// } else if (_tblHdr[_i].id == "scheduled") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.scheduled[_state.lang];
// } else if (_tblHdr[_i].id == "origin") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.origin[_state.lang];
// } else if (_tblHdr[_i].id == "destination") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.destination[_state.lang];
// } else if (_tblHdr[_i].id == "type") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.classification[_state.lang];
// } else if (_tblHdr[_i].id == "gate") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.title.boarding_gate[_state.lang];
// } else if (_tblHdr[_i].id == "status") {
// _tblHdr[_i].innerText = _trTbl.ui.flight.status[_state.lang];
// }
// }
// //Delete all table record for departure & arrival
// let _el_departure_tbl_rec = document.querySelector('.main .mm .flight .departure table #record');
// let _el_arrival_tbl_rec = document.querySelector('.main .mm .flight .arrival table #record');
// //Delete all table record for departure & arrival
// $('.main .mm .flight .departure table tr#record').remove();
// $('.main .mm .flight .arrival table tr#record').remove();
// for (let _i = 0; _i < _flight.count; _i++) {
// let _schOrg = new Date();
// let _schEdt = new Date();
// let _flitem = _flight.items[_i];
// //let _sTmOrg = _flitem.std.length != 4 ? null : ;
// //let _sTmChanged = _flitem.etd;
// if (_flitem.std.length != 4) {
// console.log("Flight Schedule org time is NULL");
// } else {
// _schOrg.setHours(Number(_flitem.std.charAt(0) + _flitem.std.charAt(1)));
// _schOrg.setMinutes(Number(_flitem.std.charAt(2) + _flitem.std.charAt(3)));
// }
// if (_flitem.std.length != 4) {
// console.log("Flight Schedule edited time is NULL");
// } else {
// _schEdt.setHours(Number(_flitem.std.charAt(0) + _flitem.std.charAt(1)));
// _schEdt.setMinutes(Number(_flitem.std.charAt(2) + _flitem.std.charAt(3)));
// }
// let diffMs = (_schOrg - _curDaTm); // milliseconds between now & Christmas
// // let diffDays = Math.floor(diffMs / 86400000); // days
// // let diffHrs = Math.floor((diffMs % 86400000) / 3600000); // hours
// // let diffMins = Math.round(((diffMs % 86400000) % 3600000) / 60000); // minutes
// // console.log(diffDays + " days, " + diffHrs + " hours, " + diffMins + " minutes");
// let diffMins = Math.round(diffMs / 60000);
// //console.log("TDiff::> " + diffMins);
// if ((-60 < diffMins) && (diffMins < 120)) {
// if (_flitem.io == "O") {
// let _el_tr = document.createElement('tr');
// _el_tr.setAttribute("id", "record");
// ar_tdItem.forEach(_itm => {
// let _el_td = document.createElement('td');
// _el_td.setAttribute("id", _itm);
// if (_itm == "airline") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airline(_trTbl.ui.flight.airlines, _flitem.airline, _state.lang);
// } else if (_itm == "flight") {
// _el_td.innerText = _flitem.airFln;
// } else if (_itm == "scheduled") {
// _el_td.innerText = _flitem.std.charAt(0) + _flitem.std.charAt(1) + ":" + _flitem.std.charAt(2) + _flitem.std.charAt(3) + " - ";
// _el_td.innerText += _flitem.etd.charAt(0) + _flitem.etd.charAt(1) + ":" + _flitem.etd.charAt(2) + _flitem.etd.charAt(3);
// } else if (_itm == "origin") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.boarding, _state.lang);
// } else if (_itm == "destination") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.arrived, _state.lang);
// } else if (_itm == "type") {
// _el_td.innerText = _trTbl.ui.flight.line[_flitem.line][_state.lang];
// } else if (_itm == "gate") {
// _el_td.innerText = _flitem.gate;
// } else if (_itm == "status") {
// _el_td.innerText = HotelTV.ui_utils.Get_FlightStatus(_trTbl.ui.flight.result, _flitem.rmk, _state.lang);
// }
// _el_tr.appendChild(_el_td);
// });
// _el_departure_tbl_rec.appendChild(_el_tr);
// } else {
// let _el_tr = document.createElement('tr');
// _el_tr.setAttribute("id", "record");
// ar_tdItem.forEach(_itm => {
// let _el_td = document.createElement('td');
// _el_td.setAttribute("id", _itm);
// if (_itm == "airline") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airline(_trTbl.ui.flight.airlines, _flitem.airline, _state.lang);
// } else if (_itm == "flight") {
// _el_td.innerText = _flitem.airFln;
// } else if (_itm == "scheduled") {
// _el_td.innerText = _flitem.std.charAt(0) + _flitem.std.charAt(1) + ":" + _flitem.std.charAt(2) + _flitem.std.charAt(3) + " - ";
// _el_td.innerText += _flitem.etd.charAt(0) + _flitem.etd.charAt(1) + ":" + _flitem.etd.charAt(2) + _flitem.etd.charAt(3);
// } else if (_itm == "origin") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.boarding, _state.lang);
// } else if (_itm == "destination") {
// _el_td.innerText = HotelTV.ui_utils.Get_Airport(_trTbl.ui.flight.city, _flitem.arrived, _state.lang);
// } else if (_itm == "type") {
// if (_trTbl.ui.flight.line[_flitem.line]) {
// _el_td.innerText = _trTbl.ui.flight.line[_flitem.line][_state.lang];
// }
// } else if (_itm == "gate") {
// _el_td.innerText = _flitem.gate;
// } else if (_itm == "status") {
// _el_td.innerText = HotelTV.ui_utils.Get_FlightStatus(_trTbl.ui.flight.result, _flitem.rmk, _state.lang);
// }
// _el_tr.appendChild(_el_td);
// });
// _el_arrival_tbl_rec.appendChild(_el_tr);
// }
// }
// }
// $('.main .mm .flight #caution').text(_trTbl.ui.flight.caution.body[_state.lang]);
}
/**
@@ -4660,7 +4581,7 @@ HotelTV.ui_appfull = (function() {
_mm_width = 266;
// 초기 메인 메뉴 KEY설정
_state.menu.stage = "preparing_main";
_state.menu.stage.cur = "preparing_main";
if (_state.menu.main.cur == null) {
_state.menu.main.cur = Object.keys(_program)[0];
}
@@ -4817,16 +4738,23 @@ HotelTV.ui_appfull = (function() {
$('#lst_mmsel').trigger('translate.owl.carousel', [0, 500, true]);
HotelTV.ui_utils.SetBusy(false);
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
});
$(document).on('keydown', function(_evt) { //attach event listener
let _opening = HotelTV.opening;
let _trTbl = HotelTV.translation;
if (_state.menu.stage == "main") {
if (_state.menu.stage.cur == "main") {
console.log(`MM KEY EVENT::> ${_evt.keyCode}, UINT=>${parseInt(_evt.keyCode)}`);
// 현재 재생중인 TV채널 종료
if ( _state.tv.playing == true ){
console.warn("Try to channel shutdown..");
HotelTV.hcap.ChannelShutDown();
_state.tv.playing = false;
}
if (_evt.keyCode == gRmtKey.left) {
$('#lst_mmsel').trigger('prev.owl', 700)
//console.log(" MM ID::> " + _state.menu.main.cur + _program[_state.menu.main.cur].name);
@@ -4887,14 +4815,14 @@ HotelTV.ui_appfull = (function() {
$('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() {
if (_state.hotkey.mm.red.type == "brochure") {
$('.popup .hotkey_mm_red').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_red";
_state.menu.stage.cur = "hotkey_mm_red";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.red.type == "amenity") {
$('.popup .amenity').show(0, function() {
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_amenity";
_state.menu.stage.cur = "hotkey_mm_amenity";
__uifxn_AppFull_DrawAmenityItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4902,7 +4830,7 @@ HotelTV.ui_appfull = (function() {
} else if (_state.hotkey.mm.red.type == "roomservice") {
$('.popup .roomservice').show(0, function() {
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_roomservice";
_state.menu.stage.cur = "hotkey_mm_roomservice";
__uifxn_AppFull_DrawRoomserviceItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4917,14 +4845,14 @@ HotelTV.ui_appfull = (function() {
$('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() {
if (_state.hotkey.mm.green.type == "brochure") {
$('.popup .hotkey_mm_green').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_green";
_state.menu.stage.cur = "hotkey_mm_green";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.green.type == "amenity") {
$('.popup .amenity').show(0, function() {
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_amenity";
_state.menu.stage.cur = "hotkey_mm_amenity";
__uifxn_AppFull_DrawAmenityItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4932,7 +4860,7 @@ HotelTV.ui_appfull = (function() {
} else if (_state.hotkey.mm.green.type == "roomservice") {
$('.popup .roomservice').show(0, function() {
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_roomservice";
_state.menu.stage.cur = "hotkey_mm_roomservice";
__uifxn_AppFull_DrawRoomserviceItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4947,14 +4875,14 @@ HotelTV.ui_appfull = (function() {
$('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() {
if (_state.hotkey.mm.yellow.type == "brochure") {
$('.popup .hotkey_mm_yellow').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_yellow";
_state.menu.stage.cur = "hotkey_mm_yellow";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.yellow.type == "amenity") {
$('.popup .amenity').show(0, function() {
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_amenity";
_state.menu.stage.cur = "hotkey_mm_amenity";
__uifxn_AppFull_DrawAmenityItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4962,7 +4890,7 @@ HotelTV.ui_appfull = (function() {
} else if (_state.hotkey.mm.yellow.type == "roomservice") {
$('.popup .roomservice').show(0, function() {
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_roomservice";
_state.menu.stage.cur = "hotkey_mm_roomservice";
__uifxn_AppFull_DrawRoomserviceItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4977,14 +4905,14 @@ HotelTV.ui_appfull = (function() {
$('.guide>.tips').stop().animate({ backgroundColor: "rgba(0,0,0,0.8)" }, 500, function() {
if (_state.hotkey.mm.blue.type == "brochure") {
$('.popup .hotkey_mm_blue').fadeIn(1000, function() {
_state.menu.stage = "hotkey_mm_blue";
_state.menu.stage.cur = "hotkey_mm_blue";
__uifxn_AppFull_ShowMMHotKeyBtn(false);
__uifxn_AppFull_TopWidjetShow(false);
});
} else if (_state.hotkey.mm.blue.type == "amenity") {
$('.popup .amenity').show(0, function() {
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_amenity";
_state.menu.stage.cur = "hotkey_mm_amenity";
__uifxn_AppFull_DrawAmenityItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -4992,7 +4920,7 @@ HotelTV.ui_appfull = (function() {
} else if (_state.hotkey.mm.blue.type == "roomservice") {
$('.popup .roomservice').show(0, function() {
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_roomservice";
_state.menu.stage.cur = "hotkey_mm_roomservice";
__uifxn_AppFull_DrawRoomserviceItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -5007,7 +4935,7 @@ HotelTV.ui_appfull = (function() {
if (_opening.amenity) {
$('.popup .amenity').show(0, function() {
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_amenity";
_state.menu.stage.cur = "hotkey_mm_amenity";
__uifxn_AppFull_DrawAmenityItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -5020,7 +4948,7 @@ HotelTV.ui_appfull = (function() {
if (_opening.roomService) {
$('.popup .roomservice').show(0, function() {
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
_state.menu.stage = "hotkey_mm_roomservice";
_state.menu.stage.cur = "hotkey_mm_roomservice";
__uifxn_AppFull_DrawRoomserviceItem(true);
__uifxn_AppFull_ShowMMHotKeyBtn(false);
});
@@ -5049,7 +4977,7 @@ HotelTV.ui_appfull = (function() {
HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':_state['specialKey']['tv'].id}}])
}
}
} else if (_state.menu.stage == "hotkey_mm_red") {
} else if (_state.menu.stage.cur == "hotkey_mm_red") {
console.log("HOTKEY(MM:RED) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
$('#lst_hotkey_mm_red').trigger('prev.owl')
@@ -5059,13 +4987,13 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_red').fadeOut(1000, function() {
$('.popup .hotkey_mm_red').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() {
$('.popup .hotkey_mm_red').css({ "background-color": "" });
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
} else if (_state.menu.stage == "hotkey_mm_green") {
} else if (_state.menu.stage.cur == "hotkey_mm_green") {
console.log("HOTKEY(MM:GREEN) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
$('#lst_hotkey_mm_green').trigger('prev.owl')
@@ -5075,13 +5003,13 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_green').fadeOut(1000, function() {
$('.popup .hotkey_mm_green').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() {
$('.popup .hotkey_mm_green').css({ "background-color": "" });
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
} else if (_state.menu.stage == "hotkey_mm_yellow") {
} else if (_state.menu.stage.cur == "hotkey_mm_yellow") {
console.log("HOTKEY(MM:YELLOW) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
console.log("LEFT");
@@ -5095,13 +5023,13 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_yellow').fadeOut(1000, function() {
$('.popup .hotkey_mm_yellow').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() {
$('.popup .hotkey_mm_yellow').css({ "background-color": "" });
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
} else if (_state.menu.stage == "hotkey_mm_blue") {
} else if (_state.menu.stage.cur == "hotkey_mm_blue") {
console.log("HOTKEY(MM:BLUE) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
console.log("LEFT");
@@ -5115,13 +5043,13 @@ HotelTV.ui_appfull = (function() {
$('.popup .hotkey_mm_blue').fadeOut(1000, function() {
$('.popup .hotkey_mm_blue').stop().animate({ backgroundColor: "rgba(0,0,0,0.0)" }, 500, function() {
$('.popup .hotkey_mm_blue').css({ "background-color": "" });
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
__uifxn_AppFull_TopWidjetShow(true);
});
});
}
} else if (_state.menu.stage == "hotkey_mm_amenity") {
} else if (_state.menu.stage.cur == "hotkey_mm_amenity") {
console.log("HOTKEY(MM:AMENITY: MENU) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
console.log("AMENITY::>LEFT");
@@ -5138,16 +5066,16 @@ HotelTV.ui_appfull = (function() {
} else if (_evt.keyCode == gRmtKey.enter) {
console.log("AMENITY::>ENTER");
__uifxn_AppFull_HandleAmenity("enter", false, false, function() {
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
});
} else if (_evt.keyCode == gRmtKey.back) {
__uifxn_AppFull_HandleAmenity("back", true, false, function() {
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
});
}
} else if (_state.menu.stage == "hotkey_mm_roomservice") {
} else if (_state.menu.stage.cur == "hotkey_mm_roomservice") {
console.log("HOTKEY(MM:ROOMSERVICE: MENU) KEY EVENT::> " + _evt.keyCode);
if (_evt.keyCode == gRmtKey.left) {
console.log("ROOMSERVICE::>LEFT");
@@ -5164,12 +5092,12 @@ HotelTV.ui_appfull = (function() {
} else if (_evt.keyCode == gRmtKey.enter) {
console.log("ROOMSERVICE::>ENTER");
__uifxn_AppFull_HandleRoomservice("enter", false, false, function() {
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
});
} else if (_evt.keyCode == gRmtKey.back) {
__uifxn_AppFull_HandleRoomservice("back", true, false, function() {
_state.menu.stage = "main";
_state.menu.stage.cur = "main";
__uifxn_AppFull_ShowMMHotKeyBtn(true);
});
}
@@ -5222,6 +5150,8 @@ HotelTV.ui_appfull = (function() {
document.addEventListener("hcap_application_focus_changed", __uifxn_AppFull_OnAppFocusEvt, false);
//ADD Event for the result of HDMI connection change
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);
},
Show: function() {
@@ -5233,6 +5163,44 @@ HotelTV.ui_appfull = (function() {
__uifxn_AppFull_BldPage_Main();
},
BGServiceEvent: function(_evt) {
let _state = HotelTV.state;
let _program = HotelTV.tvguide.program;
if ( _evt == "update_flight" ){
_state.schedule.flight_reflash = true;
}else if ( _evt == "update_weather" ){
_state.schedule.weather_reflash = true;
}
// Update flight schedule table if user doesn't watch flight schedule screen
if ( _state.schedule.flight_reflash == true) {
//if (_program[Number(_state.menu.main.cur)].type.toLowerCase() != "flight")
{
_state.schedule.flight_reflash = false;
console.warn("Updated flight scheudle UI table.");
//Flight Contents Buildup
__uifxn_AppFull_MM_BldFlight();
}
}
// Update weather schedule table if user doesn't watch weather screen
if ( _state.schedule.weather_reflash == true) {
if (_program[Number(_state.menu.main.cur)].type.toLowerCase() != "weather"){
_state.schedule.weather_reflash = false;
console.log("Updated Weather UI table.");
//Weather Contents Buildup
if ( Object.keys(_state.weather.default_location).length != 0 ){
//상단 날씨 아이콘 및 온도 표시
__uifxn_AppFull_TopWidjet_BuildWeather();
__uifxn_AppFull_MM_BldWeather();
}
}
}
},
MqttEvent: function(_evt) {
let _state = HotelTV.state;
@@ -5274,7 +5242,7 @@ HotelTV.ui_appfull = (function() {
});
// 사용자가 메시지 메뉴를 사용중인경우에 대한 처리
if (_state.menu.stage == "popup_message_card" || _state.menu.stage == "mypage") {
if (_state.menu.stage.cur == "popup_message_card" || _state.menu.stage.cur == "mypage") {
const _mmIdx = _state.menu.main.cur;
// 메시지 상태 오브젝트 초기화
if ("message" in _state.menu.main[_mmIdx]) {
@@ -5320,15 +5288,78 @@ HotelTV.ui_appfull = (function() {
} else if (_evt == "EVENT-EMERGENCY-STOT") {
} else if (_evt == "COMMAND-SYSTEM-RESTART") {
let _tmval = 10;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
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 shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "GUEST-CHECKIN") {
} else if (_evt == "GUEST-CHECKOUT") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.checkout[_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 shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
} else if (_evt == "GUEST-UPDATE") {
} else if (_evt == "GUEST-ROOMCHANGE") {
let _tmval = 30;
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
HotelTV.ui_utils.ShowSysNoticeMsg(true,
"notice",
"SYSTEM NOTICE",
_trTbl.system.notice.event.mqtt.room_change[_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 shutdown in ${_tmval} second...`);
},
"cb_eoe": function() {
setTimeout(HotelTV.hcap.PwrOff(), 500);
HotelTV.api.ReportEvent([{'power': false, 'location':null}])
}
});
}
},
@@ -5336,7 +5367,7 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
let _trTbl = HotelTV.translation;
if (_state.menu.stage != 'tvCtgHide') {
if (_state.menu.stage.cur != 'tvCtgHide') {
return;
}