同步提交代码

This commit is contained in:
iFish 2014-09-05 18:34:16 +08:00
parent 6c2d153f46
commit 94852177f4
21 changed files with 158 additions and 56 deletions

View File

@ -201,5 +201,8 @@ $(function () {
document.body.dataset["targetExtensionId"] = chrome.runtime.id;
document.body.dataset["targetExtensionVersion"] = chrome.runtime.getManifest().version;
document.body.dataset["mobileSupportInitialized"] = 1;
chrome.runtime.sendMessage({ action: "getBv" }, function (m) {
document.body.dataset["browserVersion"] = m.bv;
document.dispatchEvent(new CustomEvent("mobileSupportInitialized"));
});
});

View File

@ -1,6 +1,7 @@
var MANIFEST = chrome.runtime.getManifest();
var INFOBAR = chrome.infobars || (chrome.experimental && chrome.experimental.infobars);
var isDebug = (compressFunc + '').indexOf("false") != -1;
var bv = window.external.LiebaoGetVersion && window.external.LiebaoGetVersion() || /Chrome\/([\d\.]+)/i.exec(navigator.userAgent)[1];
var entry12306 = false;
var log = (function () {
@ -1076,7 +1077,7 @@ window.cbl = function (u, h) {
trackback(m.detail.type, m.detail.values);
});
trackback(99);
trackback(99, [MANIFEST.version, bv]);
})();
//#endregion
@ -1085,7 +1086,8 @@ window.cbl = function (u, h) {
//#region 版本更新
(function () {
var updateurl = "http://www.fishlee.net/service/update2/44/44/version_v6" + (INFOBAR ? "" : "_1") + ".json?" + Math.random();
var cv = parseInt(/Chrome\/(\d+)/i.exec(navigator.userAgent)[1]);
var updateurl = "http://www.fishlee.net/service/update2/44/" + (cv < 34 ? "44" : "60") + "/version_v6" + (INFOBAR ? "" : "_1") + ".json?" + Math.random();
var lastCheckUpdate = null;
var hasUpdate = false, lastVersion = null, lastMessage = null, updateInfo = null;
@ -1118,14 +1120,19 @@ window.cbl = function (u, h) {
};
var msgCallback = function (m, s, r) {
if (m && m.action === 'getUpdateInfo')
if (!m || !m.action)
return;
if (m.action === 'getUpdateInfo')
r(updateInfo);
if (m && m.action === 'getVersionInfo')
else if (m.action === 'getVersionInfo')
r({ curVersion: MANIFEST.version, updateInfo: updateInfo });
if (m && m.action === 'triggerUpdate') {
else if (m.action === 'triggerUpdate') {
if (!lastCheckUpdate || (new Date() - lastCheckUpdate) >= 300000) {
checkUpdate();
}
} else if (m.action === "getBv") {
r({ bv: bv });
}
};
chrome.runtime.onMessage.addListener(msgCallback);
@ -1308,6 +1315,13 @@ window.cbl = function (u, h) {
var callbackQueue = [];
var lastLoad = null;
var setRoomCount = function (id, count) {
if (!servers)
return;
var room = _.findWhere(servers, { id: id });
if (room) room.onlinecount = count;
};
var execCallback = function () {
var callback;
while (callbackQueue.length) {
@ -1350,7 +1364,8 @@ window.cbl = function (u, h) {
});
return {
loadServers: loadServers
loadServers: loadServers,
setRoomCount: setRoomCount
};
})();
@ -1403,6 +1418,7 @@ window.cbl = function (u, h) {
}
if (msg.action === "chatUpdateOnline") {
currentRoom.onlinecount = msg.detail.count;
serverMgr.setRoomCount(currentRoom.id, currentRoom.onlinecount);
}
postMessageToPort(msg);
};
@ -1423,11 +1439,15 @@ window.cbl = function (u, h) {
socket.send(JSON.stringify(msg));
};
var disconnect = function () {
if (!socket)
return;
if (socket) {
socket.close();
socket = null;
}
if (currentRoom) {
$.post("http://12306.liebao.cn/index.php?r=Api/GetRoomOnlineNum", { roomId: roomId });
}
currentRoom = null;
if (heratBeatTimer) {
clearInterval(heratBeatTimer);
heratBeatTimer = null;
@ -1490,7 +1510,7 @@ window.cbl = function (u, h) {
hasChange = true;
}
if (hasChange) {
alarms.forEach(function (task) {
_.each(alarms, function (task) {
var id = "ALARM-" + task.data.fromCode + "-" + task.data.toCode + new Date().getTime();
chrome.runtime.sendMessage({ action: "track", detail: { type: 132, values: [task.type || 0, task.point || 0] } });

View File

@ -57,6 +57,7 @@
var otsweb = (function () {
var fun = function () {
var e = this;
var queryUrl = "http://kyfw.12306.cn/otn/leftTicket/query";
var getTicketInfo = function (v) {
var data = {}, info = v.indexOf("#") === -1 ? v : /getSelected\(['"](.*?)['"]\)/i.exec(v)[1].split('#')[11],
@ -129,8 +130,19 @@ var otsweb = (function () {
"leftTicketDTO.to_station": to,
"purpose_codes": code == "00" ? "ADULT" : code
};
e.ajaxGet("http://kyfw.12306.cn/otn/leftTicket/query", "http://kyfw.12306.cn/otn/leftTicket/init", data, "json", function (response) {
if (!response || !response.status) {
e.ajaxGet(queryUrl, "http://kyfw.12306.cn/otn/leftTicket/init", data, "json", function (response) {
if (!response) {
callback(null);
return;
}
if (response.c_url) {
queryUrl = "http://kyfw.12306.cn/otn/" + response.c_url;
e.queryTicketOtn.apply(e, [].slice.call(arguments));
return;
}
if (!response.status) {
callback(null);
return;
}

View File

@ -51,12 +51,12 @@
"browser_action": {
"default_icon": "icons/icon_32.png",
"default_popup": "air/popup.html",
"default_title": "猎豹抢票党 (集成12306订票助手V6)"
"default_title": "猎豹抢票党/12306订票助手 V7"
},
"description": "12306订票助手 v6: 帮您订票的小助手 by 木鱼,全力为您的车票购买献计献策!",
"description": "12306订票助手 v7: 帮您订票的小助手 by 木鱼,全力为您的车票购买献计献策!",
"key": "7k6gnXVACvUPU2DfslJgSrWJTHqIg5uwd+Kgl/5zSg==",
"name": "12306订票助手V6/猎豹抢票党",
"version": "7.0.0",
"name": "猎豹抢票党/12306订票助手 V7",
"version": "7.0.1",
"manifest_version": 2,
"icons": {
"16": "icons/icon_16.png",
@ -70,7 +70,7 @@
"background": {
"page": "background.html"
},
"minimum_chrome_version": "28.0",
"minimum_chrome_version": "28",
"externally_connectable": {
"ids": [ ],
"matches": [

View File

@ -36,10 +36,10 @@
<i class="caret"></i>
</a>
<ul class="dropdown-menu">
<li><a href="http://kyfw.12306.cn/otn/" id="link_n" target="_blank">新版12306订票 ①</a></li>
<li><a href="https://kyfw.12306.cn/otn/" id="link_n" target="_blank">新版12306订票 ②</a></li>
<li><a href="http://12306.liebao.cn/" target="_blank">极速版订票</a></li>
<li class="divider"></li>
<li><a href="http://app.fishlee.net/12306/" target="_blank">极速版订票</a></li>
<!--<li><a href="http://dynamic.12306.cn/otsweb/" id="link_o" target="_blank">旧版12306订票</a></li>-->
<li><a href="http://kyfw.12306.cn/otn/" id="link_n" target="_blank">官方12306订票</a></li>
</ul>
</li>
<li class="dropdown">

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web;
namespace Web12306
@ -9,6 +10,8 @@ namespace Web12306
{
#region Implementation of IHttpHandler
#if !DEBUG
/// <summary>
/// 通过实现 <see cref="T:System.Web.IHttpHandler"/> 接口的自定义 HttpHandler 启用 HTTP Web 请求的处理。
/// </summary>
@ -18,9 +21,49 @@ namespace Web12306
var request = context.Request;
var response = context.Response;
response.Redirect("http://www.fishlee.net/service/download/383");
var ua = request.UserAgent;
if (string.IsNullOrEmpty(ua))
return;
var m = Regex.Match(ua, @"Chrome/(\d+)", RegexOptions.IgnoreCase);
if (!m.Success)
return;
var v = int.Parse(m.Groups[1].Value);
if (v < 34)
{
response.Redirect("http://www.fishlee.net/service/dcl/44");
}
else
{
response.Redirect("http://www.fishlee.net/service/dcl/60");
}
}
#else
/// <summary>
/// 通过实现 <see cref="T:System.Web.IHttpHandler"/> 接口的自定义 HttpHandler 启用 HTTP Web 请求的处理。
/// </summary>
/// <param name="context"><see cref="T:System.Web.HttpContext"/> 对象,它提供对用于为 HTTP 请求提供服务的内部服务器对象(如 Request、Response、Session 和 Server的引用。</param>
public void ProcessRequest(HttpContext context)
{
var request = context.Request;
var response = context.Response;
var ua = request.UserAgent;
if (string.IsNullOrEmpty(ua))
return;
var m = Regex.Match(ua, @"Chrome/(\d+)", RegexOptions.IgnoreCase);
if (!m.Success)
return;
response.Redirect("crx.crx");
}
#endif
/// <summary>
/// 获取一个值,该值指示其他请求是否可以使用 <see cref="T:System.Web.IHttpHandler"/> 实例。
/// </summary>

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
//
// 你可以指定所有值,也可以让修订版本和内部版本号采用默认值,
// 方法是按如下所示使用 "*":
[assembly: AssemblyVersion("1.0.15002.62")]
[assembly: AssemblyVersion("1.0.14248.66")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<!--
有关如何配置 ASP.NET 应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId=301880
@ -10,7 +10,7 @@
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
<add key="12306_trainsuggestion_maxradio" value="0.7"/>
<add key="12306_trainsuggestion_maxradio" value="0.7" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
@ -25,7 +25,11 @@
<add name="ChatServersHandler" path="ChatHandler.ashx" verb="*" type="Web12306.ChatServers" />
<add name="TrainSuggestHandler" path="ts" verb="*" type="Web12306.TrainSuggestion" />
<add name="CrxHandler" path="crx" verb="*" type="Web12306.CrxHandler" />
</handlers>
<staticContent>
<mimeMap fileExtension=".crx" mimeType="application/octet-stream" />
</staticContent>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

View File

@ -108,11 +108,11 @@
}
#wx_sell_notification span.hand {
background: url(../images/hand.png) no-repeat left top;
background: url(../images/handd.gif) no-repeat left top;
width: 93px;
height: 120px;
position: absolute;
z-index: 100;
right: -56px;
bottom: -34px;
right: -45px;
bottom: -24px;
}

View File

@ -109,6 +109,7 @@
right: 0;
left: 0;
height: 200px;
background: #ffffff;
}
#chat_container .chat-editor > header {

View File

@ -192,6 +192,11 @@
padding: 10px;
}
#suggestion > footer > span {
color: #c23825;
font-weight: bold;
}
#suggestion .result {
margin-bottom: 0;
}

BIN
Web12306/images/handd.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -49,13 +49,6 @@
<p>系统通知</p>
</a>
<section class="search-tips-container">
<h5>
重要提示
<i class="fa fa-times fr"></i>
</h5>
<div>
铁道部的运营图有重要的调整,请注意查看网站通知
</div>
</section>
</li>
</ul>
@ -515,11 +508,10 @@
</tbody>
</table>
</script>
<div style="display:block;" class="result">
</div>
<footer>
<strong>提示</strong> 跨站购票需要换取纸票,通过人工检票后在您所需要上车的站点(<span></span>)上车,不可直接刷身份证入站
<strong>提示</strong> 跨站购票需要换取纸票,通过人工检票后在您原来的<span></span>站上车、<span></span>站下车,发车时间以<span></span>站发车时间为准
</footer>
</section>
<!-- 月日期选择 -->
@ -957,7 +949,7 @@
<script type="text/x-dot-template" id="chat_sys_alert">
<section class="chat-item chat-item-alert">
<i class="fa fa-exclamation-triangle"></i>
您已经进入了 <span>{{!it.name}}</span>,当前在线 <span class="chat-online-count">{{=it.onlinecount}}</span> 人。请阅读我们的 <a href="">发言规范</a>,请不要出现任何非法信息和倒卖信息,否则您的账号将会被封。
您已经进入了 <span>{{!it.name}}</span>,当前在线 <span class="chat-online-count">{{=it.onlinecount}}</span> 人。请不要出现任何非法信息和倒卖信息,否则您的账号将会被封。
</section>
</script>
<script type="text/x-dot-template" id="chat_connect_server">
@ -1112,13 +1104,5 @@
<script src="js/modules/doT.js"></script>
<script src="js/modules/seajs/sea.js"></script>
<script src="js/boot.js"></script>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c7150a056b54f666f90c1a05e0700798";
document.getElementsByTagName("head")[0].appendChild(hm);
})();
</script>
</body>
</html>

View File

@ -114,7 +114,7 @@
}
var profile = storage.obj("12306_user_" + dispname) || { hasNotVerifyedPassenger: false, dispname: dispname, passengers: [], savedProfile: { list: [] }, currentProfile: {}, rawPassenger: [], options: { soundPrompt: true } };
profile.currentProfile = $.extend({}, that.defaultProfile, profile.currentProfile, cp);
profile.currentProfile = $.extend({}, _.clone(that.defaultProfile), profile.currentProfile, cp);
if (!profile.currentProfile.autoRefreshDelay)
profile.currentProfile.autoRefreshDelay = 5;
if (username)
@ -256,7 +256,7 @@
get: function () {
return session && session.currentProfile;
}, set: function (value) {
session.currentProfile = $.extend({}, that.defaultProfile, value);
session.currentProfile = $.extend({}, _.clone(that.defaultProfile), value);
that.fireEvent("currentProfileChanged");
that.save();
}

View File

@ -102,7 +102,7 @@
seajs.use("ui/noextension");
};
window.targetExtensionId = null;
$(function() {
$(function () {
//确保内容脚本启动
var start = $.Deferred();
start.done(function () {
@ -118,8 +118,25 @@
start.fail(function () {
notInstallExtension();
});
start.always(function () {
var page = location.pathname;
if (location.search) {
page += location.search;
} else {
page += "?";
}
page += "bv=" + document.body.dataset["browserVersion"] + "&ev=" + document.body.dataset["targetExtensionVersion"];
//加入百度统计
window._hmt = window._hmt || [];
_hmt.push(['_setAutoPageview', false]);
_hmt.push(['_trackPageview', page]);
var checkExtensionInfo = function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?c7150a056b54f666f90c1a05e0700798";
document.getElementsByTagName("head")[0].appendChild(hm);
});
var checkExtensionInfo = function () {
window.targetExtensionId = document.body.dataset["targetExtensionId"];
window.targetExtensionVersion = document.body.dataset["targetExtensionVersion"];
@ -147,3 +164,5 @@
}
});
})(window, document);

View File

@ -1,4 +1,5 @@
define(function (require, exports, module) {
var param = require("../data.js");
exports.targetId = window.targetExtensionId;
var EventObject = require("./EventObject.js");
@ -65,7 +66,7 @@
}, function () { });
//百度统计
if (window._hmt) {
if (window._hmt && type !== param.trackTypes.OPEN_PAGE_INDEX) {
try {
var data = "";
if (values) {

View File

@ -77,7 +77,9 @@
$("#chat_float_tip").click(showServerList);
})();
setTimeout(function() {
servernode.loadServers();
}, 1000 * 60 * 11);
return {

View File

@ -110,7 +110,7 @@
dom.find("div>p:eq(0) span").html(data.orderId);
submitProgress.removeClass().addClass("ticket-submit-status ticket-submit-status-ok");
submitProgress.find("span").html("订票成功!订单号为 " + data.orderId);
share.makeWeiboShare(document.getElementById("lnkShareWb"), null, "我刚在#猎豹浏览器#上用#订票助手#抢到了" + pPassengers.length + "张车票!你的车票买到了吗?", null);
share.makeWeiboShare(document.getElementById("lnkShareWb"), null, "尝试了各种办法买国庆火车票,差点就要放弃,没想到用 @猎豹浏览器 一下子就抢到了想要的车票,给力啊! #国庆抢票,就用猎豹# ", null);
submitBtn[0].disabled = false;
//track

View File

@ -37,9 +37,12 @@
$(".search-tips-container").html(noticeTemplate(unreadNotice));
$("#index-tip-body").find(".order-num").html(unreadNotice.length).show();
} else {
$("#index-tip-body").find(".order-num").html(0).hide();
$("#index-tip-body").find(".order-num").html("0").hide();
//取最新的几条通知
var shownNotice = _.first(savedNotice.items, data.sysNoticeMaxShowCount);
if (!shownNotice.length) {
shownNotice = [{ title: "暂时没有系统公告" }];
}
$(".search-tips-container").html(noticeTemplate(shownNotice));
}
};

View File

@ -122,6 +122,10 @@
utility: utility,
getOriginalDepInfo: getOriginalDepInfo
}));
var infoSpan = $("#suggestion > footer> span");
infoSpan.eq(0).html(sessMgr.currentProfile.fromText);
infoSpan.eq(1).html(sessMgr.currentProfile.toText);
infoSpan.eq(2).html(sessMgr.currentProfile.fromText);
self.location.hash = '#suggestion';
//track

View File

@ -21,6 +21,7 @@ rem "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extens
rem ren deploy.crx 12306订票助手(猎豹浏览器专版)_打开欢迎页.crx
tools\SourceFileUtility.exe deploy\manifest.json ", ""infobars""" ", ""experimental"""
tools\SourceFileUtility.exe deploy\manifest.json ".1""," ".0"","
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "--pack-extension=%~dp0deploy" "--pack-extension-key=%~dp0src_lb.pem"
ren deploy.crx 12306订票助手(猎豹浏览器专版)_B29.crx