issue #11 going on developing new amenity&room service ui: 1st done(amenity menu selection)

This commit is contained in:
Paul Kim
2024-03-13 20:02:16 +09:00
parent 97afa01319
commit 08ad96e59b
9 changed files with 406 additions and 4915 deletions

View File

@@ -92,14 +92,14 @@ HotelTV.ui_appfull = (function() {
* @param {object} ___curDayTime
* @returns true or false
*/
const ___fxn_checkWeekValid = function(___schedule_week_obj, ___curDayTime) {
const __ifxn_checkWeekValid = function(___schedule_week_obj, ___curDayTime) {
if ( ___schedule_week_obj.week[Object.keys(___schedule_week_obj.week)[___curDayTime.getDay()]]==true ){
return true;
}
return false;
}
const ___fxn_checkDatekValid = function(___schedule_day_obj, ___curDayTime) {
const __ifxn_checkDatekValid = function(___schedule_day_obj, ___curDayTime) {
if ( ___schedule_day_obj.date.mode=="always" ){
return true;
}else if ( ___schedule_day_obj.date.mode=="start" ){
@@ -125,7 +125,7 @@ HotelTV.ui_appfull = (function() {
return false;
}
const ___fxn_checkTimekValid = function(___schedule_day_obj, ___curDayTime) {
const __ifxn_checkTimekValid = function(___schedule_day_obj, ___curDayTime) {
let __day = ___curDayTime.getDate();
let __month = ___curDayTime.getMonth() + 1;
let __year = ___curDayTime.getFullYear();
@@ -148,9 +148,9 @@ HotelTV.ui_appfull = (function() {
}
try{
if ( ___fxn_checkWeekValid(_schedule,_curDtime) == true ) {
if ( ___fxn_checkDatekValid(_schedule,_curDtime) == true ){
if ( ___fxn_checkTimekValid(_schedule,_curDtime) == true ){
if ( __ifxn_checkWeekValid(_schedule,_curDtime) == true ) {
if ( __ifxn_checkDatekValid(_schedule,_curDtime) == true ){
if ( __ifxn_checkTimekValid(_schedule,_curDtime) == true ){
_result.result = true;
return _result;
}
@@ -518,9 +518,10 @@ HotelTV.ui_appfull = (function() {
"focus": "category_sel",
"category_sel": {
'cnt': 0,
'cur': null,
'prev': null,
}
'cur': 1,
'prev': 1,
},
"items": {},
}
};
}
@@ -573,12 +574,206 @@ HotelTV.ui_appfull = (function() {
}
}
/**
* HotelTV UI[AppFull] Wrapper Function::> Draw amenity item selection ui
*/
function __uifxn_AppFull_DrawAmItemSeletion(_action) {
let _state = HotelTV.state;
let __status_am_specific = null;
let _trTbl = HotelTV.translation;
let _opening = HotelTV.opening;
let _order = HotelTV.orders.amenity;
let _aminfo_top = _opening.amenity;
let _aminfo_ctgy = _aminfo_top.menu;
// let _elMainRoot = $('.main');
// let _elMainMenu = _elMainRoot.children('.mm');
let _elAmPupRoot = $('.popup .amenity');
let _elAmCtgyBg = _elAmPupRoot.children('.bg').find('#lst_ctgbg');
let _elAmCtgyBgFocus = _elAmCtgyBg.find('.owl-item.active.center');
let _elAmCtgyBgMenuItemWin = _elAmCtgyBgFocus.find('.am_item_sel_win')
const __ifxn_updateAmItemDesc = function(_item_idx) {
let _sz_styleOpt = null;
let __item_info = _aminfo_ctgy[__status_am_specific.category_sel.cur].items[_item_idx+1];
// Remove All element under winright div
let _elDivWinRight = _elAmCtgyBgMenuItemWin.find('.winright');
if ( _elDivWinRight.css('display') != "none") {
_elDivWinRight.fadeOut(200, function() {
if ( _elDivWinRight.children().length ){
_elDivWinRight.children().remove();
}
//상품 상세 설명페이지 구성
////썸네일
let _elDiv_ItmesThumb = document.createElement('div');
_elDiv_ItmesThumb.className = "amItemDescThumb";
//let thuri = __item_info.thumbnail.files[_state.lang].download;
_sz_styleOpt = "background-image: url(" + __item_info.thumbnail.files[_state.lang].download + "); ";
_sz_styleOpt += "background-repeat: no-repeat; background-position: center center; background-size: 100% 100%; ";
_elDiv_ItmesThumb.setAttribute("style", _sz_styleOpt);
////상세설명
let _elDiv_ItmesDetails = document.createElement('div');
_elDiv_ItmesDetails.className = "amItemDescDetails";
var _elDiv_ItmesTitle = document.createElement('div');
_elDiv_ItmesTitle.setAttribute("id", "title");
_elDiv_ItmesTitle.textContent = __item_info.title[_state.lang];
var _elDiv_ItmesDescription = document.createElement('div');
_elDiv_ItmesDescription.setAttribute("id", "description");
_elDiv_ItmesDescription.textContent = __item_info.description[_state.lang];
//_elDiv_ItmesDescription.textContent = __item_info.description[_state.lang].replace(/(?:\r\n|\r|\n)/g, '<br>');
_elDiv_ItmesDetails.appendChild(_elDiv_ItmesTitle);
_elDiv_ItmesDetails.appendChild(_elDiv_ItmesDescription);
//winright에 썸네일과 상세설명 추가
_elDivWinRight.append(_elDiv_ItmesThumb);
_elDivWinRight.append(_elDiv_ItmesDetails);
_elDivWinRight.fadeIn(500, function() {
});
});
}else{
if ( _elDivWinRight.children().length ){
_elDivWinRight.children().remove();
}
//상품 상세 설명페이지 구성
////썸네일
let _elDiv_ItmesThumb = document.createElement('div');
_elDiv_ItmesThumb.className = "amItemDescThumb";
//let thuri = __item_info.thumbnail.files[_state.lang].download;
_sz_styleOpt = "background-image: url(" + __item_info.thumbnail.files[_state.lang].download + "); ";
_sz_styleOpt += "background-repeat: no-repeat; background-position: center center; background-size: 100% 100%; ";
_elDiv_ItmesThumb.setAttribute("style", _sz_styleOpt);
////상세설명
let _elDiv_ItmesDetails = document.createElement('div');
_elDiv_ItmesDetails.className = "amItemDescDetails";
var _elDiv_ItmesTitle = document.createElement('div');
_elDiv_ItmesTitle.setAttribute("id", "title");
_elDiv_ItmesTitle.textContent = __item_info.title[_state.lang];
var _elDiv_ItmesDescription = document.createElement('div');
_elDiv_ItmesDescription.setAttribute("id", "description");
_elDiv_ItmesDescription.textContent = __item_info.description[_state.lang];
//_elDiv_ItmesDescription.textContent = __item_info.description[_state.lang].replace(/(?:\r\n|\r|\n)/g, '<br>');
_elDiv_ItmesDetails.appendChild(_elDiv_ItmesTitle);
_elDiv_ItmesDetails.appendChild(_elDiv_ItmesDescription);
//winright에 썸네일과 상세설명 추가
_elDivWinRight.append(_elDiv_ItmesThumb);
_elDivWinRight.append(_elDiv_ItmesDetails);
_elDivWinRight.fadeIn(500, function() {
});
}
}
const __ifxn_removeAmItemDesc = function(_item_idx) {
// Remove All element under winright div
let _elDivWinRight = _elAmCtgyBgMenuItemWin.find('.winright');
if ( _elDivWinRight.children().length ){
_elDivWinRight.children().remove();
}
if ( _elDivWinRight.css('display') != "none") {
_elDivWinRight.fadeOut(300, function() {
});
}
}
try{
// 어메니티 정보 오브젝트
_aminfo_top = _opening.amenity;
_aminfo_ctgy = _aminfo_top.menu;
__status_am_specific = _state.hotkey.mm[_aminfo_top.button].status;
let __amctgyIdx = __status_am_specific.category_sel.cur;
let __amctgyItemStatus = __status_am_specific.items[_aminfo_ctgy[__amctgyIdx].name];
switch ( _action )
{
case "enter": {
_elAmCtgyBgMenuItemWin.find('.amctgyItem').first().addClass("focus");
__ifxn_updateAmItemDesc(__amctgyItemStatus.idx);
} break;
case "exit": {
_elAmCtgyBgMenuItemWin.find('.amctgyItem').removeClass("focus");
__ifxn_removeAmItemDesc();
} break;
case "up": {
let _elTbl_AmItem = _elAmCtgyBgMenuItemWin.find('.tbl_record');
let _elTblTr_AmItemNext = _elTbl_AmItem.find('.focus').parent().prev('tr');
if (_elTblTr_AmItemNext.length) {
_elTbl_AmItem.find('.focus').removeClass("focus");
_elTblTr_AmItemNext.children('.amctgyItem').addClass('focus');
// 테이블 ROW인덱스와 스크롤 OFFSET계산
__amctgyItemStatus.idx = _elTblTr_AmItemNext.prop('rowIndex');
//__amctgyItemStatus.scroll_TOfset = __amctgyItemStatus.idx*_elTblTr_AmItemNext.prop('scrollHeight');
__amctgyItemStatus.scroll_TOfset += _elTblTr_AmItemNext.prop('scrollHeight');
//스크롤 에니메이션 수행
_elTbl_AmItem.children('#record').animate({ scrollTop: __amctgyItemStatus.scroll_TOfset }, 200);
__ifxn_updateAmItemDesc(__amctgyItemStatus.idx);
}
} break;
case "down": {
let _elTbl_AmItem = _elAmCtgyBgMenuItemWin.find('.tbl_record');
let _elTblTr_AmItemNext = _elTbl_AmItem.find('.focus').parent().next('tr');
if (_elTblTr_AmItemNext.length) {
_elTbl_AmItem.find('.focus').removeClass("focus");
_elTblTr_AmItemNext.children('.amctgyItem').addClass('focus');
// 테이블 ROW인덱스와 스크롤 OFFSET계산
__amctgyItemStatus.idx = _elTblTr_AmItemNext.prop('rowIndex');
//__amctgyItemStatus.scroll_TOfset = __amctgyItemStatus.idx*_elTblTr_AmItemNext.prop('scrollHeight');
__amctgyItemStatus.scroll_TOfset += _elTblTr_AmItemNext.prop('scrollHeight');
//스크롤 에니메이션 수행
_elTbl_AmItem.children('#record').animate({ scrollTop: __amctgyItemStatus.scroll_TOfset }, 200);
__ifxn_updateAmItemDesc(__amctgyItemStatus.idx);
}
} break;
case "plus": {
} break;
case "minus": {
} break;
}
} catch (_err){
console.log(`Fail to draw::> ${_err}`);
}
}
/**
* HotelTV UI[AppFull] Wrapper Function::> build amenity service
*/
function __uifxn_AppFull_BuildAmenity() {
let _state = HotelTV.state;
let _state_am_specific = null;
let __status_am_specific = null;
let _trTbl = HotelTV.translation;
let _opening = HotelTV.opening;
let _order = HotelTV.orders.amenity;
@@ -590,6 +785,15 @@ HotelTV.ui_appfull = (function() {
let _elAmCtgyBg = _elAmPupRoot.children('.bg').find('#lst_ctgbg');
let _elAmCtgySel = _elAmPupRoot.children('.slider').find('#lst_ctgsel');
const __ifxn_getRsItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id == _itemID) {
return _object[__j][_key];
}
}
return '';
}
// 어메니티 인포 Validation
if (!_opening.amenity) {
@@ -601,7 +805,7 @@ HotelTV.ui_appfull = (function() {
_aminfo_ctgy = _aminfo_top.menu;
_state_am_specific = _state.hotkey.mm[_aminfo_top.button].status;
__status_am_specific = _state.hotkey.mm[_aminfo_top.button].status;
@@ -636,6 +840,14 @@ HotelTV.ui_appfull = (function() {
_elDiv_Ctgy.appendChild(_elDiv_CtgyTitle);
_elAmCtgySel.append(_elDiv_Ctgy);
// 각 카테고리별 아이템 스크롤위치등을 관리하기 위하여 status맴버 초기화 및 구성
if ( !(_aminfo_ctgy[_idx].name in __status_am_specific.items)==true ){
__status_am_specific.items[_aminfo_ctgy[_idx].name] = {
"idx": 0,
"scroll_TOfset": 0
};
}
}
// 어메니티 팝업 카테고리 백그라운드 이미지 노드를 동적으로 구성
@@ -670,6 +882,12 @@ HotelTV.ui_appfull = (function() {
//Window Left side
let _elDiv_ItemWinLeft = document.createElement('div');
_elDiv_ItemWinLeft.className = 'winleft';
if ( ["ORDER", "CARTS"].includes(_aminfo_ctgy[_idx].name)==true )
{
_elDiv_ItemWinLeft.classList.add(_aminfo_ctgy[_idx].name.toLowerCase());
}
else
{
//ADD Table
var _elTbl_ItemsHdr = document.createElement('table');
@@ -692,7 +910,7 @@ HotelTV.ui_appfull = (function() {
var _elTh_ItmesHdr_Status = document.createElement('th');
_elTh_ItmesHdr_Status.setAttribute("id", "status");
_elTh_ItmesHdr_Status.textContent = _trTbl.ui.roomservice.title.amount[_state.lang];
_elTh_ItmesHdr_Status.textContent = _trTbl.ui.roomservice.title.orderability[_state.lang];
_elTr_ItmesHdr.appendChild(_elTh_ItmesHdr_Status);
_elTBody_ItmesHdr.appendChild(_elTr_ItmesHdr);
@@ -729,7 +947,6 @@ HotelTV.ui_appfull = (function() {
_elDiv_ItmesRecStatus.setAttribute("id", "status");
_objChkAvail = __uifxn_Utils_CheckAmItemAvailable(_objItem.schedule);
if(_objChkAvail.result==true){
_elDiv_ItmesRecStatus.textContent = _trTbl.ui.amenity.title.orderable[_state.lang];
}else{
@@ -771,6 +988,10 @@ HotelTV.ui_appfull = (function() {
center: true,
items: 1, //Number of Items on Screen what you want
loop: true,
rewind: false,
checkVisible: false,
animateOut: 'fadeOut',
animateIn: 'fadeIn',
margin: 0,
smartSpeed: 1000,
lazyLoad: true,
@@ -779,7 +1000,7 @@ HotelTV.ui_appfull = (function() {
pullDrag: false,
freeDrag: false,
dots: false,
startPosition: (Number(_state_am_specific.category_sel.cur) - 1),
startPosition: (Number(__status_am_specific.category_sel.cur) - 1),
});
// _elAmPupRoot.children('.bg').fadeIn(1000, function() {
// __uifxn_AppFull_HotKey_ShowBtnOnMM(false);
@@ -790,6 +1011,8 @@ HotelTV.ui_appfull = (function() {
center: true,
items: 5, //Number of Items on Screen what you want
loop: true,
rewind: false,
checkVisible: false,
margin: 0,
smartSpeed: 0,
autoWidth: false,
@@ -798,7 +1021,7 @@ HotelTV.ui_appfull = (function() {
pullDrag: false,
freeDrag: false,
dots: true,
startPosition: (Number(_state_am_specific.category_sel.cur) - 1),
startPosition: (Number(__status_am_specific.category_sel.cur) - 1),
});
//메인 페이지->어메니티 페이지 화면 전환
@@ -809,7 +1032,7 @@ HotelTV.ui_appfull = (function() {
_elAmPupRoot.children('.slider').fadeIn(300, function() {
_elAmPupRoot.children('.bg').fadeIn(500, function() {
_elAmCtgySel.find('.owl-item').addClass('unfocus');
_elAmCtgySel.trigger("to.owl.carousel", [(Number(_state_am_specific.category_sel.cur) - 1), 10, true]);
_elAmCtgySel.trigger("to.owl.carousel", [(Number(__status_am_specific.category_sel.cur) - 1), 10, true]);
_elAmCtgySel.trigger('translate.owl.carousel', [0, 500, true]);
$(document.activeElement).keydown(function(event) { //attach event listener
@@ -821,6 +1044,7 @@ HotelTV.ui_appfull = (function() {
} else if (event.keyCode == gRmtKey.enter) {
// 카테고리 화면 빌드 및 화면 전환
_state.menu.stage.cur = "amenity_ctgy_item_sel";
__uifxn_AppFull_DrawAmItemSeletion("enter");
} else if (event.keyCode == gRmtKey.back) {
// 카테고리 폼의 썸네일 에니메이션용 타이머 제거
@@ -860,16 +1084,23 @@ HotelTV.ui_appfull = (function() {
}
} else if (_state.menu.stage.cur == "amenity_ctgy_item_sel") {
if (event.keyCode == gRmtKey.left) {
__uifxn_AppFull_DrawAmItemSeletion("plus");
} else if (event.keyCode == gRmtKey.right) {
__uifxn_AppFull_DrawAmItemSeletion("minus");
} else if (event.keyCode == gRmtKey.up) {
__uifxn_AppFull_DrawAmItemSeletion("up");
} else if (event.keyCode == gRmtKey.down) {
__uifxn_AppFull_DrawAmItemSeletion("down");
} else if (event.keyCode == gRmtKey.back) {
console.log('AMENITY CATEGORY ITEM SEL: KEY::> ' + event.keyCode);
__uifxn_AppFull_DrawAmItemSeletion("exit");
_state.menu.stage.cur = "amenity_ctgy_sel";
}
} else {
console.log("AMENITY SLIDER KEYEVT: Skip events");
}
});
//어메니티 카테고리 선택 모드(생성시, 메뉴모드)
_state.menu.stage.cur = "amenity_ctgy_sel";
});
})
@@ -877,7 +1108,7 @@ HotelTV.ui_appfull = (function() {
_elAmCtgySel.on('change.owl.carousel', function(event) {
// Update HotelTV Amenity menu sel status
_state_am_specific.category_sel.prev = Object.keys(_aminfo_ctgy)[event.page.index];
__status_am_specific.category_sel.prev = Object.keys(_aminfo_ctgy)[event.page.index];
});
_elAmCtgySel.on('destroy.owl.carousel', function(event) {
@@ -886,9 +1117,17 @@ HotelTV.ui_appfull = (function() {
_elAmCtgySel.on('changed.owl.carousel', function(event) {
// Update HotelTV Amenity menu sel status
_state_am_specific.category_sel.cur = Object.keys(_aminfo_ctgy)[event.page.index];
//console.log("AMENITY CATEGORY SEL IDX::>" + _state.menu.main[_mmIdx].cur);
_elAmCtgyBg.trigger("to.owl.carousel", [event.page.index, 1000, true]);
__status_am_specific.category_sel.cur = Object.keys(_aminfo_ctgy)[event.page.index];
//console.log("AMENITY CATEGORY EVT IDX::>" + event.page.index);
console.log("AMENITY CATEGORY SEL IDX::>" + __status_am_specific.category_sel.cur);
if ( __status_am_specific.category_sel.cur in Object.keys(_aminfo_ctgy) ){
if ( _aminfo_ctgy[__status_am_specific.category_sel.cur].name == "CARTS" ){
console.log("TODO::> Draw Carts");
}else if ( _aminfo_ctgy[__status_am_specific.category_sel.cur].name == "ORDER" ){
console.log("TODO::> Draw Order");
}
}
_elAmCtgyBg.trigger("to.owl.carousel", [event.page.index, 1000]);
});
_elAmCtgySel.on('translate.owl.carousel', function(event) {
@@ -899,40 +1138,12 @@ HotelTV.ui_appfull = (function() {
} else {
_uiCtrl_idx = _elAmCtgySel.find('.owl-item.active.center').index();
}
//console.log("AMENITY CATEGORY CTRL IDX::>" + _uiCtrl_idx);
console.log("AMENITY CATEGORY CTRL IDX::>" + _uiCtrl_idx);
_elAmCtgySel.find('.owl-item.focus').addClass('unfocus');
_elAmCtgySel.find('.owl-item.focus').removeClass('focus');
_elAmCtgySel.find('.owl-item').eq(_uiCtrl_idx).addClass('focus');
_elAmCtgySel.find('.owl-item').eq(_uiCtrl_idx).removeClass('unfocus');
});
// HOTKEY정보를 state에 기록
// if (!(_amenity.button in _state.hotkey.mm)) {
// _state.hotkey.mm[_amenity.button] = {
// 'type': "amenity",
// 'id': _amenity.id,
// "status": {
// "focus": "menu",
// "menu": {
// "idx": 0,
// "scroll_TOfset": 0
// },
// "button": {
// "idx": null
// },
// "cartlist": {
// "idx": null,
// "scroll_TOfset": 0
// },
// "orderdetails": {
// "idx": null,
// "scroll_TOfset": 0
// }
// }
// };
// }
return;
}
@@ -985,7 +1196,7 @@ HotelTV.ui_appfull = (function() {
let _elRsOLstItems = _elRsOLstRoot.children(`#orders`);
let _elRsOLstSummary = _elRsOLstRoot.children('#summary');
const __fxn_getRsItemValue = function(_object, _key, _itemID) {
const __ifxn_getRsItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id == _itemID) {
return _object[__j][_key];
@@ -994,7 +1205,7 @@ HotelTV.ui_appfull = (function() {
return '';
}
const __fxn_padZero = function(_num, _size) {
const __ifxn_padZero = function(_num, _size) {
_num = _num.toString();
while (_num.length < _size) _num = "0" + _num;
return _num;
@@ -1049,7 +1260,7 @@ HotelTV.ui_appfull = (function() {
// Append Sub elements:: index
let _elDiv_index = document.createElement('div');
_elDiv_index.setAttribute("id", "index");
_elDiv_index.textContent = `[${__fxn_padZero(_idx,2)}]`;
_elDiv_index.textContent = `[${__ifxn_padZero(_idx,2)}]`;
_eldiv_ordering.appendChild(_elDiv_index);
// Append Sub elements:: date
@@ -1142,7 +1353,7 @@ HotelTV.ui_appfull = (function() {
_elDiv_OdItmesRec.className = "oditem";
var _elDiv_OdItmesRecName = document.createElement('div');
_elDiv_OdItmesRecName.setAttribute("id", "name");
_elDiv_OdItmesRecName.textContent =`[${_j}] ` + __fxn_getRsItemValue(_roomservice.children, "title", _OdItem.itemId)[_state.lang];
_elDiv_OdItmesRecName.textContent =`[${_j}] ` + __ifxn_getRsItemValue(_roomservice.children, "title", _OdItem.itemId)[_state.lang];
_elDiv_OdItmesRec.appendChild(_elDiv_OdItmesRecName);
var _elDiv_OdItmesRecQuantity = document.createElement('div');
@@ -1242,7 +1453,7 @@ HotelTV.ui_appfull = (function() {
let _elRsCLstSummary = _elRsCLstRoot.children('#summary');
let _elRsCLstButtons = _elRsCLstRoot.children('#buttons');
const __fxn_getRsItemValue = function(_object, _key, _itemID) {
const __ifxn_getRsItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id == _itemID) {
return _object[__j][_key];
@@ -1299,7 +1510,7 @@ HotelTV.ui_appfull = (function() {
// Append Sub elements::title
let _elDiv_title = document.createElement('div');
_elDiv_title.setAttribute("id", "title");
_elDiv_title.textContent = __fxn_getRsItemValue(_roomservice.children, "title", _rsItem.itemId)[_state.lang];
_elDiv_title.textContent = __ifxn_getRsItemValue(_roomservice.children, "title", _rsItem.itemId)[_state.lang];
_eldiv_item_ctz.appendChild(_elDiv_title);
// Append Sub elements::quantity
@@ -1384,7 +1595,7 @@ HotelTV.ui_appfull = (function() {
let _elRsMnItmTbl = _elRsMnRoot.children('#items').find('.tbl_record').children('#record');
let _elRsMnDesc = _elRsPupRoot.children('.description');
const __fxn_getRsItemValue = function(_object, _key, _itemID) {
const __ifxn_getRsItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id == _itemID) {
return _object[__j][_key];
@@ -1403,15 +1614,15 @@ HotelTV.ui_appfull = (function() {
let selectedTblItemID = _elRsMnItmTbl.children('tr.active').prop('id');
//Redraw Description
_elRsMnDesc.children('#title').text(__fxn_getRsItemValue(_roomservice.children, "title", selectedTblItemID)[_state.lang]);
_elRsMnDesc.children('#comment').text(__fxn_getRsItemValue(_roomservice.children, "description", selectedTblItemID)[_state.lang]);
_elRsMnDesc.children('#thumb').css('background-image', 'url(' + __fxn_getRsItemValue(_roomservice.children, "thumbnail", selectedTblItemID).files[_state.lang].download + ')');
_elRsMnDesc.children('#title').text(__ifxn_getRsItemValue(_roomservice.children, "title", selectedTblItemID)[_state.lang]);
_elRsMnDesc.children('#comment').text(__ifxn_getRsItemValue(_roomservice.children, "description", selectedTblItemID)[_state.lang]);
_elRsMnDesc.children('#thumb').css('background-image', 'url(' + __ifxn_getRsItemValue(_roomservice.children, "thumbnail", selectedTblItemID).files[_state.lang].download + ')');
if (_elRsMnDesc.css('display') == "none") {
_elRsMnDesc.show();
}
HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':__fxn_getRsItemValue(_roomservice.children, "id", selectedTblItemID)}}])
HotelTV.api.ReportEvent([{'power': true, 'location':{'conId':__ifxn_getRsItemValue(_roomservice.children, "id", selectedTblItemID)}}])
}
/**
@@ -1422,7 +1633,7 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
let _roomservice = HotelTV.opening.roomService;
let _carts = null;
const __fxn_cartItemExist = function(_object, _itemID) {
const __ifxn_cartItemExist = function(_object, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].itemId == _itemID) {
return true;
@@ -1431,7 +1642,7 @@ HotelTV.ui_appfull = (function() {
return false;
}
const __fxn_cartItemValue = function(_object, _key, _itemID) {
const __ifxn_cartItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].itemId == _itemID) {
return _object[__j][_key];
@@ -1450,8 +1661,8 @@ HotelTV.ui_appfull = (function() {
_elRsItemRecRoot.find('#price').text(_rsItem.price[_state.lang].toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",") + _roomservice.currency[_state.lang]);
// Update quantity
if (_carts.items.length && __fxn_cartItemExist(_carts.items, _rsItem.id) == true) {
let _cart_item_quantity = __fxn_cartItemValue(_carts.items, "quantity", _rsItem.id);
if (_carts.items.length && __ifxn_cartItemExist(_carts.items, _rsItem.id) == true) {
let _cart_item_quantity = __ifxn_cartItemValue(_carts.items, "quantity", _rsItem.id);
_total_quantity += _cart_item_quantity;
// Cart Quantity
_elRsItemRecRoot.find('#quantity').text(_cart_item_quantity);
@@ -1490,7 +1701,7 @@ HotelTV.ui_appfull = (function() {
let _elRsMnBtn = _elRsMnRoot.children('#buttons');
let _elRsOdDetails = _elRsPupRoot.children('.order-details');
const __fxn_cartEmpty = function(_object) {
const __ifxn_cartEmpty = function(_object) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id) {
return false;
@@ -1499,7 +1710,7 @@ HotelTV.ui_appfull = (function() {
return true;
}
const __fxn_cartItemValue = function(_object, _key, _itemID) {
const __ifxn_cartItemValue = function(_object, _key, _itemID) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].id == _itemID) {
return _object[__j][_key];
@@ -1507,7 +1718,7 @@ HotelTV.ui_appfull = (function() {
}
}
const __fxn_close_RsPopup = function(_fxn_post_process) {
const __ifxn_close_RsPopup = function(_fxn_post_process) {
// 아이템 디스크립션(메뉴 오른쪽) 하이드
__uifxn_AppFull_DrawRoomservceItemDescription(false);
@@ -1587,7 +1798,7 @@ HotelTV.ui_appfull = (function() {
_state.hotkey.mm[_roomservice.button].status.button.idx = "details";
_elRsMnBtn.children('div#details').addClass("active");
} else if (_state.hotkey.mm[_roomservice.button].status.button.idx == "details") {
if (__fxn_cartEmpty(_carts.items) == false) {
if (__ifxn_cartEmpty(_carts.items) == false) {
_state.hotkey.mm[_roomservice.button].status.button.idx = "order";
_elRsMnBtn.children('div#order').addClass("active");
} else {
@@ -1633,7 +1844,7 @@ HotelTV.ui_appfull = (function() {
//Hide Item Description Frame
__uifxn_AppFull_DrawRoomservceItemDescription(false);
if (__fxn_cartEmpty(_carts.items) == false) {
if (__ifxn_cartEmpty(_carts.items) == false) {
_state.hotkey.mm[_roomservice.button].status.button.idx = "order";
_elRsMnBtn.children('div#order').addClass("active");
} else {
@@ -1695,7 +1906,7 @@ HotelTV.ui_appfull = (function() {
if (_state.hotkey.mm[_roomservice.button].status.focus == "button") {
switch (_state.hotkey.mm[_opening.roomService.button].status.button.idx) {
case "cancel":
__fxn_close_RsPopup(_cbFxn);
__ifxn_close_RsPopup(_cbFxn);
break;
case "order":
//Remove active class from menu buttons
@@ -1773,7 +1984,7 @@ HotelTV.ui_appfull = (function() {
// Hide Menu
_elRsMnRoot.fadeIn(400);
} else {
__fxn_close_RsPopup(_cbFxn);
__ifxn_close_RsPopup(_cbFxn);
}
break;
}
@@ -2598,7 +2809,7 @@ HotelTV.ui_appfull = (function() {
});
$('#lst_mypagesel').on('translate.owl.carousel', function(event) {
const __fxn_getMyPaggeItemIndex = function(_object, _type) {
const __ifxn_getMyPaggeItemIndex = function(_object, _type) {
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].type == _type) {
return __j;
@@ -2619,10 +2830,10 @@ HotelTV.ui_appfull = (function() {
// MYPAGE서브 메뉴 인덱스 갱신
if (_mp_sm == "mpsel_accommodation") {
_state.menu.main[_mmIdx].cur = __fxn_getMyPaggeItemIndex(_mpinfo,'accommodation');
_state.menu.main[_mmIdx].cur = __ifxn_getMyPaggeItemIndex(_mpinfo,'accommodation');
} else if (_mp_sm == "mpsel_message") {
let __curMsgDspIdx = 0;
_state.menu.main[_mmIdx].cur = __fxn_getMyPaggeItemIndex(_mpinfo,'message');
_state.menu.main[_mmIdx].cur = __ifxn_getMyPaggeItemIndex(_mpinfo,'message');
// 메시지 포커싱
if ('message' in Object.keys(_state.menu.main[_mmIdx])) {
@@ -2637,7 +2848,7 @@ HotelTV.ui_appfull = (function() {
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').removeClass('focus');
$('.main>.mypage>.bg>.owl-carousel .owl-item #mp_msg_tblrec tr').filter("[msgidx='" + __curMsgDspIdx + "']").addClass('focus');
} else if (_mp_sm == "mpsel_replaywelcome") {
_state.menu.main[_mmIdx].cur = __fxn_getMyPaggeItemIndex(_mpinfo,'replaywelcome');
_state.menu.main[_mmIdx].cur = __ifxn_getMyPaggeItemIndex(_mpinfo,'replaywelcome');
}
console.log("MYPAGE EVT(TRANSLATED) MYPAGE MENU::>" + _state.menu.main[_mmIdx].cur);
@@ -2765,7 +2976,7 @@ HotelTV.ui_appfull = (function() {
let _tvProg = _program[_mmIdx].categories;
let _tvChitemAll = null;
const __fxn_getTvCtgAllId = function() {
const __ifxn_getTvCtgAllId = function() {
for (let _ctgidx = 1; _ctgidx <= _tvProg.length; _ctgidx++) {
if ( _tvProg[_ctgidx].name=="all" ){
return _ctgidx;
@@ -2775,7 +2986,7 @@ HotelTV.ui_appfull = (function() {
return 1;
}
const __fxn_getTvIdxByChnumber = function(_dic_channel, _ch_num) {
const __ifxn_getTvIdxByChnumber = function(_dic_channel, _ch_num) {
for (let _ctgidx = 1; _ctgidx <= _tvProg.length; _ctgidx++) {
if ( _tvProg[_ctgidx].name=="all" ){
return _ctgidx;
@@ -2785,11 +2996,11 @@ HotelTV.ui_appfull = (function() {
return 1;
}
const __fxn_getChItemValue = function(_object, _key) {
const __ifxn_getChItemValue = function(_object, _key) {
return _object[_key];
}
const __fxn_updateLastChIdxState = function(_ch_number) {
const __ifxn_updateLastChIdxState = function(_ch_number) {
let _state = HotelTV.state;
let _mmIdx = _state.menu.main.cur;
@@ -2842,7 +3053,7 @@ HotelTV.ui_appfull = (function() {
};
// ALL 카테고리 TV채널 정보 가져오기
_tvChitemAll = _tvProg[__fxn_getTvCtgAllId()].channels;
_tvChitemAll = _tvProg[__ifxn_getTvCtgAllId()].channels;
try {
let first_item = true;
@@ -2861,7 +3072,7 @@ HotelTV.ui_appfull = (function() {
{
let _ChItem = _tvChitemAll[_idx];
if ( __fxn_getChItemValue(_ChItem, "number").toString().includes( _tbl_keycode_to_num[_keyCode].toString())==true )
if ( __ifxn_getChItemValue(_ChItem, "number").toString().includes( _tbl_keycode_to_num[_keyCode].toString())==true )
{
var _elTr_ChtmesRec = document.createElement('tr');
var _elDiv_ChItmesRec = document.createElement('div');
@@ -2870,24 +3081,24 @@ HotelTV.ui_appfull = (function() {
_elDiv_ChItmesRec.setAttribute("item_idx", _idx);
if ( first_item==true ){
_state.tv.shortkey.ch_item_idx = _idx;
__fxn_updateLastChIdxState(__fxn_getChItemValue(_ChItem, "number"));
__ifxn_updateLastChIdxState(__ifxn_getChItemValue(_ChItem, "number"));
first_item = false;
}
var _elDiv_ChItmesRecChIcon = document.createElement('div');
_elDiv_ChItmesRecChIcon.setAttribute("id", "logo");
_elDiv_ChItmesRecChIcon.style.backgroundImage = "url('" + __fxn_getChItemValue(_ChItem, "logo").file.download + "')";
_elDiv_ChItmesRecChIcon.style.backgroundImage = "url('" + __ifxn_getChItemValue(_ChItem, "logo").file.download + "')";
_elDiv_ChItmesRec.appendChild(_elDiv_ChItmesRecChIcon);
// 채널 번호
var _elDiv_ChItmesRecChNum = document.createElement('div');
_elDiv_ChItmesRecChNum.setAttribute("id", "num");
_elDiv_ChItmesRecChNum.textContent = __fxn_getChItemValue(_ChItem, "number");
_elDiv_ChItmesRecChNum.textContent = __ifxn_getChItemValue(_ChItem, "number");
_elDiv_ChItmesRec.appendChild(_elDiv_ChItmesRecChNum);
var _elDiv_ChItmesRecName = document.createElement('div');
_elDiv_ChItmesRecName.setAttribute("id", "title");
_elDiv_ChItmesRecName.textContent = __fxn_getChItemValue(_ChItem, "title")[_state.lang];
_elDiv_ChItmesRecName.textContent = __ifxn_getChItemValue(_ChItem, "title")[_state.lang];
_elDiv_ChItmesRec.appendChild(_elDiv_ChItmesRecName);
_elTr_ChtmesRec.appendChild(_elDiv_ChItmesRec);
@@ -2929,7 +3140,7 @@ HotelTV.ui_appfull = (function() {
}
// 채널 요청
__uifxn_AppFull_TVRequestChannel(__fxn_getTvCtgAllId(), _state.tv.shortkey.ch_item_idx);
__uifxn_AppFull_TVRequestChannel(__ifxn_getTvCtgAllId(), _state.tv.shortkey.ch_item_idx);
if ( _elTvScutRoot.css('display') != 'none') {
_elTvScutRoot.fadeOut(500);
@@ -2949,7 +3160,7 @@ HotelTV.ui_appfull = (function() {
//_state.tv.shortkey.ch_item_idx = Number(selectedTblItem.children(".scitem").children("#num").text());
_state.tv.shortkey.ch_item_idx = Number(selectedTblItem.children(".scitem").attr("item_idx"));
__fxn_updateLastChIdxState(selectedTblItem.children(".scitem").children("#num").text());
__ifxn_updateLastChIdxState(selectedTblItem.children(".scitem").children("#num").text());
// 스크롤이 필요한 경우 스크롤링 하기
let _scrollTopVal = _state.tv.shortkey.scroll_offset;
@@ -2967,7 +3178,7 @@ HotelTV.ui_appfull = (function() {
//_state.tv.shortkey.ch_item_idx = Number(selectedTblItem.children(".scitem").children("#num").text());
_state.tv.shortkey.ch_item_idx = Number(selectedTblItem.children(".scitem").attr("item_idx"));
__fxn_updateLastChIdxState(selectedTblItem.children(".scitem").children("#num").text());
__ifxn_updateLastChIdxState(selectedTblItem.children(".scitem").children("#num").text());
// 스크롤이 필요한 경우 스크롤링 하기
let _scrollTopVal = _state.tv.shortkey.scroll_offset;
@@ -3630,7 +3841,7 @@ HotelTV.ui_appfull = (function() {
let _program = HotelTV.tvguide.program;
let _tvProg = _program[_mmIdx].categories;
const __fxn_exitTvMenu = function() {
const __ifxn_exitTvMenu = function() {
// 현재 재생중인 TV채널 종료
HotelTV.hcap.ChannelShutDown();
@@ -3665,7 +3876,7 @@ HotelTV.ui_appfull = (function() {
});
}
const __fxn_moveTvChannel = function(_tvProgram, _action) {
const __ifxn_moveTvChannel = function(_tvProgram, _action) {
let _mmIdx = _state.menu.main.cur;
let _curChCtg = _state.menu.main[_mmIdx].cur;
let _curChIdx = Number(_state.menu.main[_mmIdx][_curChCtg].cur);
@@ -3852,15 +4063,15 @@ HotelTV.ui_appfull = (function() {
$('#lst_tvCtgbg').trigger('next.owl', [1000])
} else if (event.keyCode == gRmtKey.up || event.keyCode == gRmtKey.chup) {
// 채널 리스트 아이탬 이동(UP)
__fxn_moveTvChannel(_tvProg, "ch_up");
__ifxn_moveTvChannel(_tvProg, "ch_up");
} else if (event.keyCode == gRmtKey.down || event.keyCode == gRmtKey.chdown) {
// 채널 리스트 아이탬 이동(DOWN)
__fxn_moveTvChannel(_tvProg, "ch_down");
__ifxn_moveTvChannel(_tvProg, "ch_down");
} else if (event.keyCode == gRmtKey.enter) {
// TV채널 플레이
} else if (event.keyCode == gRmtKey.back) {
// TV 메뉴를 종료하고 메인 메뉴로 이동
__fxn_exitTvMenu();
__ifxn_exitTvMenu();
} else if ( __uifxn_Utils_CheckKeyisNumber(event.keyCode)==true ){
//Navigate TV shortcut lists
if ( __uifxn_AppFull_TVDrawShortCutList(true, "build", event.keyCode)==0 ){
@@ -3871,13 +4082,13 @@ HotelTV.ui_appfull = (function() {
} else if (_state.menu.stage.cur == "tvCtgHide") {
if (event.keyCode == gRmtKey.chup) {
// 채널 리스트 아이탬 이동(CHUP)
__fxn_moveTvChannel(_tvProg, "ch_up");
__ifxn_moveTvChannel(_tvProg, "ch_up");
} else if (event.keyCode == gRmtKey.chdown) {
// 채널 리스트 아이탬 이동(CHDOWN)
__fxn_moveTvChannel(_tvProg, "ch_down");
__ifxn_moveTvChannel(_tvProg, "ch_down");
} else if (event.keyCode == gRmtKey.back) {
// TV 메뉴를 종료하고 메인 메뉴로 이동
__fxn_exitTvMenu();
__ifxn_exitTvMenu();
} else if ( __uifxn_Utils_CheckKeyisNumber(event.keyCode)==true ) {
//Navigate TV shortcut lists
if ( __uifxn_AppFull_TVDrawShortCutList(true, "build", event.keyCode)==0 ){
@@ -3891,7 +4102,7 @@ HotelTV.ui_appfull = (function() {
// console.log("TV shortcut routine: key:" + event.keyCode);
if (event.keyCode == gRmtKey.back) {
// TV 메뉴를 종료하고 메인 메뉴로 이동
//__fxn_exitTvMenu();
//__ifxn_exitTvMenu();
__uifxn_AppFull_TVDrawShortCutList(false, "exitWithoutChchange", event.keyCode);
_state.menu.stage.cur = _state.menu.stage.prev;
_state.menu.stage.prev = null;
@@ -4260,7 +4471,7 @@ HotelTV.ui_appfull = (function() {
const _state = HotelTV.state;
const _guest = HotelTV.guestinfo;
let _trTbl = HotelTV.translation;
const _get_unread_msgCnt = function(_object) {
const __ifxn_get_unread_msgCnt = function(_object) {
let _msg_unread_cnt = 0;
for (__j = 1; __j <= _object.length; __j++) {
if (_object[__j].read == false) {
@@ -4270,7 +4481,7 @@ HotelTV.ui_appfull = (function() {
return _msg_unread_cnt;
}
_msgCnt = _get_unread_msgCnt(HotelTV.message);
_msgCnt = __ifxn_get_unread_msgCnt(HotelTV.message);
if (_msgCnt > 0) {
$('.widjet .top .message #unread_cnt').text(_msgCnt.toString());
$('.widjet .top .message').show();
@@ -4554,7 +4765,7 @@ HotelTV.ui_appfull = (function() {
let _state = HotelTV.state;
let _mmcnt = 0;
const _get_weather_def_location = function() {
const __ifxn_get_weather_def_location = function() {
let _found = false;
for (__j = 1; __j <= _program.length; __j++) {
if (_program[__j].type == "weather" || _program[__j].widget==true ) {
@@ -4624,7 +4835,7 @@ HotelTV.ui_appfull = (function() {
}
// 디폴트 로케이션 설정
if ( _get_weather_def_location()==true ){
if ( __ifxn_get_weather_def_location()==true ){
_weather = HotelTV.weather[_state.weather.default_location];
}
@@ -4683,7 +4894,7 @@ HotelTV.ui_appfull = (function() {
__uifxn_AppFull_TopWidjetShow(true);
//Weather Contents Buildup
if ( _get_weather_def_location()==true ){
if ( __ifxn_get_weather_def_location()==true ){
if ( Object.keys(_state.weather.default_location).length != 0 ){
__uifxn_AppFull_BuildWeather();
}