1(function() { 2 'use strict'; 3 4 var receiveMessage = function(event) { 5 var origin = event.origin || event.originalEvent.origin; 6 var data = event.data; 7 if ('update-frame-height' === data.action) { 8 if (origin !== etNETContentURL && origin !== host_name.replace(String.fromCharCode(47)+'hk/web/','').replace(String.fromCharCode(47)+'hk-staging/web/','').replace(/\/TuniS\/www(\d)?.ebshkdirect.com/,'')) { 9 return; 10 } 11 var pageName = data.args.pageName; 12 var height = data.args.height; 13 var frameHolder = data.args.frameHolder; 14 if (!Number(height) && isNaN(Number(height))) { 15 return; 16 } 17 var iframe = document.querySelector('#iframe-container iframe'); 18 if (frameHolder){ 19 iframe = document.querySelector(frameHolder + ' iframe'); 20 } 21 if (iframe && iframe.getAttribute('data-resized') !== 'yes' && (iframe.getAttribute('scrolling') === null || iframe.getAttribute('scrolling') === 'no')) { 22 iframe.setAttribute('scrolling', 'no'); 23 iframe.style.height = Number(Number(height) + 80) + 'px'; 24 iframe.setAttribute('data-resized', 'yes'); 25 //reset data-resized flag 26 setTimeout(function (){ iframe.removeAttribute('data-resized', 'yes'); }, 1000); 27 } 28 } else if ('fill-stock-price' === data.action) { 29 callbuysellwin(data.args.stockCode, '', 'B', data.args.price); 30 } else if ('update-stock-code' === data.action) { 31 try { 32 var frameWindow = window.frames.TeletextButtonFrame.contentWindow; 33 if (/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent)){ 34 frameWindow = window.frames.TeletextButtonFrame.window; 35 } 36 if (frameWindow){ 37 $(frameWindow.document.getElementsByTagName('body')[0]).attr('teletextStockCode', data.args.stockCode); 38 } 39 } catch (ignored){} 40 //callbuysellwin(data.args.stockCode, '', 'B', '0.00'); 41 } else if ('update-window-url' === data.action){ 42 if (origin !== etNETContentURL) { 43 return; 44 } 45 window.top.location.href = data.args.url; 46 } else if ('update-stock-search-stock-code' === data.action){ 47 var stockCode = data.args.stockCode; 48 var siteID = data.args.siteID.toLowerCase(); 49 if (Number(stockCode) && !isNaN(Number(stockCode))) { 50 var domain=(siteID=='os' ? '.ebshkdirect.com' : '.ebshkfg.com'); 51 document.cookie = "ETNETSTOCKCODE=" + stockCode + "; path=/;domain=" + domain; 52 } 53 } 54 }; 55 56 if (window.addEventListener) { 57 window.addEventListener('message', receiveMessage, false); 58 } else if (window.attachEvent) { 59 window.attachEvent('onmessage', receiveMessage); 60 } 61 62})();
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.