$._T = {} $._T['L'] = {} $._T['L']['Lao'] = 'ພາສາລາວ' $._T['L']['Buzzer'] = 'ບັດຄິວ' $._T['L']['Cancel'] = 'ຍົກເລີກ' $._T['L']['Finish'] = 'ສັ່ງເລີຍ' $._T['L']['Yes'] = 'ແມ່ນແລ້ວ' $._T['L']['No'] = 'ບໍ່' $._T['L']['What is your buzzer number?'] = 'ກະລຸນາກົດເລກຄິວຂອງທ່ານ' $._T['L']['Are you sure you want to cancel?'] = 'ຢາກຍົກເລີກແທ້ບໍ?' $._T['L']['Total'] = 'ລວມ' $._T['L']['LAK'] = 'ກີບ' $._T['L']['Change'] = 'ປ່ຽນ' $._T['L']['Doughnuts'] = 'ໂດນັດ' $._T['L']['Discount'] = 'ສ່ວນຫຼຸດ' $._T['L']['Takeaway'] = 'ເອົາກັບບ້ານ' $._T['L']['Dining Options'] = 'ກິນຢູ່ນີ້ ຫຼື ສັ່ງກັບບ້ານ?' $._T['L']['Take away'] = 'ສັ່ງກັບບ້ານ' $._T['L']['Eat in'] = 'ກິນຢູ່ຮ້ານ' $._T['L']['Change Dining'] = 'ປ່ຽນຮູບແບບການຮັບອາຫານ' $._T['L']['Eat in, drinks take away'] = 'ກິນຢູ່ນີ້ ເຄື່ອງດື່ມໃສ່ຈອກກັບບ້ານ' $._T['L']['Thank You!'] = 'ຂອບໃຈຫຼາຍໆ!' $._T['L']['Free drinking water and WIFI available'] = 'ມີບໍລິການນໍ້າດື່ມ ແລະ WIFI ຟຣີ' $._T['L']['We are preparing your order'] = 'ພວກເຮົາກໍາລັງກຽມອໍເດີ້ທ່ານຢູ່' $._T['L']['Please collect a buzzer'] = 'ກະລຸນາຈັບເອົາ ບັດຄິວຂອງທ່ານ' $._T['L']['and press on the number of your buzzer below'] = 'ແລ້ວກົດໝາຍເລກບັດຂອງທ່ານລຸ່ມນີ້' $._T['L']['Please bring the buzzer to the counter when it goes off'] = 'ເມື່ອບັດຄິວສັ່ນ ນໍາກັບມາເຄົາເຕີ້ເດີ້' $._T['L']['Menu'] = 'ເມນູ' $._T['L']['Check Order'] = 'ກວດອໍເດີ້' $._T['L']['Sweet'] = 'ຫວານ' $._T['L']['0% Sweet'] = 'ບໍ່ຫວານ (0%)' $._T['L']['50% Sweet'] = 'ຫວານ 50%' $._T['L']['100% Sweet'] = 'ຫວານ 100%' $._T['L']['PAY LATER'] = 'ຈ່າຍນໍາຫຼັງ' $._T['L']['PAY ON PICK-UP'] = 'ມາເອົາອາຫານຄ່ອຍຈ່າຍ' $._T['L']['Please pick a buzzer and type in its number'] = 'ກະລຸນາ ຈັບເອົາບັດຄິວ ແລ້ວກົດເລກຕາມບັດຂອງທ່ານ' $.systemRefreshOn = 0 $.localList({type:'announcement', queryfields:'code,note', prefix:'announcement'}) $.fn.field = function(){ let field = $(this) if(field.attr('field') == 'soldout'){ field.parent().attr('soldout', 1) return this } if(field.attr('field') == 'notavailable'){ field.parent().attr('notavailable', 1) return this } if(field.attr('field') == 'bestseller'){ field.parent().attr('bestseller', 1) return this } if(field.attr('field') == 'premium'){ field.parent().attr('premium', 1) return this } if(field.attr('field') == 'newproduct'){ field.parent().attr('newproduct', 1) return this } } $.menuBuild = function(){ let tagQuery = '' if($.menuTags) tagQuery = ',"tag":"'+$.menuTags+'"' if($.menuImageWidth == undefined) $.menuImageWidth = 180 $.menuJumpers = [] $('#menu').empty() .div('menu-jumpers') $._d('menugroups').appendTo('#menu') .queryItems('t_product'+tagQuery+';`type`="t_product";;`name` ASC', { attr:'menuitem pick', fields:'image,title,title_la,price,description,code,tag,comment', imagewidth:$.menuImageWidth, controls:function(div){ div.ap( $._d('item-buttons') .button('Sold Out', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), soldout:'soldout', updatenote:'product_update'})}, 'sold-out-button') .button('Not Available', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), notavailable:'notavailable', updatenote:'product_update'})}, 'notavailable-button') .button('Best Seller!', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), bestseller:'bestseller', updatenote:'product_update'})}, 'bestseller-button') .button('Premium', function(){ this.event.stopPropagation() let premium = 'premium' if($.store.items[$(this.event.target).id()].premium) premium = '' $.store.saveItem({id:$(this.event.target).id(), premium:premium, updatenote:'product_update'})}, 'premium-button') .button('New Product', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), newproduct:'newproduct', updatenote:'product_update'})}, 'newproduct-button') .button('Clear SO/NA', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), soldout:'', notavailable:'', updatenote:'product_update'})}, 'sold-out-clear-button') .button('Clear Premium', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), premium:'', updatenote:'product_update'})}, 'clear-premium-button') .button('Clear New', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), newproduct:'', updatenote:'product_update'})}, 'clear-newproduct-button') .button('Clear All', function(){ this.event.stopPropagation() $.store.saveItem({id:$(this.event.target).id(), bestseller:'', soldout:'', notavailable:'', updatenote:'product_update'})}, 'clear-all-button') ) }, done:function(div){ $.setMenuGroupHeadings() setTimeout(()=>{ $.setMenuJumpers() }, 3000) } }) $('#menu').on('scroll', function(){ let top = Math.round($('#menu').scrollTop() * 1) _.forEach($.menuJumpers, function(v, k){ if(top > (v - 70)) $('#menu-jumpers').attr('highlighted', k + 1) }) }) return $('#menu') } $.setMenuJumpers = function(){ $('#menu-jumpers').empty() $.menuJumpers = [] $('#menu').find('[group-heading]').each(function(index){ let heading = $(this) let offset = Math.round(heading.position().top * 1) $.menuJumpers[index* 1] = offset; $('#menu-jumpers').button(heading.text(), function(){ let top = $('#menu').scrollTop() * 1 let offset = Math.round(heading.position().top * 1) $('#menu').scrollTop(Math.max(0, (top + offset))) }) }) } $.setMenuGroupHeadings = ()=>{ $('#menu [menu-heading-note').remove() $('#menu').find('[group-heading]').each(function(index){ let heading = $(this) let announcement = $.localLists['announcement_'+heading.text().toLowerCase()] if(announcement == undefined) return heading.after($._d('menu-heading-note', announcement.note)) }) } $.loadMenu = function(){$.menuBuild()} $.setRefreshCalls('product_update', $.loadMenu) $.setRefreshCalls('announcement', $.loadMenu)