1$(function(){ 2 snackEventCont.init(); 3}); 4 5const snackEventCont = { 6 targetElSelector: '.main-snack-contents', 7 init: function(){ 8 if(!snackEventCont.check()){ 9 return false; 10 } 11 12 snackEventCont.setDynamicValue(); 13 }, 14 check: function(){ 15 if($(snackEventCont.targetElSelector).length === 0){ 16 return false; 17 } 18 19 if(isEmpty($(snackEventCont.targetElSelector).data('eventId'))){ 20 return false; 21 } 22 23 return true; 24 }, 25 setDynamicValue : function (){ 26 ajaxHandler(null, { 27 action: '/promotion/get_snack_event_info', 28 formData: { 29 event_id : $(snackEventCont.targetElSelector).data('eventId'), 30 off_time : $(snackEventCont.targetElSelector).data('offTime') 31 }, 32 successFunc(e){ 33 snackEventCont.timerSetting($(snackEventCont.targetElSelector)); 34 snackEventCont.infoSetting($(snackEventCont.targetElSelector), e.data); 35 }, 36 errorFunc(){ 37 $(snackEventCont.targetElSelector).find('.snack-desc').remove(); 38 } 39 }); 40 }, 41 infoSetting : function (el, data){ 42 let participationCount = data.participation_count; 43 el.find('.snack-desc-view').text(snackEventCont.numberFormatToken(participationCount)+'ëª ì°¸ì¬ì¤'); 44 45 let replyCount = data.reply_count; 46 if(isNaN(replyCount) || isEmpty(replyCount)){ 47 replyCount = 0; 48 } 49 el.find('.snack-desc-comment').text(snackEventCont.numberFormatToken(replyCount)+'ê°ì ëê¸'); 50 }, 51 timerSetting : function(el){ 52 snackEventCont.timer(el); 53 snackEventCont.timerInterval = setInterval(function(){ 54 snackEventCont.timer(el); 55 },1000); 56 }, 57 timerInterval : null, 58 timer: function(el){ 59 var dealItem = new gfTransTime(el.data('offTime')); 60 61 if(dealItem.getTimeStamp() <= 0){ 62 clearInterval(snackEventCont.timerInterval); 63 $(snackEventCont.targetElSelector).remove(); 64 65 return false; 66 } 67 68 let targetEl = $(snackEventCont.targetElSelector).find('.snack-contents-timer'); 69 targetEl.html(dealItem.getHours()+'ìê° '+dealItem.getMinutes()+'ë¶ '+dealItem.getSeconds()+'ì´'); 70 }, 71 numberFormatToken: function (num){ 72 if(num/100000 < 1){ 73 return numberFormat(num); 74 } 75 76 return numberFormat(num/10000, 1) + 'ë§'; 77 } 78}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.