issue #1
Fix TV ui 1. FIX TV UI 2. ADD Centirm Remote Key code 3. Enabled EPG getting api
This commit is contained in:
@@ -1398,10 +1398,10 @@ HotelTV.ui_appfull = (function() {
|
||||
}
|
||||
|
||||
/**
|
||||
* HotelTV UI[AppFull] Wrapper Function::> Get EPG Info by EPG id
|
||||
* @param {dictionary} _evt event information
|
||||
* HotelTV UI[AppFull] Wrapper Function::> Get EPG Info by channel name
|
||||
* @param {string} _ch_name channel name
|
||||
*/
|
||||
function __uifxn_AppFull_GetEpgInfoById(_id) {
|
||||
function __uifxn_AppFull_GetEpgInfoById(_ch_name) {
|
||||
let _epgInfo = HotelTV.epg;
|
||||
let _tm_cur = new Date();
|
||||
|
||||
@@ -1415,8 +1415,8 @@ HotelTV.ui_appfull = (function() {
|
||||
|
||||
//Find out epg schedule id
|
||||
let _epg_schId = null;
|
||||
for (let _j in _epgInfo.channels) {
|
||||
if (_epgInfo.channels[_j].name == _id) {
|
||||
for (let _j = 0; _j < _epgInfo.channels.length; _j++) {
|
||||
if (_epgInfo.channels[_j].name == _ch_name) {
|
||||
_epg_schId = _epgInfo.channels[_j].id;
|
||||
}
|
||||
}
|
||||
@@ -1435,7 +1435,7 @@ HotelTV.ui_appfull = (function() {
|
||||
let _schTm = new Date();
|
||||
|
||||
if (_epg_prom_info[_j].time.length != 5) {
|
||||
console.log("Flight Schedule org time is NULL");
|
||||
console.log("EPT Schedule org time is NULL");
|
||||
} else {
|
||||
_schTm.setHours(Number(_epg_prom_info[_j].time.charAt(0) + _epg_prom_info[_j].time.charAt(1)));
|
||||
_schTm.setMinutes(Number(_epg_prom_info[_j].time.charAt(3) + _epg_prom_info[_j].time.charAt(4)));
|
||||
@@ -1450,7 +1450,7 @@ HotelTV.ui_appfull = (function() {
|
||||
return _rtn_epg;
|
||||
}
|
||||
_rtn_epg = _epg_prom_info[_j];
|
||||
//console.log("CHNAME::>" + _id + " TDiff::> " + _tdiff_cur);
|
||||
//console.log("CHNAME::>" + _ch_name + " TDiff::> " + _tdiff_cur);
|
||||
}
|
||||
return _rtn_epg;
|
||||
}
|
||||
@@ -1972,10 +1972,13 @@ HotelTV.ui_appfull = (function() {
|
||||
*/
|
||||
function __uifxn_AppFull_TVRequestChannel() {
|
||||
const _state = HotelTV.state;
|
||||
const tv_mmIdx = _state.menu.main.cur;
|
||||
const tv_ctgIdx = _state.menu.main[tv_mmIdx].cur;
|
||||
const tv_chIdx = _state.menu.main[tv_mmIdx][tv_ctgIdx].cur;
|
||||
const ch_info = HotelTV.profile[tv_mmIdx].channel[tv_ctgIdx][tv_chIdx];
|
||||
const _trTbl = HotelTV.translation;
|
||||
const _mmIdx_tv = _state.menu.main.cur;
|
||||
const _tvCtgIdx = _state.menu.main[_mmIdx_tv].cur;
|
||||
const _tvChIdx = _state.menu.main[_mmIdx_tv][_tvCtgIdx].cur;
|
||||
const _program = HotelTV.tvguide.program;
|
||||
const _tvProg = _program[_mmIdx_tv].categories;
|
||||
const _tvChInfo = _tvProg[_tvCtgIdx].channels[_tvChIdx];
|
||||
let _need_to_changeTVChannel = false;
|
||||
let _tm_diff_ms = 0;
|
||||
|
||||
@@ -1994,16 +1997,18 @@ HotelTV.ui_appfull = (function() {
|
||||
}
|
||||
|
||||
if (_need_to_changeTVChannel == true) {
|
||||
console.log(`CHANGE::TVCTG[${HotelTV.profile[tv_mmIdx].channel[tv_ctgIdx].channel_category[_state.lang]}]` +
|
||||
` CUR CH IDX::>${tv_chIdx} EPGID: ${ch_info.epg_id} URL::>${ch_info.url} TMDIFF::>${_tm_diff_ms}`);
|
||||
console.log(`CHANGE::TVCTG[${_tvProg[_tvCtgIdx].name}]` +
|
||||
` CUR CH IDX::>${_tvChIdx} EPGID: ${_tvChInfo.epg_id} URL::>${_tvChInfo.url} TMDIFF::>${_tm_diff_ms}`);
|
||||
|
||||
|
||||
let _uri_stream = ch_info.url.split('://@')[1];
|
||||
let _typ_proto = ch_info.url.split('://@')[0];
|
||||
let _uri_ip = _uri_stream.split(':')[0];
|
||||
let _uri_port = _uri_stream.split(':')[1];
|
||||
|
||||
//TODO: 아래 실제 채널 셋업 부분 주석처리 되어 있는데, IP와 RF모두 처리 할 수 있도록 구현할것
|
||||
//let _uri_stream = _tvChInfo.url.split('://@')[1];
|
||||
//let _typ_proto = _tvChInfo.url.split('://@')[0];
|
||||
//let _uri_ip = _uri_stream.split(':')[0];
|
||||
//let _uri_port = _uri_stream.split(':')[1];
|
||||
//console.log(`ip = ${_uri_ip} port=${_uri_port} protocol=${_typ_proto}`);
|
||||
HotelTV.hcap.ChannelSetup("ip", { "ip": _uri_ip, "port": Number(_uri_port), "ptype": _typ_proto });
|
||||
//HotelTV.hcap.ChannelSetup("ip", { "ip": _uri_ip, "port": Number(_uri_port), "ptype": _typ_proto });
|
||||
|
||||
|
||||
// {
|
||||
@@ -2014,8 +2019,8 @@ HotelTV.ui_appfull = (function() {
|
||||
// HotelTV.hcap.ChannelSetup("rf_analog_ntsc", { "major": _major, "minor": 0 });
|
||||
// }
|
||||
} else {
|
||||
console.log(`SKIPPED::TVCTG[${HotelTV.profile[tv_mmIdx].channel[tv_ctgIdx].channel_category[_state.lang]}]` +
|
||||
` CUR CH IDX::>${tv_chIdx} EPGID: ${ch_info.epg_id} URL::>${ch_info.url} TMDIFF::>${_tm_diff_ms}`);
|
||||
console.log(`SKIPPED::TVCTG[${_tvProg[_tvCtgIdx].name}]` +
|
||||
` CUR CH IDX::>${_tvChIdx} EPGID: ${_tvChInfo.epg_id} URL::>${_tvChInfo.url} TMDIFF::>${_tm_diff_ms}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2025,11 +2030,10 @@ HotelTV.ui_appfull = (function() {
|
||||
*/
|
||||
function __uifxn_AppFull_TVUpdateChList(_action) {
|
||||
const _state = HotelTV.state;
|
||||
const tv_mmIdx = _state.menu.main.cur;
|
||||
const tv_ctgIdx = _state.menu.main[tv_mmIdx].cur;
|
||||
const tv_chIdx = _state.menu.main[tv_mmIdx][tv_ctgIdx].cur; //프로파일 상의 채널 인덱스(문자열)
|
||||
let tv_chElIdx = Number(tv_chIdx) - 1; //엘리멘트 인덱스(0베이스)
|
||||
const ch_info = HotelTV.profile[tv_mmIdx].channel[tv_ctgIdx][tv_chIdx];
|
||||
const _mmIdx_tv = _state.menu.main.cur;
|
||||
const _tvCtgIdx = _state.menu.main[_mmIdx_tv].cur;
|
||||
const _tvChIdx = _state.menu.main[_mmIdx_tv][_tvCtgIdx].cur; //프로파일 상의 채널 인덱스(문자열)
|
||||
let tv_chElIdx = Number(_tvChIdx) - 1; //엘리멘트 인덱스(0베이스)
|
||||
|
||||
//CENTER로 마킹된 엘리멘트 가져오기
|
||||
let _hndlOwlCtrEl = $('.main .tv .bg .owl-carousel .owl-stage-outer .owl-item.center');
|
||||
@@ -2050,7 +2054,7 @@ HotelTV.ui_appfull = (function() {
|
||||
console.log("1st time ....");
|
||||
}
|
||||
} else if (_action == "ch_up") {
|
||||
if ((tv_chElIdx >= 2) && (tv_chElIdx < (Number(_state.menu.main[tv_mmIdx][tv_ctgIdx].cnt) - 3))) {
|
||||
if ((tv_chElIdx >= 2) && (tv_chElIdx < (Number(_state.menu.main[_mmIdx_tv][_tvCtgIdx].cnt) - 3))) {
|
||||
_el_target.stop().animate({ scrollTop: ((tv_chElIdx - 2) * 120).toString() }, 500, function() {
|
||||
__uifxn_AppFull_TVRequestChannel();
|
||||
});
|
||||
@@ -2063,7 +2067,7 @@ HotelTV.ui_appfull = (function() {
|
||||
$($(item).children()[tv_chElIdx]).addClass("focused");
|
||||
});
|
||||
} else if (_action == "ch_down") {
|
||||
if ((tv_chElIdx > 2) && (tv_chElIdx < (Number(_state.menu.main[tv_mmIdx][tv_ctgIdx].cnt) - 2))) {
|
||||
if ((tv_chElIdx > 2) && (tv_chElIdx < (Number(_state.menu.main[_mmIdx_tv][_tvCtgIdx].cnt) - 2))) {
|
||||
_el_target.stop().animate({ scrollTop: ((tv_chElIdx - 2) * 120).toString() }, 500, function() {
|
||||
__uifxn_AppFull_TVRequestChannel();
|
||||
});
|
||||
@@ -2608,55 +2612,57 @@ HotelTV.ui_appfull = (function() {
|
||||
function __uifxn_AppFull_BldPage_SubTV() {
|
||||
let _state = HotelTV.state;
|
||||
let _mmIdx = _state.menu.main.cur;
|
||||
let _tvCtgInfo = HotelTV.profile[_mmIdx].channel;
|
||||
let _tvCtgcnt = 0;
|
||||
let _trTbl = HotelTV.translation;
|
||||
let _program = HotelTV.tvguide.program;
|
||||
let _tvProg = _program[_mmIdx].categories;
|
||||
|
||||
_tvCtgcnt = Object.keys(_tvCtgInfo).length;
|
||||
if (!(_mmIdx in _state.menu.main)) {
|
||||
_state.menu.main[_mmIdx] = {
|
||||
'cnt': 0,
|
||||
'cur': null,
|
||||
'prev': null,
|
||||
'cur': null, //현재 TV카테고리
|
||||
'prev': null, //마지막 TV카테고리
|
||||
};
|
||||
_state.menu.main[_mmIdx].cnt = _tvCtgcnt;
|
||||
// TV Program category 개수
|
||||
_state.menu.main[_mmIdx].cnt = _tvProg.length;
|
||||
}
|
||||
|
||||
// 초기 메인 메뉴 KEY설정
|
||||
_state.menu.stage = "preparing_tv";
|
||||
if (_state.menu.main[_mmIdx].cur == null) {
|
||||
_state.menu.main[_mmIdx].cur = Object.keys(_tvCtgInfo)[0];
|
||||
_state.menu.main[_mmIdx].cur = Object.keys(_tvProg)[0];
|
||||
|
||||
for (let _tvCtg_item in _tvCtgInfo) {
|
||||
_state.menu.main[_mmIdx][_tvCtg_item] = {
|
||||
// 각 채널 카테고리별 채널 개수 및 이전 시청 채널 과 현재 시청 채널 정보 초기화
|
||||
//for (let _tvCtg_item in _tvProg) {
|
||||
for (let _i = 1; _i <= _tvProg.length; _i++) {
|
||||
_state.menu.main[_mmIdx][_i] = {
|
||||
'cnt': 0,
|
||||
'cur': null,
|
||||
'prev': null,
|
||||
};
|
||||
_state.menu.main[_mmIdx][_tvCtg_item].cnt = Object.keys(_tvCtgInfo[_tvCtg_item]).length - 1;
|
||||
_state.menu.main[_mmIdx][_tvCtg_item].cur = Object.keys(_tvCtgInfo[_tvCtg_item])[0];
|
||||
_state.menu.main[_mmIdx][_i].cnt = _tvProg[_i].channels.length;
|
||||
_state.menu.main[_mmIdx][_i].cur = Object.keys(_tvProg[_i].channels)[0];
|
||||
}
|
||||
}
|
||||
|
||||
// TV 메뉴 카테고리 노드를 동적으로 구성
|
||||
let _div_tvCgh_bglist = document.querySelector('#lst_tvCtgbg');
|
||||
for (let _tvCtg_item in _tvCtgInfo) {
|
||||
//for (let _tvCtg_item in _tvProg) {
|
||||
for (let _tvCtg_idx = 1; _tvCtg_idx <= _tvProg.length; _tvCtg_idx++) {
|
||||
let _tvCtgInfo = _tvProg[_tvCtg_idx];
|
||||
let _div_tvCtg_frame = document.createElement('div');
|
||||
let _sz_styleOpt = null;
|
||||
|
||||
// TV 메뉴 카테고리 노드를 동적으로 구성
|
||||
_div_tvCtg_frame.className = 'item';
|
||||
_div_tvCtg_frame.id = 'tvctgfrm_' + _tvCtgInfo[_tvCtg_item].channel_category['en'].replace(/\s/g, '').toLowerCase();
|
||||
_div_tvCtg_frame.setAttribute("tvctgid", _tvCtg_item);
|
||||
|
||||
|
||||
|
||||
_div_tvCtg_frame.id = 'tvctgfrm_' + _tvCtgInfo.name.replace(/\s/g, '').toLowerCase();
|
||||
_div_tvCtg_frame.setAttribute("tvctgidx", _tvCtg_idx);
|
||||
|
||||
// TV 카테고리 타이틀
|
||||
let _div_tvCtg_title = document.createElement('div');
|
||||
_div_tvCtg_title.setAttribute("id", "tvctg_title");
|
||||
_div_tvCtg_title.textContent = _tvCtgInfo[_tvCtg_item].channel_category[_state.lang];
|
||||
_div_tvCtg_title.textContent = _trTbl.ui.tv.title.category[_tvCtgInfo.name][_state.lang];
|
||||
_div_tvCtg_frame.appendChild(_div_tvCtg_title);
|
||||
|
||||
|
||||
// ADD Upper Arrow
|
||||
let _div_tvCtg_arUp = document.createElement('div');
|
||||
_div_tvCtg_arUp.setAttribute("id", "tvctg_arrow_up");
|
||||
@@ -2666,48 +2672,45 @@ HotelTV.ui_appfull = (function() {
|
||||
let _div_tv_chlist = document.createElement('div');
|
||||
_div_tv_chlist.setAttribute("class", "tvctg_chlist");
|
||||
|
||||
for (let _tvCh_idx = 1; _tvCh_idx <= _tvCtgInfo.channels.length; _tvCh_idx++) {
|
||||
let _tvChInfo = _tvCtgInfo.channels[_tvCh_idx];
|
||||
let _div_tv_chframe = document.createElement('div');
|
||||
_div_tv_chframe.setAttribute("class", "tvch_item_frame");
|
||||
_div_tv_chframe.setAttribute("idx", _tvCh_idx);
|
||||
|
||||
|
||||
for (let _tvCh_item in _tvCtgInfo[_tvCtg_item]) {
|
||||
if (_tvCh_item != 'channel_category') {
|
||||
let _div_tv_chframe = document.createElement('div');
|
||||
_div_tv_chframe.setAttribute("class", "tvch_item_frame");
|
||||
_div_tv_chframe.setAttribute("idx", _tvCh_item);
|
||||
let _div_tv_chepg = document.createElement('div');
|
||||
_div_tv_chepg.setAttribute("class", "tvch_epg");
|
||||
|
||||
let _span_tv_chtitle = document.createElement('span');
|
||||
_span_tv_chtitle.setAttribute("id", "tvch_epg_title");
|
||||
_span_tv_chtitle.textContent = _tvChInfo.title[_state.lang];
|
||||
_span_tv_chtitle.setAttribute("ch_num", "CH:" + _tvChInfo.number + "]");
|
||||
_div_tv_chepg.appendChild(_span_tv_chtitle);
|
||||
|
||||
let _div_tv_chepg = document.createElement('div');
|
||||
_div_tv_chepg.setAttribute("class", "tvch_epg");
|
||||
|
||||
let _span_tv_chtitle = document.createElement('span');
|
||||
_span_tv_chtitle.setAttribute("id", "tvch_epg_title");
|
||||
_span_tv_chtitle.textContent = _tvCtgInfo[_tvCtg_item][_tvCh_item].title[_state.lang];
|
||||
_span_tv_chtitle.setAttribute("ch_num", "CH:" + _tvCtgInfo[_tvCtg_item][_tvCh_item].delivery_no + "]");
|
||||
_div_tv_chepg.appendChild(_span_tv_chtitle);
|
||||
|
||||
let _span_tv_chepginfo = document.createElement('span');
|
||||
_span_tv_chepginfo.setAttribute("id", "tvch_epg_info");
|
||||
_span_tv_chepginfo.setAttribute("epg_id", _tvCtgInfo[_tvCtg_item][_tvCh_item].epg_id);
|
||||
let _egp_prog_inf = __uifxn_AppFull_GetEpgInfoById(_tvCtgInfo[_tvCtg_item][_tvCh_item].epg_id);
|
||||
if (_egp_prog_inf != null) {
|
||||
_span_tv_chepginfo.textContent = _egp_prog_inf.name;
|
||||
}
|
||||
_div_tv_chepg.appendChild(_span_tv_chepginfo);
|
||||
|
||||
|
||||
_div_tv_chframe.appendChild(_div_tv_chepg);
|
||||
|
||||
|
||||
|
||||
let _div_tv_chlogo = document.createElement('div');
|
||||
_div_tv_chlogo.setAttribute("id", "tvch_logo");
|
||||
_sz_styleOpt = "background-image: url(" + _tvCtgInfo[_tvCtg_item][_tvCh_item].logo.full_path + "); ";
|
||||
_sz_styleOpt += "background-repeat: no-repeat; background-position: center center; background-size: 100%; ";
|
||||
_div_tv_chlogo.setAttribute("style", _sz_styleOpt);
|
||||
_div_tv_chframe.appendChild(_div_tv_chlogo);
|
||||
|
||||
|
||||
_div_tv_chlist.appendChild(_div_tv_chframe);
|
||||
let _span_tv_chepginfo = document.createElement('span');
|
||||
_span_tv_chepginfo.setAttribute("id", "tvch_epg_info");
|
||||
_span_tv_chepginfo.setAttribute("epg_id", _tvChInfo.epg);
|
||||
let _egp_prog_inf = __uifxn_AppFull_GetEpgInfoById(_tvChInfo.epg);
|
||||
if (_egp_prog_inf != null) {
|
||||
_span_tv_chepginfo.textContent = _egp_prog_inf.name;
|
||||
}
|
||||
_div_tv_chepg.appendChild(_span_tv_chepginfo);
|
||||
|
||||
|
||||
_div_tv_chframe.appendChild(_div_tv_chepg);
|
||||
|
||||
|
||||
|
||||
let _div_tv_chlogo = document.createElement('div');
|
||||
_div_tv_chlogo.setAttribute("id", "tvch_logo");
|
||||
_sz_styleOpt = "background-image: url(" + _tvChInfo.logo.file.download + "); ";
|
||||
_sz_styleOpt += "background-repeat: no-repeat; background-position: center center; background-size: 100%; ";
|
||||
_div_tv_chlogo.setAttribute("style", _sz_styleOpt);
|
||||
_div_tv_chframe.appendChild(_div_tv_chlogo);
|
||||
|
||||
|
||||
_div_tv_chlist.appendChild(_div_tv_chframe);
|
||||
}
|
||||
_div_tvCtg_frame.appendChild(_div_tv_chlist);
|
||||
|
||||
@@ -2772,7 +2775,7 @@ HotelTV.ui_appfull = (function() {
|
||||
if ((_curChIdx - 1) >= 1) {
|
||||
_curChIdx -= 1;
|
||||
_state.menu.main[_mmIdx][_curChCtg].cur = _curChIdx.toString();
|
||||
console.log(`TVCTG[${HotelTV.profile[_mmIdx].channel[_curChCtg].channel_category[_state.lang]}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
console.log(`TVCTG[${_tvProg[_curChCtg].name}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
|
||||
__uifxn_AppFull_TVUpdateChList("ch_up");
|
||||
}
|
||||
@@ -2784,7 +2787,7 @@ HotelTV.ui_appfull = (function() {
|
||||
if ((_curChIdx + 1) <= Number(_state.menu.main[_mmIdx][_curChCtg].cnt)) {
|
||||
_curChIdx += 1;
|
||||
_state.menu.main[_mmIdx][_curChCtg].cur = _curChIdx.toString();
|
||||
console.log(`TVCTG[${HotelTV.profile[_mmIdx].channel[_curChCtg].channel_category[_state.lang]}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
console.log(`TVCTG[${_tvProg[_curChCtg].name}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
|
||||
__uifxn_AppFull_TVUpdateChList("ch_down");
|
||||
}
|
||||
@@ -2833,7 +2836,7 @@ HotelTV.ui_appfull = (function() {
|
||||
if ((_curChIdx - 1) >= 1) {
|
||||
_curChIdx -= 1;
|
||||
_state.menu.main[_mmIdx][_curChCtg].cur = _curChIdx.toString();
|
||||
console.log(`TVCTG[${HotelTV.profile[_mmIdx].channel[_curChCtg].channel_category[_state.lang]}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
console.log(`TVCTG[${_tvProg[_curChCtg].name}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
|
||||
__uifxn_AppFull_TVUpdateChList("ch_up");
|
||||
}
|
||||
@@ -2845,7 +2848,7 @@ HotelTV.ui_appfull = (function() {
|
||||
if ((_curChIdx + 1) <= Number(_state.menu.main[_mmIdx][_curChCtg].cnt)) {
|
||||
_curChIdx += 1;
|
||||
_state.menu.main[_mmIdx][_curChCtg].cur = _curChIdx.toString();
|
||||
console.log(`TVCTG[${HotelTV.profile[_mmIdx].channel[_curChCtg].channel_category[_state.lang]}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
console.log(`TVCTG[${_tvProg[_curChCtg].name}] CUR CH::>${_state.menu.main[_mmIdx][_curChCtg].cur}`);
|
||||
|
||||
__uifxn_AppFull_TVUpdateChList("ch_down");
|
||||
}
|
||||
@@ -2911,7 +2914,7 @@ HotelTV.ui_appfull = (function() {
|
||||
if (_acvatedEl) {
|
||||
_curChListEl = _acvatedEl.find(".tvctg_chlist");
|
||||
if (_curChListEl) {
|
||||
_curChCtg = _acvatedEl.attr('tvctgid');
|
||||
_curChCtg = _acvatedEl.attr('tvctgidx');
|
||||
_bHasValidData = true;
|
||||
}
|
||||
}
|
||||
@@ -3431,6 +3434,17 @@ HotelTV.ui_appfull = (function() {
|
||||
_div_mm_item.appendChild(_mm_item_title);
|
||||
|
||||
_div_mm_slist.appendChild(_div_mm_item);
|
||||
|
||||
// Record Special key map info
|
||||
if (['flight', 'weather', 'tv'].includes(_program[_mm_idx].type)) {
|
||||
if (!('specialKey' in _state)) {
|
||||
_state['specialKey'] = {};
|
||||
}
|
||||
|
||||
if (!(_program[_mm_idx].type in _state['specialKey'])) {
|
||||
_state['specialKey'][_program[_mm_idx].type] = { "mm_index": _mm_idx };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 메인 메뉴 백그라운드 이미지 노드를 동적으로 구성
|
||||
@@ -3537,7 +3551,8 @@ HotelTV.ui_appfull = (function() {
|
||||
let _opening = HotelTV.opening;
|
||||
|
||||
if (_state.menu.stage == "main") {
|
||||
console.log("MM KEY EVENT::> " + _evt.keyCode);
|
||||
console.log(`MM KEY EVENT::> ${_evt.keyCode}, UINT=>${parseInt(_evt.keyCode)}`);
|
||||
//console.log("MM KEY EVENT::> " + _evt.keyCode);
|
||||
if (_evt.keyCode == 37) {
|
||||
$('#lst_mmsel').trigger('prev.owl', 700)
|
||||
} else if (_evt.keyCode == 39) {
|
||||
@@ -3678,6 +3693,46 @@ HotelTV.ui_appfull = (function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
} else if (_evt.keyCode == -2072433963) {
|
||||
// DEDICATED HOT KEY: Amenity
|
||||
// Check amenity menu enabled
|
||||
if (_opening.amenity) {
|
||||
$('.popup .amenity').show(0, function() {
|
||||
$('.popup .amenity').animate({ top: 96, left: 64 }, 500, () => {
|
||||
_state.menu.stage = "hotkey_mm_amenity";
|
||||
__uifxn_AppFull_ShowMMHotKeyBtn(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
} else if (_evt.keyCode == -2072437788) {
|
||||
// DEDICATED HOT KEY: Room service
|
||||
// Check room service menu enabled
|
||||
if (_opening.roomService) {
|
||||
$('.popup .roomservice').show(0, function() {
|
||||
$('.popup .roomservice').animate({ top: 96, left: 64 }, 500, () => {
|
||||
_state.menu.stage = "hotkey_mm_roomservice";
|
||||
__uifxn_AppFull_ShowMMHotKeyBtn(false);
|
||||
});
|
||||
});
|
||||
}
|
||||
} else if (_evt.keyCode == -2072437533) {
|
||||
// DEDICATED HOT KEY: Flight
|
||||
// Check flight main menu index and go
|
||||
if (('flight' in _state['specialKey'])) {
|
||||
$('#lst_mmsel').trigger("to.owl.carousel", [Number(_state['specialKey']['flight'].mm_index) - 1, 10, true]);
|
||||
}
|
||||
} else if (_evt.keyCode == -2072438298) {
|
||||
// DEDICATED HOT KEY: Weather
|
||||
// Check flight main menu index and go
|
||||
if (('weather' in _state['specialKey'])) {
|
||||
$('#lst_mmsel').trigger("to.owl.carousel", [Number(_state['specialKey']['weather'].mm_index) - 1, 10, true]);
|
||||
}
|
||||
} else if (_evt.keyCode == -2072443143) {
|
||||
// DEDICATED HOT KEY: TV
|
||||
// Check flight main menu index and go
|
||||
if (('tv' in _state['specialKey'])) {
|
||||
$('#lst_mmsel').trigger("to.owl.carousel", [Number(_state['specialKey']['tv'].mm_index) - 1, 10, true]);
|
||||
}
|
||||
}
|
||||
} else if (_state.menu.stage == "hotkey_mm_red") {
|
||||
console.log("HOTKEY(MM:RED) KEY EVENT::> " + _evt.keyCode);
|
||||
@@ -3992,42 +4047,44 @@ HotelTV.ui_appfull = (function() {
|
||||
let _state = HotelTV.state;
|
||||
|
||||
console.log("MQTT RECEVED MESSAGE::> " + _evt);
|
||||
if (_evt == "EVENT-MESSAGE-UPDATE" || _evt == "EVENT-MESSAGE-UPDATE") {
|
||||
if (_evt == "EVENT-MESSAGE-CREATE" || _evt == "EVENT-MESSAGE-UPDATE" || _evt == "EVENT-MESSAGE-DELETE") {
|
||||
//DO NEW GUEST MESSAGE&DO CHANGE GUEST MESSAGE
|
||||
HotelTV.api.GetMessage().then(_ret => {
|
||||
HotelTV.message = _ret;
|
||||
console.log("Get New Message contents");
|
||||
if (_state.menu.stage == "popup_message_card" || _state.menu.stage == "mypage") {
|
||||
let _el_tbls = $('div#lst_mypagebg div #mp_message_table #mp_msg_tblrec');
|
||||
let _msg = HotelTV.message;
|
||||
let _msg_unread_cnt = 0;
|
||||
//기존 메시지 테이블 레코드 삭제
|
||||
_el_tbls.children('tbody').remove();
|
||||
_el_tbls.each(function(_idx, _item) {
|
||||
let _sz_innerHTML = '<tbody>';
|
||||
let _num_msgIdx = 0;
|
||||
for (let _j = _msg.length; _j > 0; _j--) {
|
||||
_sz_innerHTML += '<tr msgnum=' + _j + ' msgidx=' + _num_msgIdx.toString() + ' >';
|
||||
if (_msg[_j].read == false) {
|
||||
_sz_innerHTML += '<td id="num">' + _j.toString() + '</td>';
|
||||
} else {
|
||||
_sz_innerHTML += '<td id="num" class="read">' + _j.toString() + '</td>';
|
||||
}
|
||||
|
||||
if (_msg[_j].multilanguage == false) {
|
||||
_sz_innerHTML += '<td id="title">' + _msg[_j].title.default+'</td>';
|
||||
} else {
|
||||
_sz_innerHTML += '<td id="title">' + _msg[_j].title[_state.lang] + '</td>';
|
||||
}
|
||||
_sz_innerHTML += '<td id="from">' + _msg[_j].from + '</td>';
|
||||
_sz_innerHTML += '<td id="date">' + _msg[_j].createdAt + '</td>';
|
||||
_sz_innerHTML += '</tr>';
|
||||
_num_msgIdx++;
|
||||
let _el_tbls = $('div#lst_mypagebg div #mp_message_table #mp_msg_tblrec');
|
||||
let _msg = HotelTV.message;
|
||||
let _msg_unread_cnt = 0;
|
||||
//기존 메시지 테이블 레코드 삭제
|
||||
_el_tbls.children('tbody').remove();
|
||||
_el_tbls.each(function(_idx, _item) {
|
||||
let _sz_innerHTML = '<tbody>';
|
||||
let _num_msgIdx = 0;
|
||||
for (let _j = _msg.length; _j > 0; _j--) {
|
||||
_sz_innerHTML += '<tr msgnum=' + _j + ' msgidx=' + _num_msgIdx.toString() + ' >';
|
||||
if (_msg[_j].read == false) {
|
||||
_sz_innerHTML += '<td id="num">' + _j.toString() + '</td>';
|
||||
} else {
|
||||
_sz_innerHTML += '<td id="num" class="read">' + _j.toString() + '</td>';
|
||||
}
|
||||
_sz_innerHTML += '</tbody>';
|
||||
$(_item).html(_sz_innerHTML);
|
||||
});
|
||||
|
||||
if (_msg[_j].multilanguage == false) {
|
||||
_sz_innerHTML += '<td id="title">' + _msg[_j].title.default+'</td>';
|
||||
} else {
|
||||
_sz_innerHTML += '<td id="title">' + _msg[_j].title[_state.lang] + '</td>';
|
||||
}
|
||||
_sz_innerHTML += '<td id="from">' + _msg[_j].from + '</td>';
|
||||
_sz_innerHTML += '<td id="date">' + _msg[_j].createdAt + '</td>';
|
||||
_sz_innerHTML += '</tr>';
|
||||
_num_msgIdx++;
|
||||
}
|
||||
_sz_innerHTML += '</tbody>';
|
||||
$(_item).html(_sz_innerHTML);
|
||||
});
|
||||
|
||||
// 사용자가 메시지 메뉴를 사용중인경우에 대한 처리
|
||||
if (_state.menu.stage == "popup_message_card" || _state.menu.stage == "mypage") {
|
||||
const _mmIdx = _state.menu.main.cur;
|
||||
// 메시지 상태 오브젝트 초기화
|
||||
if ("message" in _state.menu.main[_mmIdx]) {
|
||||
@@ -4039,22 +4096,20 @@ 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='" + _state.menu.main[_mmIdx]['message']['cur'] + "']").addClass('focus');
|
||||
|
||||
//메시지 개수 표시
|
||||
const _guest = HotelTV.guestinfo;
|
||||
let _trTbl = HotelTV.translation;
|
||||
for (let _j = _msg.length; _j > 0; _j--) {
|
||||
if (_msg[_j].read == false) {
|
||||
_msg_unread_cnt++;
|
||||
}
|
||||
}
|
||||
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msg_unread_cnt.toString()));
|
||||
}
|
||||
|
||||
//메시지 개수 표시
|
||||
const _guest = HotelTV.guestinfo;
|
||||
let _trTbl = HotelTV.translation;
|
||||
for (let _j = _msg.length; _j > 0; _j--) {
|
||||
if (_msg[_j].read == false) {
|
||||
_msg_unread_cnt++;
|
||||
}
|
||||
}
|
||||
$('div#lst_mypagebg div #mp_message_title').text(_guest.name + _trTbl.ui.mypage.message.title.title[_state.lang].replace("_XX", _msg_unread_cnt.toString()));
|
||||
}).catch(_error => {
|
||||
console.log("Fail to get Message info");
|
||||
});
|
||||
} else if (_evt == "EVENT-MESSAGE-DELETE") {
|
||||
|
||||
} else if (_evt == "EVENT-NEWS-UPDATE") {
|
||||
//DO NEW NEWS
|
||||
HotelTV.api.GetNews().then(_ret => {
|
||||
@@ -4079,93 +4134,6 @@ HotelTV.ui_appfull = (function() {
|
||||
} else if (_evt == "GUEST-ROOMCHANGE") {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if (_evt == "COMMAND-SET-EVENT-REBOOT") {
|
||||
// //DO REBOOT
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-CHECKIN") {
|
||||
// //DO CHECKIN
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-CHECKOUT") {
|
||||
// //DO CHECKOUT
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-NEW-EMERGENCY") {
|
||||
// //긴급 재난 상황 트리거
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-DEL-EMERGENCY") {
|
||||
// //긴급 재난 상황 해제
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-CHECKOUT") {
|
||||
// //DO CHECKOUT
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-NEWS") {
|
||||
// //DO NEW NEWS
|
||||
// HotelTV.api.GetNews().then(_ret => {
|
||||
// HotelTV.news = _ret;
|
||||
// console.log("Get New News contents");
|
||||
// __uifxn_AppFull_BldNews();
|
||||
// }).catch(_error => {
|
||||
// console.log("Fail to get news info");
|
||||
// });
|
||||
// } else if (_evt == "COMMAND-BDOOR-OPMODE-CHANGE") {
|
||||
// //DO CHANGE OPMODE
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-NETSPEED") {
|
||||
// //DO CHECK NET SPEED
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-SHOWID") {
|
||||
// //DO SHOW DEVICE ID&INFO
|
||||
// } else if (_evt == "COMMAND-SET-EVENT-NEW-MESSAGE" || _evt == "COMMAND-SET-EVENT-CHG-MESSAGE" || _evt == "COMMAND-SET-EVENT-DEL-MESSAGE") {
|
||||
// //DO NEW GUEST MESSAGE&DO CHANGE GUEST MESSAGE
|
||||
// HotelTV.api.GetMessage().then(_ret => {
|
||||
// HotelTV.message = _ret;
|
||||
// console.log("Get New Message contents");
|
||||
// if (_state.menu.stage == "popup_message_card" || _state.menu.stage == "mypage") {
|
||||
// let _el_tbls = $('div#lst_mypagebg div #mp_message_table #mp_msg_tblrec');
|
||||
// let _msg = HotelTV.message;
|
||||
// let _msg_unread_cnt = 0;
|
||||
// //기존 메시지 테이블 레코드 삭제
|
||||
// _el_tbls.children('tbody').remove();
|
||||
// _el_tbls.each(function(_idx, _item) {
|
||||
// let _sz_innerHTML = '<tbody>';
|
||||
// let _num_msgIdx = 0;
|
||||
// for (let _j = Object.keys(_msg).length - 1; _j >= 0; _j--) {
|
||||
// let _msgId = Object.keys(_msg)[_j];
|
||||
// _sz_innerHTML += '<tr msgnum=' + _msgId + ' msgidx=' + _num_msgIdx.toString() + ' >';
|
||||
// if (_msg[_msgId].unread == '1') {
|
||||
// _sz_innerHTML += '<td id="num">' + _msgId.toString() + '</td>';
|
||||
// } else {
|
||||
// _sz_innerHTML += '<td id="num" class="read">' + _msgId.toString() + '</td>';
|
||||
// }
|
||||
// _sz_innerHTML += '<td id="title">' + _msg[_msgId].name + '</td>';
|
||||
// _sz_innerHTML += '<td id="from">' + _msg[_msgId].writer + '</td>';
|
||||
// _sz_innerHTML += '<td id="date">' + _msg[_msgId].create_at + '</td>';
|
||||
// _sz_innerHTML += '</tr>';
|
||||
// _num_msgIdx++;
|
||||
// }
|
||||
// _sz_innerHTML += '</tbody>';
|
||||
// $(_item).html(_sz_innerHTML);
|
||||
// });
|
||||
|
||||
// const _mmIdx = _state.menu.main.cur;
|
||||
// let __curMsgDspIdx = 0;
|
||||
// // 메시지 포커싱
|
||||
// if ('message' in Object.keys(_state.menu.main[_mmIdx])) {
|
||||
// _state.menu.main[_mmIdx]['message'] = {
|
||||
// "cnt": Object.keys(_msg).length,
|
||||
// "cur": __curMsgDspIdx,
|
||||
// "prev": null,
|
||||
// };
|
||||
// }
|
||||
// $('.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');
|
||||
|
||||
// //메시지 개수 표시
|
||||
// const _guest = HotelTV.guestinfo;
|
||||
// for (let _j in _msg) {
|
||||
// if (_msg[_j].unread == "1") {
|
||||
// _msg_unread_cnt++;
|
||||
// }
|
||||
// }
|
||||
// $('div#lst_mypagebg div #mp_message_title').text(_guest.name + HotelTV.ui_utils.Get_String('message_title', _state.lang).replace("_XX", _msg_unread_cnt.toString()));
|
||||
// }
|
||||
// }).catch(_error => {
|
||||
// console.log("Fail to get Message info");
|
||||
// });
|
||||
// }
|
||||
},
|
||||
|
||||
UpdateEpg: function() {
|
||||
|
||||
Reference in New Issue
Block a user