sync codes
This commit is contained in:
parent
6cc3332352
commit
ea4cda397c
@ -20,30 +20,34 @@
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="ChatServersHandler" path="ChatHandler.ashx" verb="*" type="Web12306.ChatServers"/>
|
||||
<add name="ChatServersHandler" path="ChatHandler.ashx" verb="*" type="Web12306.ChatServers" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
|
@ -44,6 +44,10 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.Entity" />
|
||||
@ -54,6 +58,30 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.2.0\lib\net45\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.3.2.0\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.2.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
@ -71,37 +99,9 @@
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Helpers, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Mvc, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Mvc.5.0.0\lib\net45\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Optimization">
|
||||
<HintPath>..\packages\Microsoft.AspNet.Web.Optimization.1.1.1\lib\net40\System.Web.Optimization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.Razor.3.0.0\lib\net45\System.Web.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Deployment, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Microsoft.AspNet.WebPages.3.0.0\lib\net45\System.Web.WebPages.Razor.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WebGrease">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\WebGrease.1.5.2\lib\WebGrease.dll</HintPath>
|
||||
@ -135,6 +135,7 @@
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="TrainSuggestion.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="css\base.css" />
|
||||
|
@ -35,13 +35,20 @@
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item em {
|
||||
font-weight: normal;
|
||||
color: gray;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item > header {
|
||||
font-weight: bold;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item > section {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item > time {
|
||||
@ -54,18 +61,28 @@
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item-self {
|
||||
color: rgb(73, 174, 73);
|
||||
background-color: #E5F8E5;
|
||||
color: rgb(55, 153, 55);
|
||||
background-color: #EFFAEF;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item-receive {
|
||||
color: rgb(147, 95, 224);
|
||||
background-color: #e4e4ff;
|
||||
color: rgb(50, 83, 168);
|
||||
background-color: #F9FAFF;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item-target {
|
||||
color: rgb(50, 83, 168);
|
||||
background-color: #BBE7FF;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-item-private {
|
||||
border-width: 2px;
|
||||
}
|
||||
|
||||
#chat_container .chat-items .chat-state-disconnect {
|
||||
background-color: #ffeeee;
|
||||
color: rgb(50, 83, 168);
|
||||
}
|
||||
|
||||
#chat_container .chat-item-at {
|
||||
color: inherit;
|
||||
@ -118,8 +135,17 @@
|
||||
border: 1px solid #bbb;
|
||||
border-radius: 5px;
|
||||
padding: 10px;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
#chat_container .chat-editor > section .chat-editor-at {
|
||||
padding: 5px;
|
||||
background-color: royalblue;
|
||||
color: #fff;
|
||||
margin-right: 5px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
#chat_container .chat-editor > section:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
@ -72,6 +72,7 @@
|
||||
color: #cccccc;
|
||||
}
|
||||
|
||||
.result .train-seats .train-limitsell,
|
||||
.result .train-seats .train-notsell {
|
||||
font-size: 20px;
|
||||
color: #999;
|
||||
|
@ -401,7 +401,7 @@
|
||||
, 需要加价。
|
||||
{{}}}
|
||||
{{}}}
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</script>
|
||||
@ -494,6 +494,8 @@
|
||||
{{?t.available==0||t.available==-1}}
|
||||
{{?t.selltime}}
|
||||
<span class="train-notontime">{{=ext.utility.formatSellDate(t.selltime)}} 起售</span>
|
||||
{{??t.limitSellInfo}}
|
||||
<span class="train-limitsell">本车次{{!t.limitSellInfo}}</span>
|
||||
{{??}}
|
||||
<span class="train-notsell">本车次票已售完</span>
|
||||
{{?}}
|
||||
@ -501,7 +503,6 @@
|
||||
<span class="train-notselect">本车次不在您的选择列表中</span>
|
||||
{{?}}
|
||||
</td>
|
||||
</span>
|
||||
{{~}}
|
||||
{{?!it.original||!it.original.length}}
|
||||
<tr class="train-empty">
|
||||
@ -852,45 +853,41 @@
|
||||
<section class="chat-item chat-state chat-state-{{!it.state}}">
|
||||
<i class="fa {{!it.stateIcon}}"></i>
|
||||
{{!it.msg}}
|
||||
{{=it.exinfo}}
|
||||
</section>
|
||||
</script>
|
||||
<script type="text/x-dot-template" id="chat_msg_item">
|
||||
<section class="chat-item {{=it.self?'chat-item-self':'chat-item-receive'}} {{=it.tome?'chat-item-target':''}} {{=it.secret?'chat-item-private':''}}">
|
||||
<header>
|
||||
<span>
|
||||
{{?it.self}}
|
||||
<strong>我</strong>
|
||||
{{??}}
|
||||
<a href="javascript:;" class="chat-item-at" data-un="{{!it.from.username}}">{{!it.from.realname}}</a>
|
||||
{{?}}
|
||||
{{?it.target&&it.target.length}}
|
||||
<em>对</em>
|
||||
{{~it.target:t:i}}
|
||||
{{?t.username}}
|
||||
<a href="javascript:;" class="chat-item-at" data-un="{{!t.username}}">{{!t.realname}}</a>
|
||||
{{??}}
|
||||
<strong>我</strong>
|
||||
{{?}}
|
||||
{{~}}
|
||||
<em>说</em>
|
||||
{{?}}
|
||||
:
|
||||
</span>
|
||||
</header>
|
||||
<time>{{!it.timeStr}}</time>
|
||||
<section>
|
||||
{{~it.items:item:idx}}
|
||||
<div style="color:{{!item.color}};">{{!item.text}}</div>
|
||||
{{~}}
|
||||
</section>
|
||||
</section>
|
||||
</script>
|
||||
<article class="chat-items">
|
||||
<section class="chat-item chat-item-self">
|
||||
<header>
|
||||
<span>倪超:</span>
|
||||
</header>
|
||||
<section>
|
||||
真的假的?
|
||||
</section>
|
||||
<time>21:01:42</time>
|
||||
</section>
|
||||
<section class="chat-item chat-item-receive">
|
||||
<header>
|
||||
<span>我:</span>
|
||||
</header>
|
||||
<section>
|
||||
真的假的?
|
||||
</section>
|
||||
<time>21:01:42</time>
|
||||
</section>
|
||||
<section class="chat-item chat-item-self chat-item-private">
|
||||
<header>
|
||||
<span><a href="javascript:;" class="chat-item-at">傻逼</a> 对你说:</span>
|
||||
</header>
|
||||
<section>
|
||||
真的假的?
|
||||
</section>
|
||||
<time>21:01:42</time>
|
||||
</section>
|
||||
<section class="chat-item chat-item-receive chat-item-private">
|
||||
<header>
|
||||
<span>我对 <a href="javascript:;" class="chat-item-at">傻逼</a> 说:</span>
|
||||
</header>
|
||||
<section>
|
||||
真的假的?
|
||||
</section>
|
||||
<time>21:01:42</time>
|
||||
</section>
|
||||
</article>
|
||||
<section class="chat-editor">
|
||||
<header>
|
||||
|
@ -110,58 +110,46 @@
|
||||
var notInstallExtension = function () {
|
||||
seajs.use("ui/noextension");
|
||||
};
|
||||
var entryPoint = function () {
|
||||
if (!window.targetExtensionId) {
|
||||
notInstallExtension();
|
||||
} else {
|
||||
//确保内容脚本启动
|
||||
var start = $.Deferred();
|
||||
start.done(function () {
|
||||
chrome.runtime.sendMessage(window.targetExtensionId, { action: "getStorage" }, function (m) {
|
||||
window.storage = m.detail;
|
||||
|
||||
seajs.use("ui/" + pagename);
|
||||
});
|
||||
});
|
||||
start.fail(function () {
|
||||
notInstallExtension();
|
||||
});
|
||||
|
||||
if (document.body.dataset["mobileSupportInitialized"]) {
|
||||
start.resolve();
|
||||
} else {
|
||||
var timer = setTimeout(function () {
|
||||
start.reject();
|
||||
}, 3000);
|
||||
document.addEventListener("mobileSupportInitialized", function () {
|
||||
window.clearTimeout(timer);
|
||||
start.resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
var targetExtension = [
|
||||
"bpbefagpafkfgoihbmcgeileodldkpnf",
|
||||
"gkbheeokbgmmnbjhhlphckobccejghjn"
|
||||
];
|
||||
window.targetExtensionId = null;
|
||||
var nextTest = function () {
|
||||
if (targetExtension.length) {
|
||||
var id = targetExtension.pop();
|
||||
chrome.runtime.sendMessage(id, { action: "getStorage" }, function (m) {
|
||||
if (m) {
|
||||
window.targetExtensionId = id;
|
||||
window.storage = m.detail;
|
||||
entryPoint();
|
||||
} else {
|
||||
nextTest();
|
||||
}
|
||||
});
|
||||
} else entryPoint();
|
||||
};
|
||||
$(function() {
|
||||
if (typeof (chrome) !== 'undefined') {
|
||||
nextTest();
|
||||
} else entryPoint();
|
||||
//确保内容脚本启动
|
||||
var start = $.Deferred();
|
||||
start.done(function () {
|
||||
chrome.runtime.sendMessage(window.targetExtensionId, { action: "getStorage" }, function (m) {
|
||||
window.storage = m.detail;
|
||||
|
||||
seajs.use("ui/" + pagename);
|
||||
});
|
||||
});
|
||||
start.fail(function () {
|
||||
notInstallExtension();
|
||||
});
|
||||
|
||||
var checkExtensionInfo = function() {
|
||||
window.targetExtensionId = document.body.dataset["targetExtensionId"];
|
||||
window.targetExtensionVersion = document.body.dataset["targetExtensionVersion"];
|
||||
|
||||
if (!window.targetExtensionId) {
|
||||
start.reject();
|
||||
return;
|
||||
}
|
||||
//检测版本吗?暂时不需要
|
||||
|
||||
|
||||
//完成!
|
||||
start.resolve();
|
||||
};
|
||||
|
||||
if (document.body.dataset["mobileSupportInitialized"]) {
|
||||
checkExtensionInfo();
|
||||
} else {
|
||||
var timer = setTimeout(function () {
|
||||
start.reject();
|
||||
}, 3000);
|
||||
document.addEventListener("mobileSupportInitialized", function () {
|
||||
window.clearTimeout(timer);
|
||||
checkExtensionInfo();
|
||||
});
|
||||
}
|
||||
});
|
||||
})(window, document);
|
||||
|
@ -86,7 +86,8 @@
|
||||
saleTime: t.queryLeftNewDTO.sale_time,
|
||||
secureStr: t.secretStr,
|
||||
selltime: null,
|
||||
date: t.queryLeftNewDTO.start_train_date.replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3")
|
||||
date: t.queryLeftNewDTO.start_train_date.replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3"),
|
||||
limitSellInfo: t.buttonTextInfo && t.buttonTextInfo.indexOf("暂售") != -1 ? t.buttonTextInfo.replace(/<[^>]+>/i, "") : null
|
||||
};
|
||||
var kp = getTicketInfo(t.queryLeftNewDTO.yp_info);
|
||||
train.tickets = kp;
|
||||
|
@ -73,6 +73,8 @@
|
||||
var checkSuggestion = function () {
|
||||
var suggestion = [];
|
||||
|
||||
console.log(JSON.stringify(trainStops));
|
||||
|
||||
for (var ts in trainStops) {
|
||||
var tinfo = trainStops[ts].info;
|
||||
var tstops = trainStops[ts].stops;
|
||||
|
@ -7,6 +7,7 @@
|
||||
var param = require("../../data.js");
|
||||
var page = $("#chat_container");
|
||||
var user = sessMgr.current;
|
||||
var utility = require("../../utility.js");
|
||||
|
||||
sessMgr.on("sessionChanged", function () {
|
||||
user = sessMgr.current;
|
||||
@ -20,6 +21,7 @@
|
||||
var chatListContainerDom = chatListContainer[0];
|
||||
var roomStateTemplate = $("#chat_connect_server").doT();
|
||||
var roomSystemNoticeTemplate = $("#chat_sys_alert").doT();
|
||||
var chatMsgItem = $("#chat_msg_item").doT();
|
||||
|
||||
this.enterRoom = function (targetRoom) {
|
||||
if (targetRoom === room)
|
||||
@ -47,7 +49,7 @@
|
||||
};
|
||||
this.appendMessageItem = function (html) {
|
||||
chatListContainer.append(html);
|
||||
chatListContainerDom.scrollTop = chatListContainerDom.clientHeight;
|
||||
chatListContainerDom.scrollTop = chatListContainerDom.scrollHeight;
|
||||
};
|
||||
this.clearDisplay = function () {
|
||||
chatListContainer.empty();
|
||||
@ -59,7 +61,8 @@
|
||||
realname: user.dispname,
|
||||
username: user.username
|
||||
},
|
||||
target: []
|
||||
target: msg.target || [],
|
||||
time: new Date().getTime()
|
||||
}
|
||||
port.postMessage("chatRoomSendMsg", data);
|
||||
};
|
||||
@ -81,13 +84,33 @@
|
||||
});
|
||||
port.on("chatRoomReceiveMsg", function (e, data) {
|
||||
that.fireEvent("chatRoomReceiveMsg");
|
||||
alert(JSON.stringify(data))
|
||||
|
||||
if (data.time) {
|
||||
data.time = new Date(data.time);
|
||||
data.timeStr = utility.formatDate(data.time, "hh:mm:ss");
|
||||
}
|
||||
data.self = data.from.username == sessMgr.current.username;
|
||||
data.tome = false;
|
||||
if (data.target && data.target.length) {
|
||||
var selfTarget = _.findWhere(data.target, { username: sessMgr.current.username });
|
||||
if (selfTarget) {
|
||||
data.tome = true;
|
||||
selfTarget.username = null;
|
||||
selfTarget.realname = "我";
|
||||
}
|
||||
}
|
||||
that.appendMessageItem(chatMsgItem(data));
|
||||
});
|
||||
port.on("chatRoomDisconnected", function () {
|
||||
that.appendMessageItem(roomStateTemplate({ state: "disconnect", stateIcon: "fa-spin fa-spinner", msg: "服务器已断开连接。" }));
|
||||
that.appendMessageItem(roomStateTemplate({ state: "disconnect", stateIcon: "fa-times", msg: "服务器已断开连接。", exinfo: "<a href='javascript:;' class='chat-frame-reconnect'>重新连接</a>" }));
|
||||
that.fireEvent("chatRoomDisconnected");
|
||||
page.find("button.button-primary").prop("disabled", true);
|
||||
});
|
||||
port.on("chatUpdateOnline", function () {
|
||||
if (!room)
|
||||
return;
|
||||
room.onlinecount = this.detail.count;
|
||||
});
|
||||
|
||||
return this;
|
||||
};
|
||||
@ -99,6 +122,7 @@
|
||||
(function chatEditor() {
|
||||
var editor = page.find("section.chat-editor");
|
||||
var sendBtn = editor.find(">footer>button.button-primary");
|
||||
var editorArea = editor.find(".chat-editor-container");
|
||||
|
||||
var initEditor = function () {
|
||||
if (!sessMgr.current)
|
||||
@ -115,7 +139,7 @@
|
||||
};
|
||||
initEditor();
|
||||
|
||||
editor.find(".chat-editor-container").keyup(function(e) {
|
||||
editor.find(".chat-editor-container").keyup(function (e) {
|
||||
if (e.keyCode === 13 && e.ctrlKey) {
|
||||
sendBtn.click();
|
||||
}
|
||||
@ -138,9 +162,23 @@
|
||||
session.exitRoom();
|
||||
});
|
||||
editor.find(">footer>button.button-primary").click(function () {
|
||||
var editorObj = editor.find(".chat-editor-container");
|
||||
var target = [];
|
||||
var addedUser = [];
|
||||
editorObj.find("span.chat-editor-at").each(function () {
|
||||
var username = this.dataset.un;
|
||||
if (addedUser[username])
|
||||
return;
|
||||
addedUser[username] = true;
|
||||
target.push({
|
||||
realname: $.trim($(this).text()).substr(1),
|
||||
username: username
|
||||
});
|
||||
}).remove();
|
||||
var msg = {
|
||||
color: user.options.chatColor,
|
||||
text: $.trim(editor.find(".chat-editor-container").text())
|
||||
text: $.trim(editorObj.text()),
|
||||
target: target
|
||||
}
|
||||
if (!msg.text)
|
||||
return;
|
||||
@ -148,6 +186,21 @@
|
||||
session.sendMsg(msg);
|
||||
delayEnableSend();
|
||||
});
|
||||
$(document).on("click", "a.chat-item-at", function () {
|
||||
var un = this.dataset.un;
|
||||
var name = this.innerHTML;
|
||||
|
||||
var html = "<span class='chat-editor-at' contenteditable='false' data-un='" + un + "'>@" + name + "</span> ";
|
||||
editorArea.append(html);
|
||||
|
||||
var range = document.createRange();
|
||||
range.selectNodeContents(editorArea[0]);
|
||||
range.collapse(false);
|
||||
var selection = window.getSelection();
|
||||
selection.removeAllRanges();
|
||||
selection.addRange(range);
|
||||
editorArea[0].focus();
|
||||
});
|
||||
})();
|
||||
|
||||
return {
|
||||
|
@ -61,7 +61,7 @@
|
||||
|
||||
//界面交互初始化
|
||||
(function () {
|
||||
$(".order-tips").html("今日可预定:" + utility.formatDate(param.minDate, "MM月dd日") + "-" + utility.formatDate(param.maxDate, "MM月dd日") + "的火车票");
|
||||
$(".order-tips").html("今日可订票:" + utility.formatDate(param.minDate, "MM月dd日") + "-" + utility.formatDate(param.maxDate, "MM月dd日") + "车票");
|
||||
|
||||
//自动加速关闭
|
||||
$(".net-tips, .reset-btn").hide();
|
||||
|
@ -88,7 +88,7 @@
|
||||
exports.MessagePopup = MessagePopup;
|
||||
|
||||
exports.showMessagePopup = function (icon, content, options) {
|
||||
options = $.extend({ closeAfter: 1000 }, options);
|
||||
options = $.extend({ closeAfter: 2000 }, options);
|
||||
|
||||
var popup = new MessagePopup(icon, content, options);
|
||||
popup.show();
|
||||
|
@ -4,10 +4,8 @@
|
||||
<package id="bootstrap" version="3.0.0" targetFramework="net45" />
|
||||
<package id="jQuery" version="1.10.2" targetFramework="net45" />
|
||||
<package id="jquery.TypeScript.DefinitelyTyped" version="1.3.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Web.Optimization.zh-Hans" version="1.1.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.0.0" targetFramework="net45" />
|
||||
@ -17,11 +15,10 @@
|
||||
<package id="Microsoft.AspNet.WebApi.Core.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost.zh-Hans" version="5.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages.zh-Hans" version="3.0.0" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebPages" version="3.2.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="5.0.6" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
<package id="Respond" version="1.2.0" targetFramework="net45" />
|
||||
<package id="underscore.TypeScript.DefinitelyTyped" version="0.4.4" targetFramework="net45" />
|
||||
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
|
||||
|
Loading…
Reference in New Issue
Block a user