Made better yes/no icons

This commit is contained in:
Rick Falkvinge
2013-02-09 13:12:00 +00:00
parent a7c537f800
commit 618030c2ea
7 changed files with 92 additions and 7 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 961 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

+85 -6
View File
@@ -4,26 +4,105 @@
<script src="https://hostedscripts.falkvinge.net/easyui/jquery.easyui.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="https://hostedscripts.falkvinge.net/easyui/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="https://hostedscripts.falkvinge.net/easyui/themes/default/datagrid.css"/>
<script type="text/javascript">
function preload(arrayOfImages) {
$(arrayOfImages).each(function () {
(new Image()).src = this;
});
}
preload([
'/Images/Abstract/ajaxloader-medium.gif',
'/Images/Icons/iconshock-redcross-16px.png',
'/Images/Icons/iconshock-redcross-16px-desat.png',
'/Images/Icons/iconshock-greentick-16px.png',
'/Images/Icons/iconshock-greentick-16px-desat.png',
'/Images/Icons/iconshock-glass-16px-hot.png'
]);
$(document).ready(function () {
$('#TableAttestableCosts').datagrid(
{
onLoadSuccess: function () {
$(".LocalIconApproval").attr("src", "/Images/Icons/iconshock-greentick-16px-desat-light.png");
$(".LocalIconApproved").attr("src", "/Images/Icons/iconshock-greentick-16px.png");
$(".LocalIconApproved, .LocalIconDenied").css("display", "none");
$(".LocalIconDenial").attr("src", "/Images/Icons/iconshock-redcross-16px-desat-light.png");
$(".LocalIconApproval, .LocalIconApproved, .LocalIconDenial").css("cursor", "pointer");
$(".LocalIconApproval").mouseover(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("src", "/Images/Icons/iconshock-greentick-16px-desat.png");
}
});
$(".LocalIconApproval").mouseout(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("src", "/Images/Icons/iconshock-greentick-16px-desat-light.png");
}
});
$(".LocalIconApproval").click(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("rel", "loading");
$(this).attr("src", "/Images/Abstract/ajaxloader-medium.gif");
$("#IconDenial" + $(this).attr("baseid")).fadeTo(1000, 0.01).css("cursor","default");
$(this).fadeOut(2000, function () {
$(this).css("display", "none");
$(this).attr("src", "/Images/Icons/iconshock-greentick-16px-desat-light.png");
$(this).attr("rel", "active");
$("#IconApproved" + $(this).attr("baseid")).fadeIn(100);
alertify.success("Foo approved.");
});
}
});
$(".LocalIconApproved").click(function () {
if ($(this).attr("rel") != "loading") {
$(this).attr("rel", "loading");
$(this).attr("src", "/Images/Abstract/ajaxloader-medium.gif");
$(this).fadeOut(2000, function () {
$(this).css("display", "none");
$(this).attr("src", "/Images/Icons/iconshock-greentick-16px.png");
$(this).attr("rel", "");
$("#IconApproval" + $(this).attr("baseid")).fadeIn(100);
$("#" + $(this).attr("rel"), "");
alertify.log("Foo de-attested.");
$("#IconDenial" + $(this).attr("baseid")).fadeTo(100, 1).css("cursor", "pointer");
});
}
});
}
}
);
});
</script>
<style type="text/css">
.datagrid-row-selected,.datagrid-row-over{
background:transparent;
}
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
<h2><asp:Label runat="server" ID="LabelAttestCostsHeader" Text="Attest Costs XYZ" /></h2>
<table id="dg" class="easyui-datagrid" style="width:680px;height:400px"
<table id="TableAttestableCosts" class="easyui-datagrid" style="width:680px;height:400px"
data-options="rownumbers:false,singleSelect:false,fit:false,loading:false,selectOnCheck:true,checkOnSelect:true,url:'Json-AttestableCosts.aspx'"
idField="itemId">
<thead>
<tr>
<th data-options="field:'check',checkbox:true"></th>
<th data-options="field:'item',width:60">Item</th>
<th data-options="field:'beneficiary',width:120,sortable:true">Beneficiary</th>
<th data-options="field:'description',width:140">Description</th>
<th data-options="field:'budgetName',width:140,sortable:true">Budget</th>
<th data-options="field:'description',width:160">Description</th>
<th data-options="field:'budgetName',width:160,sortable:true">Budget</th>
<th data-options="field:'amountRequested',width:80,align:'right',sortable:true,order:'asc'">Requested</th>
<th data-options="field:'dox',width:40,align:'center'">Docs</th>
<th data-options="field:'actions',width:65,align:'center'">Action</th>
<th data-options="field:'actions',width:53,align:'center'">Action</th>
</tr>
</thead>
</table>
<asp:Button runat="server" ID="ButtonAttest" Text="Clickme"/>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PlaceHolderSide" Runat="Server">
</asp:Content>
@@ -60,7 +60,13 @@ public partial class Pages_v5_Finance_Json_AttestableCosts : System.Web.UI.Page
{
result.Append("{");
result.AppendFormat(
"\"item\":\"{0}\",\"beneficiary\":\"{1}\",\"description\":\"{2}\",\"budgetName\":\"{3}\",\"amountRequested\":\"{4:N2}\",\"itemId\":\"{5}\",\"dox\":\"<img src=\\\"foo\\\" onclick=\\\"alert('foo');\\\" />\",\"actions\":\"Y N\"",
"\"item\":\"{0}\",\"beneficiary\":\"{1}\",\"description\":\"{2}\",\"budgetName\":\"{3}\",\"amountRequested\":\"{4:N2}\",\"itemId\":\"{5}\"," +
"\"dox\":\"<img src=\\\"/Images/Icons/iconshock-glass-16px.png\\\" onmouseover=\\\"this.src='/Images/Icons/iconshock-glass-16px-hot.png';\\\" onmouseout=\\\"this.src='/Images/Icons/iconshock-glass-16px.png';\\\" onclick=\\\"alert('foo');\\\" style=\\\"cursor:pointer\\\" />\"," +
"\"actions\":\"<span style=\\\"position:relative;top:3px\\\">" +
"<img id=\\\"IconApproval{5}\\\" class=\\\"LocalIconApproval\\\" baseid=\\\"{5}\\\" height=\\\"16\\\" width=\\\"16\\\" />" +
"<img id=\\\"IconApproved{5}\\\" class=\\\"LocalIconApproved\\\" baseid=\\\"{5}\\\" height=\\\"16\\\" width=\\\"16\\\" />&nbsp;&nbsp;" +
"<img id=\\\"IconDenial{5}\\\" class=\\\"LocalIconDenial\\\" baseid=\\\"{5}\\\" height=\\\"16\\\" width=\\\"16\\\" />" +
"<img id=\\\"IconDenied{5}\\\" class=\\\"LocalIconDenied\\\" baseid=\\\"{5}\\\" height=\\\"16\\\" width=\\\"16\\\" /></span>\"",
GetGlobalResourceObject("Global", item.IdentityDisplay).ToString(), item.Beneficiary, item.Description, item.BudgetName,
item.AmountRequestedCents/100.0, item.Identity);
result.Append("},");