modified: myjupyterlab.sh
[GalaxyCodeBases.git] / etc / Chrome / 12306_ticket_helper_iccfish / src / air / js / flight4train.js
blob86bbd951c6cd48dbac2da308172adb42dd078388
1 (function(){var t={WYW:"WXN",SEQ:"SYX",SHH:"SHA",SNH:"SHA",AOH:"SHA",SXH:"SHA",DPK:"DOY",ZWJ:"ZHY",ZSQ:"ZGN",ZGQ:"ZGN",LVK:"LYI",UYK:"LYI",DUT:"DDG",LHM:"LJG",YWH:"YIW",WWT:"HLH",WVC:"WUA",WXC:"WUA",WMR:"URC",JJG:"JIU",JGG:"JGS",YMR:"YIN",YNR:"YIN",YCB:"LDS",FSQ:"FUO",JMB:"JMU",KHR:"KRY",LZJ:"LHW",LVJ:"LHW",LAJ:"LHW",XRZ:"ACX",JGX:"JGD",BTC:"BAV",BDC:"BAV",BJP:"BJS",VAP:"BJS",BOP:"BJS",VNP:"BJS",BXP:"BJS",BHZ:"BHY",NJH:"NKG",NKH:"NKG",NCW:"NAO",NNZ:"NNG",NCG:"KHN",NUH:"NTG",NFF:"NNY",BOR:"BPL",XMS:"XMN",XKS:"XMN",TZH:"HYN",HFH:"HFE",COH:"HFE",JLL:"JIL",HHC:"HET",NDC:"HET",VTR:"HTN",HMR:"HMI",HLR:"HMI",HBB:"HRB",VBB:"HRB",VAB:"HRB",TSP:"TVS",FUP:"TVS",KSR:"KHG",JGJ:"JGN",GUJ:"GYU",DTV:"DAT",DZX:"DQA",DKM:"DLU",DLT:"DLC",DFT:"DLC",TSJ:"THQ",TBP:"TSN",TJP:"TSN",TIP:"TSN",TXP:"TSN",TYV:"TYN",TBV:"TYN",TDV:"TYN",WKK:"WEH",NVH:"NGB",AQH:"AQG",APH:"AQG",AKY:"AKA",ASW:"AVA",YBW:"YBP",YCN:"YIH",HAN:"YIH",CZH:"CZX",ESH:"CZX",VGQ:"CGD",GYW:"GYS",GBQ:"CAN",GGQ:"CAN",GZQ:"CAN",IZQ:"CAN",GHW:"GHN",KLR:"KRL",KCR:"KCA",YJ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:"JIC",RDQ:"TEN",YIJ:"INC",XTC:"XIL",JZD:"JNZ",JOD:"JNZ",CCT:"CGQ",CET:"CGQ",CRT:"CGQ",CSQ:"CSX",CWQ:"CSX",CBF:"CIH",CZF:"CIH",FYH:"FUG",ASR:"AKU",ART:"YIE",QDK:"TAO",AST:"AOG",AXT:"AOG",JXB:"JXA",HKH:"TXN",HJB:"HEK",QNW:"JIQ",QHX:"NDG"},i=['._bb_flight_container {width:169px;border:1px solid rgba(9,2,4,0.2);border-radius:3px;box-shadow:3px 3px 2px rgba(0,0,0,0.03);font-family:"微软雅黑","宋体";}',"._bb_flight_container .title {height:27px;background-color:#E07900;position:relative;}","._bb_flight_container .title .closeMe {color:#FFFFFF;font-size:24px;position:absolute;top:-4px;left:146px;cursor:pointer;}","._bb_flight_container .title .icon {width:18px;height:19px;background:url(http://www.liebao.cn/ticket/icon.png) no-repeat 0 0;position:absolute;top:4px;left:7px;}","._bb_flight_container .title .titleText {color:#FFFFFF;font-size:12px;position:absolute;top:5px;left:32px;}","._bb_flight_container .main {height:57px;background-color:#FFFFFF;}","._bb_flight_container .main .notice {font-size:14px;color:#000000;margin-left:8px;line-height:32px;}","._bb_flight_container .main .line {font-size:14px;color:#EF6900;margin-left:8px;}","._bb_flight_container .main .to {margin:0 2px 0 4px;}","._bb_flight_container .ticketList {margin:0;padding:0;list-style:none;}","._bb_flight_container .ticketList li {height:52px;border-top:1px solid #C4C4C4;background-color:#FFF5ED;position:relative;}","._bb_flight_container .ticketList .date {font-size:12px;color:#000000;position:absolute;left:8px;top:8px;}","._bb_flight_container .ticketList .price {font-size:14px;color:#EF6900;position:absolute;left:8px;top:28px;}","._bb_flight_container .ticketList .discount {font-size:12px;color:#6E6E6E;width:36px;text-align:right;position:absolute;left:56px;top:30px;}","._bb_flight_container .ticketList .buyIt {width:58px;height:28px;font-size:12px;color:#563100;text-align:center;line-height:29px;border:1px solid #D18720;border-radius:2px;background:-webkit-linear-gradient(top,#FBB016,#ED8A0D);box-shadow:1px 1px 2px rgba(0,0,0,0.15);cursor:pointer;position:absolute;left:105px;top:18px;}","._bb_flight_container .ticketList .buyIt:hover {background:-webkit-linear-gradient(top,#D07C11,#FFC245);}","._bb_flight_container .ticketList .buyIt:active {background:-webkit-linear-gradient(top,#FFC245,#D07C11);}",],r=["function _bb_flight_stat(version, type, value1, value2) {",'flight_train_stat = document.createElement("img");','flight_train_stat.style.display = "none";','flight_train_stat.src = "http://liebao.tjweb.ijinshan.com/click/__infoc.gif"','+ "?actionname=liebao_80&ver=" + version + "&type=" + type','+ "&value1=" + encodeURIComponent(value1) + "&value2=" + encodeURIComponent(value2)','+ "&_t=" + (new Date()).getTime();',"document.body.appendChild(flight_train_stat);","}","function _bb_flight_close() {",'document.getElementsByClassName("_bb_flight_container")[0].style.display = "none";',"}"],n;top===window&&chrome.extension.onRequest.addListener(function(t,u,f){var c,s,o,e,a,l,h;if(t.ticketEvent=="flightHide"){document.getElementsByClassName("_bb_flight_container")[0].style.display="none";return}if(t.ticketEvent=="flightShow"&&t.query&&t.data&&t.data.length!=0){for(c=['<div class="title">','<div class="icon"><\/div>','<div class="titleText">没抢到火车票?<\/div>','<div class="closeMe" onclick="_bb_flight_close();_bb_flight_stat(\''+t.version+"', '59', '', '');\">×<\/div>","<\/div>",'<div class="main">','<div class="notice">快来看看特价机票<\/div>','<div class="line"><span>'+t.query.from+'<\/span><span class="to">—<\/span><span>'+t.query.to+"<\/span><\/div>","<\/div>",'<ul class="ticketList">'],s=t.data,o=0;o<s.length;o++)c.push("<li>",'<div class="date">'+s[o].date.replace(/-/g,"/")+"<\/div>",'<div class="price">¥<span>'+s[o].price+"<\/span><\/div>",'<div class="discount"><span>'+parseInt(s[o].discount,10)/10+"<\/span>折<\/div>",'<a class="buyIt" target="_blank" href="'+s[o].order_url+'" onclick="_bb_flight_stat(\''+t.version+"', '58', '"+(Date.parse(s[o].date)-t.context.trainTimestamp)/864e5+"', '"+t.query.from+"-"+t.query.to+"');\">抢票<\/a>","<\/li>");c.push("<\/ul>");document.getElementsByClassName("_bb_flight_container").length?(e=document.getElementsByClassName("_bb_flight_container")[0],e.style.display="block"):(a=document.createElement("style"),a.innerHTML=i.join("\n"),document.body.appendChild(a),l=document.createElement("script"),l.type="text/javascript",l.innerHTML=r.join("\n").replace(/####version####/,t.version),document.body.appendChild(l),e=document.createElement("div"),e.className="_bb_flight_container",document.body.appendChild(e));e.innerHTML=c.join("\n");e.style.position="absolute";h=document.getElementById("iframepage");h!==null?(e.style.top=h.offsetTop+t.context.positionOffset.y+"px",e.style.left=Math.max(h.offsetLeft+t.context.positionOffset.x-171,0)+"px",window.onresize=function(){e.style.left=Math.max(h.offsetLeft+t.context.positionOffset.x-171,0)+"px"}):(e.style.top=n.offsetTop+"px",e.style.left=Math.max(n.offsetLeft-171,0)+"px",window.onresize=function(){e.style.left=Math.max(n.offsetLeft-171,0)+"px"});f({status:!0})}});n=document.getElementById("main");n&&n.contentWindow&&chrome.extension.onRequest.addListener(function(i,r,u){var f;if(i.ticketEvent=="get12306Query"){var e=n.contentWindow.document,h=e.getElementById("fromStation"),c=e.getElementById("toStation"),l=e.getElementById("startdatepicker");if(e&&h&&c&&l){var o=h.value,s=c.value,a=l.value;o&&s&&a&&t[o]&&t[s]&&(f=Date.parse(a),u({shortFrom:t[o],shortTo:t[s],date:f<Date.now()?[f,f+1728e5]:[f-864e5,f+864e5],context:{trainTimestamp:f,positionOffset:{x:n.offsetLeft,y:n.offsetTop}}}))}}})})()