Update: SignalR 2.0.3 Migration; Noticeboards

Migrate all SignalR 1.x Persistent Connections to SignalR 2.x Hubs.
Abstracts ScheduledTaskStatus with core interface and adds a Mock for
optional status reporting. Noticeboards rewritten (with new theme) to be
more resilient and accurate.
This commit is contained in:
Gary Sharp
2014-06-01 23:27:07 +10:00
parent f6fae26bc7
commit 4cd57f4a90
116 changed files with 9874 additions and 6462 deletions
@@ -2,7 +2,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34011
// Runtime Version:4.0.30319.34014
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -164,7 +164,7 @@ WriteLiteral(">");
#line 32 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(jl.TechUser.ToString());
Write(jl.TechUser.ToStringFriendly());
#line default
@@ -173,7 +173,7 @@ WriteLiteral("</span>");
#line 32 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyLogs || (canRemoveOwnLogs && jl.TechUserId == CurrentUser.UserId))
if (canRemoveAnyLogs || (canRemoveOwnLogs && jl.TechUserId == CurrentUser.UserId))
{
#line default
@@ -205,14 +205,14 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 1881), Tuple.Create("\"", 1919)
WriteAttribute("title", Tuple.Create(" title=\"", 1889), Tuple.Create("\"", 1927)
#line 33 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 1889), Tuple.Create<System.Object, System.Int32>(jl.Timestamp.ToFullDateTime()
, Tuple.Create(Tuple.Create("", 1897), Tuple.Create<System.Object, System.Int32>(jl.Timestamp.ToFullDateTime()
#line default
#line hidden
, 1889), false)
, 1897), false)
);
WriteLiteral(">");
@@ -312,14 +312,14 @@ WriteLiteral(" <td");
WriteLiteral(" id=\"Attachments\"");
WriteAttribute("class", Tuple.Create(" class=\"", 2624), Tuple.Create("\"", 2699)
WriteAttribute("class", Tuple.Create(" class=\"", 2632), Tuple.Create("\"", 2707)
#line 49 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2632), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
, Tuple.Create(Tuple.Create("", 2640), Tuple.Create<System.Object, System.Int32>(canAddAttachments ? "canAddAttachments" : "cannotAddAttachments"
#line default
#line hidden
, 2632), false)
, 2640), false)
);
WriteLiteral(">\r\n <div");
@@ -344,14 +344,14 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 2867), Tuple.Create("\"", 2924)
WriteAttribute("href", Tuple.Create(" href=\"", 2875), Tuple.Create("\"", 2932)
#line 53 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 2874), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
, Tuple.Create(Tuple.Create("", 2882), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 2874), false)
, 2882), false)
);
WriteLiteral(" data-attachmentid=\"");
@@ -380,42 +380,42 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3030), Tuple.Create("\"", 3050)
WriteAttribute("title", Tuple.Create(" title=\"", 3038), Tuple.Create("\"", 3058)
#line 54 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3038), Tuple.Create<System.Object, System.Int32>(ja.Filename
, Tuple.Create(Tuple.Create("", 3046), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 3038), false)
, 3046), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 3117), Tuple.Create("\"", 3176)
WriteAttribute("src", Tuple.Create(" src=\"", 3125), Tuple.Create("\"", 3184)
#line 55 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3123), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
, Tuple.Create(Tuple.Create("", 3131), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 3123), false)
, 3131), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3239), Tuple.Create("\"", 3259)
WriteAttribute("title", Tuple.Create(" title=\"", 3247), Tuple.Create("\"", 3267)
#line 56 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3247), Tuple.Create<System.Object, System.Int32>(ja.Comments
, Tuple.Create(Tuple.Create("", 3255), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 3247), false)
, 3255), false)
);
WriteLiteral(">\r\n");
@@ -469,7 +469,7 @@ WriteLiteral(">");
#line 61 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(ja.TechUser.ToString());
Write(ja.TechUser.ToStringFriendly());
#line default
@@ -478,7 +478,7 @@ WriteLiteral("</span>");
#line 61 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ja.TechUserId == CurrentUser.UserId))
if (canRemoveAnyAttachments || (canRemoveOwnAttachments && ja.TechUserId == CurrentUser.UserId))
{
#line default
@@ -510,14 +510,14 @@ WriteLiteral(" data-livestamp=\"");
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 3914), Tuple.Create("\"", 3952)
WriteAttribute("title", Tuple.Create(" title=\"", 3930), Tuple.Create("\"", 3968)
#line 62 "..\..\Views\Job\JobParts\Resources.cshtml"
, Tuple.Create(Tuple.Create("", 3922), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
, Tuple.Create(Tuple.Create("", 3938), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 3922), false)
, 3938), false)
);
WriteLiteral(">");
@@ -602,7 +602,7 @@ WriteLiteral(" <div");
WriteLiteral(" id=\"dialogRemoveLog\"");
WriteLiteral(" class=\"hiddenDialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Remove this Comment?\"");
@@ -631,7 +631,7 @@ WriteLiteral(" <div");
WriteLiteral(" id=\"dialogUpload\"");
WriteLiteral(" class=\"hiddenDialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Upload Attachment\"");
@@ -660,7 +660,7 @@ WriteLiteral(" <div");
WriteLiteral(" id=\"dialogRemoveAttachment\"");
WriteLiteral(" class=\"hiddenDialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Remove this Attachment?\"");
@@ -866,28 +866,28 @@ WriteLiteral(@"',
#line default
#line hidden
WriteLiteral("\r\n function loadLiveComment(key) {\r\n if (key.JobId == j" +
"obId) {\r\n $.ajax({\r\n url: \'");
WriteLiteral("\r\n function loadLiveComment(key) {\r\n $.ajax({\r\n " +
" url: \'");
#line 225 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Comment()));
#line 224 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Comment()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: { id" +
": key.Id },\r\n success: function (d) {\r\n " +
" if (d && d.JobId == jobId) {\r\n");
": key },\r\n success: function (d) {\r\n " +
" if (d && d.JobId == jobId) {\r\n");
#line 230 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 229 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 230 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 229 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyLogs)
{
@@ -896,7 +896,7 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
WriteLiteral("addComment(d, false, true);");
#line 231 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 230 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canRemoveOwnLogs)
{
@@ -906,7 +906,7 @@ WriteLiteral("addComment(d, false, true);");
WriteLiteral("addComment(d, false, (d.AuthorId === \'");
#line 233 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 232 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(CurrentUser.UserId);
@@ -915,7 +915,7 @@ WriteLiteral("addComment(d, false, (d.AuthorId === \'");
WriteLiteral("\'));");
#line 233 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 232 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -925,7 +925,7 @@ WriteLiteral("\'));");
WriteLiteral("addComment(d, false, false);");
#line 235 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 234 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -934,26 +934,25 @@ WriteLiteral("addComment(d, false, false);");
WriteLiteral("\r\n }\r\n },\r\n " +
" error: function (jqXHR, textStatus, errorThrown) {\r\n " +
" alert(\'Unable to load live comment \' + id + \': \' + textStatus);\r\n " +
" }\r\n });\r\n }\r\n }\r\n " +
" function liveRemoveComment(key) {\r\n $CommentOutput.childre" +
"n(\'div[data-logid=\"\' + key + \'\"]\').slideUp(300).delay(300).queue(function () {\r\n" +
" var $this = $(this);\r\n $this.find(\'.times" +
"tamp\').livestamp(\'destroy\');\r\n $this.remove();\r\n " +
" });\r\n }\r\n function addComment(c, quick, canRemove) {\r\n " +
" var t = \'<div><span class=\"author\" />\';\r\n if (canR" +
"emove)\r\n t += \'<span class=\"remove fa fa-times-circle\" />\';\r\n" +
" t += \'<span class=\"timestamp\" /><span class=\"comment\" /></div>\';" +
"\r\n\r\n var e = $(t);\r\n e.attr(\'data-logid\', c.Id);\r\n" +
" e.find(\'.author\').text(c.Author);\r\n e.find(\'.time" +
"stamp\').text(c.TimestampFull).attr(\'title\', c.TimestampFull).livestamp(c.Timesta" +
"mpUnixEpoc);\r\n if (canRemove)\r\n e.find(\'.remov" +
"e\').click(removePost);\r\n var eComment = e.find(\'.comment\').text(c" +
".Comments);\r\n var commentHtml = eComment.text().replace(/\\r\\n|\\r|" +
"\\n/g, \'<br />\');\r\n commentHtml = commentHtml.replace(/\\#(\\d+)/g, " +
"\'<a href=\"");
" }\r\n });\r\n }\r\n function" +
" liveRemoveComment(key) {\r\n $CommentOutput.children(\'div[data-log" +
"id=\"\' + key + \'\"]\').slideUp(300).delay(300).queue(function () {\r\n " +
" var $this = $(this);\r\n $this.find(\'.timestamp\').livestam" +
"p(\'destroy\');\r\n $this.remove();\r\n });\r\n " +
" }\r\n function addComment(c, quick, canRemove) {\r\n " +
"var t = \'<div><span class=\"author\" />\';\r\n if (canRemove)\r\n " +
" t += \'<span class=\"remove fa fa-times-circle\" />\';\r\n " +
" t += \'<span class=\"timestamp\" /><span class=\"comment\" /></div>\';\r\n\r\n " +
" var e = $(t);\r\n e.attr(\'data-logid\', c.Id);\r\n " +
" e.find(\'.author\').text(c.Author);\r\n e.find(\'.timestamp\').text(c." +
"TimestampFull).attr(\'title\', c.TimestampFull).livestamp(c.TimestampUnixEpoc);\r\n " +
" if (canRemove)\r\n e.find(\'.remove\').click(remov" +
"ePost);\r\n var eComment = e.find(\'.comment\').text(c.Comments);\r\n " +
" var commentHtml = eComment.text().replace(/\\r\\n|\\r|\\n/g, \'<br />\')" +
";\r\n commentHtml = commentHtml.replace(/\\#(\\d+)/g, \'<a href=\"");
#line 266 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 264 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.Job.Show(null)));
@@ -983,14 +982,14 @@ WriteLiteral(@"?id=$1"">#$1</a>');
");
#line 287 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 285 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 288 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 286 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments)
{
@@ -1011,7 +1010,7 @@ WriteLiteral(@" <script>
var jobId = parseInt('");
#line 301 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 299 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
@@ -1022,13 +1021,13 @@ WriteLiteral("\');\r\n\r\n //#region Attachments\r\n var $
"tput\');\r\n\r\n");
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 305 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 307 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 305 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canAddAttachments)
{
@@ -1059,7 +1058,7 @@ WriteLiteral(@"
'");
#line 330 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 328 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap);
@@ -1080,7 +1079,7 @@ WriteLiteral(@"',
'UploadUrl=");
#line 342 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 340 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentUpload(Model.Job.Id, null)));
@@ -1115,7 +1114,7 @@ WriteLiteral(@"');
");
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 366 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1124,13 +1123,13 @@ WriteLiteral(@"');
WriteLiteral("\r\n");
#line 370 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 370 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 368 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments || canRemoveOwnAttachments)
{
@@ -1165,7 +1164,7 @@ WriteLiteral(@"
url: '");
#line 397 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 395 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentRemove()));
@@ -1193,36 +1192,34 @@ WriteLiteral("\',\r\n dataType: \'json\',\r\n
" }\r\n\r\n //#endregion\r\n\r\n ");
#line 430 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 428 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n function addAttachment(key, quick) {\r\n\r\n if (key.Job" +
"Id == jobId) {\r\n var data = { id: key.Id };\r\n\r\n " +
" $.ajax({\r\n url: \'");
WriteLiteral("\r\n function addAttachment(key, quick) {\r\n var data = { " +
"id: key };\r\n $.ajax({\r\n url: \'");
#line 438 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Attachment()));
#line 433 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.Attachment()));
#line default
#line hidden
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data" +
",\r\n success: function (d) {\r\n " +
"if (d.Result == \'OK\') {\r\n var a = d.Attachment;\r\n" +
"");
WriteLiteral("\',\r\n dataType: \'json\',\r\n data: data,\r\n " +
" success: function (d) {\r\n if (d.Result == " +
"\'OK\') {\r\n var a = d.Attachment;\r\n");
#line 444 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 439 "..\..\Views\Job\JobParts\Resources.cshtml"
#line default
#line hidden
#line 444 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 439 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canRemoveAnyAttachments)
{
@@ -1236,7 +1233,7 @@ WriteLiteral("buildAttachment(a, true, quick);");
WriteLiteral("\r\n");
#line 447 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 442 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canRemoveOwnAttachments)
{
@@ -1249,7 +1246,7 @@ WriteLiteral(" ");
WriteLiteral("buildAttachment(a, (a.AuthorId === \'");
#line 450 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 445 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(CurrentUser.UserId);
@@ -1260,7 +1257,7 @@ WriteLiteral("\'), quick);");
WriteLiteral("\r\n");
#line 451 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 446 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else
{
@@ -1275,7 +1272,7 @@ WriteLiteral("buildAttachment(a, false, quick);");
WriteLiteral("\r\n");
#line 455 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 450 "..\..\Views\Job\JobParts\Resources.cshtml"
}
@@ -1285,12 +1282,11 @@ WriteLiteral(@" } else {
alert('Unable to add attachment: ' + d.Result);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to add attachment: ' + textStatus);
}
});
}
}
function buildAttachment(a, canRemove, quick) {
if (parseInt(a.ParentId) == jobId) {
var t = '<a><span class=""icon""><img alt=""Attachment Thumbnail"" /></span><span class=""comments""></span><span class=""author""></span>';
@@ -1303,7 +1299,7 @@ WriteLiteral(@" } else {
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '");
#line 475 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 469 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentDownload()));
@@ -1312,7 +1308,7 @@ WriteLiteral(@" } else {
WriteLiteral("/\' + a.Id);\r\n e.find(\'.icon img\').attr(\'src\', \'");
#line 476 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 470 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Action(MVC.API.Job.AttachmentThumbnail()));
@@ -1324,36 +1320,36 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.C
"pUnixEpoc);\r\n if (canRemove)\r\n e.find(" +
"\'.remove\').click(removeLocalAttachment);\r\n if (!quick)\r\n " +
" e.hide();\r\n $attachmentOutput.append(e);\r\n" +
" if (!quick)\r\n e.show(\'slow\');\r\n " +
" if (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" e.shadowbox({ gallery: \'attachments\', player: \'img\', title: a.Commen" +
"ts });\r\n }\r\n }\r\n\r\n function removeAttachmen" +
"t(key) {\r\n if (key.JobId == jobId) {\r\n var $el" +
"ement = $attachmentOutput.find(\'a[data-attachmentid=\"\' + key.Id + \'\"]\');\r\n " +
" if ($element.length > 0) {\r\n $element.hide(" +
"300).delay(300).queue(function () {\r\n if ($element.at" +
"tr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" Shadowbox.removeCache(this);\r\n $element.re" +
"move();\r\n });\r\n }\r\n }\r\n" +
" }\r\n\r\n\r\n\r\n $attachmentOutput.children(\'a\').each(function (" +
") {\r\n $this = $(this);\r\n if ($this.attr(\'data-mime" +
"type\').toLowerCase().indexOf(\'image/\') == 0)\r\n $this.shadowbo" +
"x({ gallery: \'attachments\', player: \'img\', title: $this.find(\'.comments\').text()" +
" });\r\n });\r\n\r\n // Add Globally Available Functions\r\n " +
" document.DiscoFunctions.liveAddAttachment = addAttachment;\r\n do" +
"cument.DiscoFunctions.liveRemoveAttachment = removeAttachment;\r\n\r\n //" +
"#endregion\r\n });\r\n\r\n\r\n </script>\r\n");
" document.DiscoFunctions.liveAfterUpdate();\r\n " +
" if (!quick)\r\n e.show(\'slow\');\r\n if" +
" (a.MimeType.toLowerCase().indexOf(\'image/\') == 0)\r\n e.sh" +
"adowbox({ gallery: \'attachments\', player: \'img\', title: a.Comments });\r\n " +
" }\r\n }\r\n\r\n function removeAttachment(key) {\r\n " +
" var $element = $attachmentOutput.find(\'a[data-attachmentid=\"\' + key + " +
"\'\"]\');\r\n if ($element.length > 0) {\r\n $element" +
".hide(300).delay(300).queue(function () {\r\n if ($element." +
"attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" Shadowbox.removeCache(this);\r\n $element.remove()" +
";\r\n document.DiscoFunctions.liveAfterUpdate();\r\n " +
" });\r\n }\r\n }\r\n\r\n $attachmentOutpu" +
"t.children(\'a\').each(function () {\r\n $this = $(this);\r\n " +
" if ($this.attr(\'data-mimetype\').toLowerCase().indexOf(\'image/\') == 0)\r\n " +
" $this.shadowbox({ gallery: \'attachments\', player: \'img\', title:" +
" $this.find(\'.comments\').text() });\r\n });\r\n\r\n // Add Globa" +
"lly Available Functions\r\n document.DiscoFunctions.liveAddAttachment =" +
" addAttachment;\r\n document.DiscoFunctions.liveRemoveAttachment = remo" +
"veAttachment;\r\n\r\n //#endregion\r\n });\r\n\r\n\r\n </script>\r\n");
#line 522 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 514 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
#line 523 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs && canShowAttachments)
#line 515 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs || canShowAttachments)
{
@@ -1362,171 +1358,80 @@ WriteLiteral("/\' + a.Id);\r\n e.find(\'.comments\').text(a.C
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
#line 527 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 519 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
#line default
#line hidden
WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n function liveMessageRecieved" +
"(d) {\r\n if (d) {\r\n window.setTimeout(function " +
"() {\r\n switch (d.EntityTypeName) {\r\n " +
" case \'JobAttachment\':\r\n switch (d.EventTyp" +
"e) {\r\n case 0: // Added\r\n " +
" document.DiscoFunctions.liveAddAttachment(d.EntityKey, false" +
");\r\n break;\r\n " +
" case 1: // Removed\r\n document.Dis" +
"coFunctions.liveRemoveAttachment(d.EntityKey);\r\n " +
" break;\r\n }\r\n " +
" break;\r\n case \'JobLog\':\r\n " +
" switch (d.EventType) {\r\n case 0: // Ad" +
"ded\r\n document.DiscoFunctions.liveLoadCom" +
"ment(d.EntityKey);\r\n break;\r\n " +
" case 1: // Removed\r\n " +
" if (d.EntityKey.JobId == jobId) {\r\n " +
" document.DiscoFunctions.liveRemoveComment(d.EntityKey.Id);\r\n " +
" }\r\n break;\r\n " +
" }\r\n break;\r\n " +
" }\r\n }, 100);\r\n }\r\n }\r\n" +
" var liveMessagesConnection = $.connection(\'");
WriteLiteral("\');\r\n\r\n //#region LiveEvents\r\n var hub = $.connection.jobUp" +
"dates;\r\n\r\n // Map Functions\r\n");
#line 560 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Content("~/API/Repository/Notifications"));
#line default
#line hidden
WriteLiteral(@"', { addToGroups: 'JobLog,JobAttachment' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
");
#line 570 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canShowLogs)
#line 525 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowLogs)
{
#line default
#line hidden
WriteLiteral("\r\n hub.client.addLog = document.DiscoFunctions.liveLoadComment;\r\n " +
" hub.client.removeLog = document.DiscoFunctions.liveRemoveComment;\r\n " +
" ");
#line 529 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
#line 575 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
#line 530 "..\..\Views\Job\JobParts\Resources.cshtml"
if (canShowAttachments)
{
#line default
#line hidden
WriteLiteral(@"');
WriteLiteral(@"
hub.client.addAttachment = document.DiscoFunctions.liveAddAttachment;
hub.client.removeAttachment = document.DiscoFunctions.liveRemoveAttachment;
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveLoadComment(d.EntityKey);
break;
case 1: // Removed
if (d.EntityKey.JobId == jobId) {
document.DiscoFunctions.liveRemoveComment(d.EntityKey.Id);
}
break;
}
}, 100);
}
document.DiscoFunctions.liveAfterUpdate = function () {
var tabLink = $('#jobDetailTab-ResourcesLink');
var attachmentCount = $('#Attachments').find('.attachmentOutput').children('a').length;
var tabHeading = tabLink.text();
tabHeading = tabHeading.substr(0, tabHeading.indexOf('[') + 1) + attachmentCount + ']';
tabLink.text(tabHeading);
}
var liveMessagesConnection = $.connection('");
#line 594 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Content("~/API/Repository/Notifications"));
#line default
#line hidden
WriteLiteral(@"', { addToGroups: 'JobLog' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
");
#line 604 "..\..\Views\Job\JobParts\Resources.cshtml"
}
else if (canShowAttachments)
{
#line 543 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script>\r\n $(function () {\r\n var jobId = parseInt(\'");
WriteLiteral(@"
$.connection.hub.qs = { JobId: jobId };
$.connection.hub.error(onHubError);
#line 609 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Model.Job.Id);
// Start Connection
$.connection.hub.start().fail(onHubError);
#line default
#line hidden
WriteLiteral(@"');
//#region LiveEvents
function liveMessageRecieved(d) {
if (d) {
window.setTimeout(function () {
switch (d.EventType) {
case 0: // Added
document.DiscoFunctions.liveAddAttachment(d.EntityKey, false);
break;
case 1: // Removed
document.DiscoFunctions.liveRemoveAttachment(d.EntityKey);
break;
}
}, 100);
}
function onHubError(error) {
alert('Live-update Error: ' + error);
}
var liveMessagesConnection = $.connection('");
#line 626 "..\..\Views\Job\JobParts\Resources.cshtml"
Write(Url.Content("~/API/Repository/Notifications"));
#line default
#line hidden
WriteLiteral(@"', { addToGroups: 'JobAttachment' })
liveMessagesConnection.received(liveMessageRecieved);
liveMessagesConnection.error(function (e) {
if (e)
alert('Error: ' + JSON.stringify(e));
});
liveMessagesConnection.start();
//#endregion
});
</script>
");
#line 636 "..\..\Views\Job\JobParts\Resources.cshtml"
#line 558 "..\..\Views\Job\JobParts\Resources.cshtml"
}
#line default
#line hidden