1var KnowhowTalkNotify = { 2 /** 3 * ì림 ë ì´ì´ íì html 4 * @type {jQuery} 5 */ 6 $notify: null, 7 /** 8 * íì ë ¸ì¶ ìí 9 * @type {boolean} 10 */ 11 visibleFlag: false, 12 /** 13 * ì림 ë ì´ì´ 기본 ìì¹ 14 * @var {number} 15 */ 16 notifyDefaultPos: 0, 17 /** 18 * ì림 ë ì´ì´ ë ¸ì¶ ìì¹ 19 * @type {number} 20 */ 21 notifyShowPos: 20, 22 /** 23 * ì림 ì²´í¬ íì´ë¨¸ 24 * @type {number|null} 25 */ 26 notifyCheckTimer: null, 27 /** 28 * ë§ì§ë§ ë©ìì§ ë²í¸ 29 * @type {number} 30 */ 31 lastChattingSeq: 0, 32 /** 33 * initialize 34 */ 35 init: function () { 36 //set vars: notify html 37 this.$notify = $('#knowhowTalkNotify'); 38 39 //set vars: ë ì´ì´ 기본 ìì¹ ì¤ì 40 var notifyDefaultPos = (this.$notify.height() + 5) * -1; 41 this.notifyDefaultPos = notifyDefaultPos; 42 this.$notify.css('bottom', notifyDefaultPos + 'px'); 43 44 //ì림 ì²´í¬ íì´ë¨¸ ì¤ì 45 this.setNotifyCheckTimer(); 46 }, 47 /** 48 * ë¡ê·¸ì¸ í 첫ë²ì§¸ ì림 ì²´í¬ 49 */ 50 checkNotifyAfterLogin: function () { 51 var objNotify = this; 52 var $notify = objNotify.$notify; 53 54 $.ajax({ 55 url: '/knowhowTalk/checkNotify', 56 type: 'get', 57 data: {checkType: 'pcAfterLogin'}, 58 dataType: 'json', 59 async: false, 60 success: function (json) { 61 if (!json.result) { 62 return false; 63 } 64 65 var totalSenderCount = json.data.totalSenderCount; 66 var lastChattingSeq = json.data.lastChattingSeq; 67 68 if (!totalSenderCount) { 69 return false; 70 } 71 if (objNotify.lastChattingSeq == lastChattingSeq) { 72 return false; 73 } 74 75 objNotify.lastChattingSeq = lastChattingSeq; 76 $notify.find('#knowhowTalkNotifyMsg').html(json.data.html); 77 objNotify.show(); 78 return true; 79 } 80 }); 81 }, 82 /** 83 * ì림 ì²´í¬ 84 * @returns {boolean} 85 */ 86 checkNotify: function () { 87 var objNotify = this; 88 var $notify = objNotify.$notify; 89 var retVal = false; 90 91 $.ajax({ 92 url: '/knowhowTalk/checkNotify', 93 type: 'get', 94 data: {checkType: 'pc'}, 95 dataType: 'json', 96 async: false, 97 success: function (json) { 98 if (!json.result) { 99 objNotify.unsetNotifyCheckTimer(); 100 retVal = false; 101 return false; 102 } 103 104 var totalSenderCount = json.data.totalSenderCount; 105 var lastChattingSeq = json.data.lastChattingSeq; 106 107 if (!totalSenderCount) { 108 retVal = false; 109 return false; 110 } 111 if (objNotify.lastChattingSeq == lastChattingSeq) { 112 retVal = false; 113 return false; 114 } 115 116 objNotify.lastChattingSeq = lastChattingSeq; 117 objNotify.hide(false); 118 $notify.find('#knowhowTalkNotifyMsg').html(json.data.html); 119 retVal = true; 120 return true; 121 }, 122 error:function(){ 123 retVal = false; 124 return false; 125 } 126 }); 127 128 return retVal; 129 }, 130 /** 131 * ì림 ì²´í¬ íì´ë¨¸ ì¤ì 132 */ 133 setNotifyCheckTimer: function () { 134 var objNotify = this; 135 136 objNotify.notifyCheckTimer = setInterval(function () { 137 if (objNotify.checkNotify()) { 138 objNotify.show(); 139 } 140 }, 10000); 141 }, 142 /** 143 * ì림 ì²´í¬ íì´ë¨¸ í´ì 144 */ 145 unsetNotifyCheckTimer: function () { 146 var objNotify = this; 147 148 if (objNotify.notifyCheckTimer > 0) { 149 clearInterval(objNotify.notifyCheckTimer); 150 } 151 }, 152 /** 153 * ì림 ë ¸ì¶ 154 * @param {boolean} [animate=true] ì ëë©ì´ì ì ì© ì¬ë¶ 155 */ 156 show: function (animate) { 157 //set param default value 158 if (typeof animate == 'undefined') { 159 animate = true; 160 } 161 162 //set vars: notify ê°ì²´ 163 var objNotify = this; 164 165 //ìë¦¼ì´ ì¨ê²¨ì§ ìíì¼ëë§ ë ¸ì¶ ì²ë¦¬ 166 if (!objNotify.visibleFlag) { 167 //set vars: html, layer position 168 var $notify = objNotify.$notify; 169 var bottomPos = objNotify.notifyShowPos; 170 171 objNotify.hideHelp(); 172 173 $notify.show(); 174 175 if (animate) { 176 $notify.animate( 177 {bottom: bottomPos + 'px'}, 178 1000, 179 function () { 180 $notify.stop(true); 181 objNotify.visibleFlag = true; 182 } 183 ); 184 } else { 185 $notify.css('bottom', bottomPos + 'px'); 186 objNotify.visibleFlag = true; 187 } 188 } 189 }, 190 /** 191 * ì림 ì¨ê¹ 192 * @param {boolean} [animate=true] ì ëë©ì´ì ì ì© ì¬ë¶ 193 */ 194 hide: function (animate) { 195 //set param default value 196 if (typeof animate == 'undefined') { 197 animate = true; 198 } 199 200 //set vars: notify ê°ì²´ 201 var objNotify = this; 202
203 //ìë¦¼ì´ ë ¸ì¶ë ìíì¼ëë§ ì¨ê¹ ì²ë¦¬ 204 if (objNotify.visibleFlag) { 205 //set vars: html, layer position 206 var $notify = objNotify.$notify; 207 var bottomPos = objNotify.notifyDefaultPos; 208 209 if (animate) { 210 $notify.animate( 211 {bottom: bottomPos + 'px'}, 212 500, 213 function () { 214 $notify.hide(); 215 $notify.stop(true); 216 objNotify.visibleFlag = false; 217 } 218 ); 219 } else { 220 $notify.hide(); 221 $notify.css('bottom', bottomPos + 'px'); 222 objNotify.visibleFlag = false; 223 } 224 } 225 }, 226 /** 227 * ì림 ìë´ ë ¸ì¶ 228 */ 229 showHelp: function () { 230 var $notify = this.$notify; 231 $notify.find('#knowhowTalkNotifyHelp').show(); 232 }, 233 /** 234 * ì림 ìë´ ì¨ê¹ 235 */ 236 hideHelp: function () { 237 var $notify = this.$notify; 238 $notify.find('#knowhowTalkNotifyHelp').hide(); 239 } 240};
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.