GIT: perform LF normalization
This commit is contained in:
@@ -1,193 +1,193 @@
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
}
|
||||
<table id="userShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.User.UserAttachments != null)
|
||||
{
|
||||
foreach (var ua in Model.User.UserAttachments)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.User.AttachmentDownload(ua.Id))" data-attachmentid="@ua.Id" data-mimetype="@ua.MimeType">
|
||||
<span class="icon" title="@ua.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id)))" /></span>
|
||||
<span class="comments" title="@ua.Comments">
|
||||
@{if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
|
||||
{ @ua.DocumentTemplate.Description}
|
||||
else
|
||||
{ @ua.Comments }}
|
||||
</span><span class="author">@ua.TechUser.ToString()</span><span class="remove"></span>
|
||||
<span class="timestamp" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.Id, null)))'
|
||||
);
|
||||
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.Attachment())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
|
||||
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.User.AttachmentDownload()))/' + a.Id);
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.User.AttachmentThumbnail()))/' + a.Id);
|
||||
e.find('.comments').text(a.Comments);
|
||||
e.find('.author').text(a.Author);
|
||||
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
e.hide();
|
||||
$attachmentOutput.append(e);
|
||||
if (!quick)
|
||||
e.show('slow');
|
||||
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
|
||||
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add attachment: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function removeAttachment() {
|
||||
$this = $(this).closest('a');
|
||||
|
||||
var data = { id: $this.attr('data-attachmentid') };
|
||||
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
|
||||
$dialogRemoveAttachment.dialog("enable");
|
||||
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
||||
"Remove": function () {
|
||||
$dialogRemoveAttachment.dialog("disable");
|
||||
$dialogRemoveAttachment.dialog("option", "buttons", null);
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.AttachmentRemove())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$this.hide(300).delay(300).queue(function () {
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
alert('Unable to remove attachment: ' + d);
|
||||
}
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to remove attachment: ' + textStatus);
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
},
|
||||
Cancel: function () {
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
|
||||
return false;
|
||||
}
|
||||
$attachmentOutput.children('a').each(function () {
|
||||
$this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
@model Disco.Web.Models.User.ShowModel
|
||||
@{
|
||||
Html.BundleDeferred("~/Style/Shadowbox");
|
||||
Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox");
|
||||
}
|
||||
<table id="userShowResources">
|
||||
<tr>
|
||||
<td id="Attachments">
|
||||
<div class="attachmentOutput">
|
||||
@if (Model.User.UserAttachments != null)
|
||||
{
|
||||
foreach (var ua in Model.User.UserAttachments)
|
||||
{
|
||||
<a href="@Url.Action(MVC.API.User.AttachmentDownload(ua.Id))" data-attachmentid="@ua.Id" data-mimetype="@ua.MimeType">
|
||||
<span class="icon" title="@ua.Filename">
|
||||
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.User.AttachmentThumbnail(ua.Id)))" /></span>
|
||||
<span class="comments" title="@ua.Comments">
|
||||
@{if (!string.IsNullOrEmpty(ua.DocumentTemplateId))
|
||||
{ @ua.DocumentTemplate.Description}
|
||||
else
|
||||
{ @ua.Comments }}
|
||||
</span><span class="author">@ua.TechUser.ToString()</span><span class="remove"></span>
|
||||
<span class="timestamp" title="@ua.Timestamp.ToFullDateTime()">@ua.Timestamp.ToFuzzy()</span>
|
||||
</a>
|
||||
}
|
||||
}
|
||||
</div>
|
||||
<div class="attachmentInput clearfix">
|
||||
<span class="action upload"></span><span class="action photo"></span>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
Shadowbox.init({
|
||||
skipSetup: true,
|
||||
modal: true
|
||||
});
|
||||
$(function () {
|
||||
if (!document.DiscoFunctions) {
|
||||
document.DiscoFunctions = {};
|
||||
}
|
||||
document.DiscoFunctions.addAttachment = addAttachment;
|
||||
|
||||
$Attachments = $('#Attachments');
|
||||
$attachmentOutput = $Attachments.find('.attachmentOutput');
|
||||
|
||||
$attachmentOutput.find('span.remove').click(removeAttachment);
|
||||
|
||||
$('#dialogUpload').dialog({ autoOpen: false,
|
||||
draggable: false,
|
||||
modal: true,
|
||||
resizable: false,
|
||||
width: 860,
|
||||
height: 550,
|
||||
close: function () {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate('/Hidden');
|
||||
}
|
||||
});
|
||||
|
||||
$('#dialogRemoveAttachment').dialog({
|
||||
resizable: false,
|
||||
height: 140,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
var onLoadNavigation = null;
|
||||
var isLoaded = null;
|
||||
Silverlight.createObject(
|
||||
'@(Links.ClientBin.Disco_Silverlight_AttachmentUpload_xap)',
|
||||
$('#silverlightHostUploadAttachment').get(0),
|
||||
'silverlightUploadAttachment',
|
||||
{ width: '840px', height: '500px', background: 'white', version: '4.0.60310.0' },
|
||||
{ onLoad: function () {
|
||||
if (onLoadNavigation) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(onLoadNavigation);
|
||||
isLoaded = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
'UploadUrl=@(Url.Action(MVC.API.User.AttachmentUpload(Model.User.Id, null)))'
|
||||
);
|
||||
|
||||
$attachmentInput = $Attachments.find('.attachmentInput');
|
||||
$attachmentInput.find('.photo').click(function () {
|
||||
showDialog('/WebCam');
|
||||
});
|
||||
$attachmentInput.find('.upload').click(function () {
|
||||
showDialog('/File');
|
||||
});
|
||||
|
||||
silverlightUploadAttachment = $('#silverlightUploadAttachment').get(0);
|
||||
function showDialog(navigationPath) {
|
||||
$('#dialogUpload').dialog('open');
|
||||
if (isLoaded) {
|
||||
silverlightUploadAttachment.content.Navigator.Navigate(navigationPath);
|
||||
} else {
|
||||
onLoadNavigation = navigationPath;
|
||||
}
|
||||
};
|
||||
function addAttachment(id, quick) {
|
||||
var data = { id: id };
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.Attachment())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d.Result == 'OK') {
|
||||
var a = d.Attachment;
|
||||
|
||||
var e = $('<a><span class="icon"><img alt="Attachment Thumbnail" /></span><span class="comments"></span><span class="author"></span><span class="remove"></span><span class="timestamp"></span></a>');
|
||||
|
||||
e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '@(Url.Action(MVC.API.User.AttachmentDownload()))/' + a.Id);
|
||||
e.find('.icon img').attr('src', '@(Url.Action(MVC.API.User.AttachmentThumbnail()))/' + a.Id);
|
||||
e.find('.comments').text(a.Comments);
|
||||
e.find('.author').text(a.Author);
|
||||
e.find('.timestamp').text(a.TimestampFuzzy).attr('title', a.TimestampFull);
|
||||
e.find('.remove').click(removeAttachment);
|
||||
if (!quick)
|
||||
e.hide();
|
||||
$attachmentOutput.append(e);
|
||||
if (!quick)
|
||||
e.show('slow');
|
||||
if (a.MimeType.toLowerCase().indexOf('image/') == 0)
|
||||
e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Comments });
|
||||
} else {
|
||||
alert('Unable to add attachment: ' + d.Result);
|
||||
}
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to add attachment: ' + textStatus);
|
||||
}
|
||||
});
|
||||
}
|
||||
function removeAttachment() {
|
||||
$this = $(this).closest('a');
|
||||
|
||||
var data = { id: $this.attr('data-attachmentid') };
|
||||
var $dialogRemoveAttachment = $('#dialogRemoveAttachment');
|
||||
$dialogRemoveAttachment.dialog("enable");
|
||||
$dialogRemoveAttachment.dialog('option', 'buttons', {
|
||||
"Remove": function () {
|
||||
$dialogRemoveAttachment.dialog("disable");
|
||||
$dialogRemoveAttachment.dialog("option", "buttons", null);
|
||||
$.ajax({
|
||||
url: '@Url.Action(MVC.API.User.AttachmentRemove())',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (d) {
|
||||
if (d == 'OK') {
|
||||
$this.hide(300).delay(300).queue(function () {
|
||||
var $this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
Shadowbox.removeCache(this);
|
||||
$this.remove();
|
||||
});
|
||||
} else {
|
||||
alert('Unable to remove attachment: ' + d);
|
||||
}
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
alert('Unable to remove attachment: ' + textStatus);
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
},
|
||||
Cancel: function () {
|
||||
$dialogRemoveAttachment.dialog("close");
|
||||
}
|
||||
});
|
||||
|
||||
$dialogRemoveAttachment.dialog('open');
|
||||
|
||||
return false;
|
||||
}
|
||||
$attachmentOutput.children('a').each(function () {
|
||||
$this = $(this);
|
||||
if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0)
|
||||
$this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() });
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div id="dialogUpload" title="Upload Attachment">
|
||||
<div id="silverlightHostUploadAttachment">
|
||||
</div>
|
||||
</div>
|
||||
<div id="dialogRemoveAttachment" title="Remove this Attachment?">
|
||||
<p>
|
||||
<span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
|
||||
Are you sure?</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user