// 点击替换 var Macro = { start: "__EVENT_TIME_START__", end: "__EVENT_TIME_END__", x: "__OFFSET_X__", y: "__OFFSET_Y__" }, _clktk, _curl, start_time, end_time; if(conf.imgUP){ var img = new Image(); img.src = "//cm.dop.mediav.com/add?pid=632&cid="+getQuery("tck"); } $("body").on("mousedown", ".content_med", function (e) { var _y = parseInt(e.pageY - $(this).offset().top), _x = parseInt(e.pageX - $(this).offset().left); if($(this).parents(".more").length>0){ _y = parseInt(e.pageY - $(this).parents(".more").offset().top); _x = parseInt(e.pageX - $(this).parents(".more").offset().left); } topClktk1($(this), _x, _y) }).on("click", ".content_med", function (e) { topClktk2($(this)); var str = $(this).attr('data-clktk'); if (str) { var arr = str.split(','); $.each(arr, function (index, val) { $('body').append(''); }); }; $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), position:$.base64.encode($(this).attr("position")), qid:$.base64.encode(getQuery("qid")), env:$.base64.encode(getQuery("env")), uid:$.base64.encode(getQuery("uid")) }).done(function(data) {}); }); function creatScript(smua,position) { var _b = document.createElement("div") var _s = document.createElement("script"); _s.setAttribute("type","text/javascript"); _s.setAttribute("smua",smua); _s.src = "//www.nkscdn.com/smu0/o.js"; _b.appendChild(_s) _b.setAttribute("position",position); _b.setAttribute("class","baiduP"); return _b } function topClktk1(el, x, y) { start_time = Math.round(new Date()); _clktk = el.data('oldclktk'); _curl = el.data("oldcurl"); if (_clktk.indexOf(Macro["start"]) > -1) { _clktk = _clktk.replace(Macro["start"], start_time); }; if (_clktk.indexOf(Macro["x"]) > -1) { _clktk = _clktk.replace(Macro["x"], x); }; if (_clktk.indexOf(Macro["y"]) > -1) { _clktk = _clktk.replace(Macro["y"], y); }; if (_curl.indexOf(Macro["start"]) > -1) { _curl = _curl.replace(Macro["start"], start_time); }; if (_curl.indexOf(Macro["x"]) > -1) { _curl = _curl.replace(Macro["x"], x); }; if (_curl.indexOf(Macro["y"]) > -1) { _curl = _curl.replace(Macro["y"], y); }; el.attr('data-clktk', _clktk); el.attr('href', _curl); }; function topClktk2(el, x, y) { end_time = Math.round(new Date()); _curl = el.attr("href"); if (_clktk.indexOf(Macro["end"]) > -1) { _clktk = _clktk.replace(Macro["end"], end_time); }; if (_curl.indexOf(Macro["end"]) > -1) { _curl = _curl.replace(Macro["end"], end_time); }; el.attr('data-clktk', _clktk); el.attr('href', _curl); }; function getBrowser() { var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isOpera = userAgent.indexOf("Opera") > -1; //判断是否Opera浏览器 var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器 var isEdge = userAgent.indexOf("Edge") > -1; //判断是否IE的Edge浏览器 var isFF = userAgent.indexOf("Firefox") > -1; //判断是否Firefox浏览器 var isSafari = userAgent.indexOf("Safari") > -1 && userAgent.indexOf("Chrome") == -1; //判断是否Safari浏览器 var isChrome = userAgent.indexOf("Chrome") > -1 && userAgent.indexOf("Safari") > -1; //判断Chrome浏览器 if (isIE) { var reIE = new RegExp("MSIE (\\d+\\.\\d+);"); reIE.test(userAgent); var fIEVersion = parseFloat(RegExp["$1"]); if (fIEVersion == 7) { return "IE7"; } else if (fIEVersion == 8) { return "IE8"; } else if (fIEVersion == 9) { return "IE9"; } else if (fIEVersion == 10) { return "IE10"; } else if (fIEVersion == 11) { return "IE11"; } else { return "0"; }//IE版本过低 } if (isOpera) { return "Opera"; } if (isEdge) { return "Edge"; } if (isFF) { return "FF"; } if (isSafari) { return "Safari"; } if (isChrome) { return "Chrome"; } } function getSystem() { var sUserAgent = navigator.userAgent; var isWin = (navigator.platform == "Win32") || (navigator.platform == "Windows"); var isMac = (navigator.platform == "Mac68K") || (navigator.platform == "MacPPC") || (navigator.platform == "Macintosh") || (navigator.platform == "MacIntel"); if (isMac) return "Mac"; var isUnix = (navigator.platform == "X11") && !isWin && !isMac; if (isUnix) return "Unix"; var isLinux = (String(navigator.platform).indexOf("Linux") > -1); if (isLinux) return "Linux"; if (isWin) { var isWin2K = sUserAgent.indexOf("Windows NT 5.0") > -1 || sUserAgent.indexOf("Windows 2000") > -1; if (isWin2K) return "Win2000"; var isWinXP = sUserAgent.indexOf("Windows NT 5.1") > -1 || sUserAgent.indexOf("Windows XP") > -1; if (isWinXP) return "WinXP"; var isWin2003 = sUserAgent.indexOf("Windows NT 5.2") > -1 || sUserAgent.indexOf("Windows 2003") > -1; if (isWin2003) return "Win2003"; var isWinVista = sUserAgent.indexOf("Windows NT 6.0") > -1 || sUserAgent.indexOf("Windows Vista") > -1; if (isWinVista) return "WinVista"; var isWin7 = sUserAgent.indexOf("Windows NT 6.1") > -1 || sUserAgent.indexOf("Windows 7") > -1; if (isWin7) return "Win7"; var isWin10 = sUserAgent.indexOf("Windows NT 10") > -1 || sUserAgent.indexOf("Windows 10") > -1; if (isWin10) return "Win10"; } return "other"; } function uploadZhike(uploadAction) { var params = { project:getQueryLocarion('project') || getQuery('project') || 'default', data:getQueryLocarion('data') || getQuery('data') || 'default', os:getSystem() || 'default', browser:getBrowser() || 'default', act:uploadAction.act || 'default', ad_id:uploadAction.ad_id || '2299666', ad_pos:uploadAction.ad_pos || 'xiaoyu_tpop_1', ad_time:new Date().getTime() || 'default', ad_type:parseInt(uploadAction.ad_type) || 'zhike', strategy_id:parseInt(uploadAction.strategy_id) || '1172', idea_id:parseInt(uploadAction.idea_id) || 'default', plan_id:parseInt(uploadAction.plan_id) || 'default', product_category:parseInt(uploadAction.product_category) || 'default' }; var url = "http://sspreport.7654.com/ssp/user_click?code="+params.project + encodeURI('\t')+ params.data + encodeURI('\t')+params.os+ encodeURI('\t')+params.browser+ encodeURI('\t')+params.act+encodeURI('\t')+params.ad_id+encodeURI('\t')+params.ad_pos+encodeURI('\t')+params.ad_time+encodeURI('\t')+params.ad_type+encodeURI('\t')+params.strategy_id+encodeURI('\t')+params.idea_id+encodeURI('\t')+params.plan_id+encodeURI('\t')+params.product_category; $.getJSON(url).done(function (data) {}); } function getQuery(variable) { var query = decodeURI(window.location.search.substring(1)); if (query.indexOf("&")) { var vars = query.split("&"); } for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return decodeURIComponent(pair[1]); } } return ""; } function getQueryLocarion(variable) { var query = localStorage.getItem("feed"); if(query){ if (query.indexOf("&")) { var vars = query.split("&"); } for (var i = 0; i < vars.length; i++) { var pair = vars[i].split("="); if (pair[0] == variable) { return decodeURIComponent(pair[1]); } } } return ""; } function firstShow(showId){ $.getJSON("//ad.kuaizip.com/advertise/userclick",{ time:new Date().getTime(), localUrl:$.base64.encode("kZip.com"+location.pathname), project:$.base64.encode("tpop"+"_"+conf.proType), type:$.base64.encode("hoteastday"), position:$.base64.encode("news_1"), act:$.base64.encode("show") }).done(function(data) {}); }