Deploying to test
This commit is contained in:
Binary file not shown.
|
After Width: | Height: | Size: 804 B |
@@ -24,15 +24,38 @@
|
||||
|
||||
onLoadSuccess: function () {
|
||||
$('div.datagrid').css('opacity', 1);
|
||||
|
||||
$(".IconEdit").click(function() {
|
||||
$('#divModalCover').fadeIn();
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
$('div.datagrid').css('opacity', 0.4);
|
||||
|
||||
$("#IconCloseEdit").click(function() {
|
||||
$('#divModalCover').fadeOut();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function modalShow() {
|
||||
$('#divModalCover').fadeIn();
|
||||
}
|
||||
|
||||
var currentYear = <%=DateTime.Today.Year %>;
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.IconEdit {
|
||||
cursor: pointer;
|
||||
}
|
||||
#IconCloseEdit {
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
</style>
|
||||
</asp:Content>
|
||||
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="PlaceHolderMain" Runat="Server">
|
||||
@@ -43,17 +66,27 @@
|
||||
animate="true"
|
||||
fitColumns="true"
|
||||
idField="id" treeField="accountName">
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="accountName" width="240"><asp:Literal ID="LiteralHeaderAccountName" runat="server"/>Account Name</th>
|
||||
<th field="owner" width="160" align="left">Owner</th>
|
||||
<th field="balance" width="80" align="right">Balance</th>
|
||||
<th field="budget" width="80" align="right">Budget</th>
|
||||
<th field="class" width="65" align="center">Flags</th>
|
||||
<th field="action" width="40" align="center">Edit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th field="accountName" width="240"><asp:Literal ID="LiteralHeaderAccountName" runat="server"/>Account Name</th>
|
||||
<th field="owner" width="160" align="left">Owner</th>
|
||||
<th field="balance" width="80" align="right">Balance</th>
|
||||
<th field="budget" width="80" align="right">Budget</th>
|
||||
<th field="class" width="65" align="center">Flags</th>
|
||||
<th field="action" width="40" align="center">Edit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
<div id="divModalCover" class="modalcover">
|
||||
<div class="box modal">
|
||||
<div class="content">
|
||||
<div style="float:right;margin-top: 2px;margin-right: -5px"><img id="IconCloseEdit" src="/Images/Icons/iconshock-cross-16px.png" /></div><h2>Editing account (Under Construction/Test)</h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
|
||||
|
||||
@@ -106,8 +106,10 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
grandChildren = ",\"state\":\"closed\",\"children\":[" + grandChildren + "]";
|
||||
}
|
||||
|
||||
string editString = "<img class=\\\"IconEdit\\\" src=\\\"/Images/Icons/iconshock-wrench-16px.png\\\" />";
|
||||
|
||||
childStrings.Add('{' + String.Format("\"id\":\"{0}\",\"accountName\":\"{1}\",\"owner\":\"{2}\",\"balance\":\"{3}\",\"budget\":\"{4}\"",
|
||||
|
||||
childStrings.Add('{' + String.Format("\"id\":\"{0}\",\"accountName\":\"{1}\",\"owner\":\"{2}\",\"balance\":\"{3}\",\"budget\":\"{4}\",\"action\":\"{5}\"",
|
||||
account.Identity,
|
||||
Server.HtmlEncode(JsonSanitize(account.Name)),
|
||||
ownerString,
|
||||
@@ -115,7 +117,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
|
||||
account.AccountType == FinancialAccountType.Income || account.AccountType == FinancialAccountType.Cost?
|
||||
_hashedAccounts[account.Identity].Count > 1 ? (JsonDualString(account.Identity, _treeBudgetLookup[account.Identity], _singleBudgetLookup[account.Identity])) :
|
||||
(_singleBudgetLookup[account.Identity] / 100.0).ToString("N0") :
|
||||
string.Empty
|
||||
string.Empty,
|
||||
editString
|
||||
) + grandChildren + '}');
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Some of these scripts are not in the public domain.
|
||||
|
||||
jQuery is licensed as MIT (free to use for any purpose). So is FancyBox and Alertify.
|
||||
jQuery is licensed as MIT (free to use for any purpose). So is FancyBox, Alertify, and jQuery SwitchButton.
|
||||
|
||||
SmartWizard is licensed under Creative Commons Attribution-ShareAlike.
|
||||
|
||||
|
||||
@@ -0,0 +1,302 @@
|
||||
/**
|
||||
* jquery.switchButton.js v1.0
|
||||
* jQuery iPhone-like switch button
|
||||
* @author Olivier Lance <olivier.lance@sylights.com>
|
||||
*
|
||||
* Copyright (c) Olivier Lance - released under MIT License {{{
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use,
|
||||
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following
|
||||
* conditions:
|
||||
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
* }}}
|
||||
*/
|
||||
|
||||
/*
|
||||
* Meant to be used on a <input type="checkbox">, this widget will replace the receiver element with an iPhone-style
|
||||
* switch button with two states: "on" and "off".
|
||||
* Labels of the states are customizable, as are their presence and position. The receiver element's "checked" attribute
|
||||
* is updated according to the state of the switch, so that it can be used in a <form>.
|
||||
*
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.widget("sylightsUI.switchButton", {
|
||||
|
||||
options: {
|
||||
checked: undefined, // State of the switch
|
||||
|
||||
show_labels: true, // Should we show the on and off labels?
|
||||
labels_placement: "both", // Position of the labels: "both", "left" or "right"
|
||||
on_label: "ON", // Text to be displayed when checked
|
||||
off_label: "OFF", // Text to be displayed when unchecked
|
||||
|
||||
width: 25, // Width of the button in pixels
|
||||
height: 11, // Height of the button in pixels
|
||||
button_width: 12, // Width of the sliding part in pixels
|
||||
|
||||
clear: true, // Should we insert a div with style="clear: both;" after the switch button?
|
||||
clear_after: null, // Override the element after which the clearing div should be inserted (null > right after the button)
|
||||
on_callback: undefined, //callback function that will be executed after going to on state
|
||||
off_callback: undefined //callback function that will be executed after going to off state
|
||||
},
|
||||
|
||||
_create: function() {
|
||||
// Init the switch from the checkbox if no state was specified on creation
|
||||
if (this.options.checked === undefined) {
|
||||
this.options.checked = this.element.prop("checked");
|
||||
}
|
||||
|
||||
this._initLayout();
|
||||
this._initEvents();
|
||||
},
|
||||
|
||||
_initLayout: function() {
|
||||
// Hide the receiver element
|
||||
this.element.hide();
|
||||
|
||||
// Create our objects: two labels and the button
|
||||
this.off_label = $("<span>").addClass("switch-button-label");
|
||||
this.on_label = $("<span>").addClass("switch-button-label");
|
||||
|
||||
this.button_bg = $("<div>").addClass("switch-button-background");
|
||||
this.button = $("<div>").addClass("switch-button-button");
|
||||
|
||||
// Insert the objects into the DOM
|
||||
this.off_label.insertAfter(this.element);
|
||||
this.button_bg.insertAfter(this.off_label);
|
||||
this.on_label.insertAfter(this.button_bg);
|
||||
|
||||
this.button_bg.append(this.button);
|
||||
|
||||
// Insert a clearing element after the specified element if needed
|
||||
if(this.options.clear)
|
||||
{
|
||||
if (this.options.clear_after === null) {
|
||||
this.options.clear_after = this.on_label;
|
||||
}
|
||||
$("<div>").css({
|
||||
clear: "left"
|
||||
}).insertAfter(this.options.clear_after);
|
||||
}
|
||||
|
||||
// Call refresh to update labels text and visibility
|
||||
this._refresh();
|
||||
|
||||
// Init labels and switch state
|
||||
// This will animate all checked switches to the ON position when
|
||||
// loading... this is intentional!
|
||||
this.options.checked = !this.options.checked;
|
||||
this._toggleSwitch();
|
||||
},
|
||||
|
||||
_refresh: function() {
|
||||
// Refresh labels display
|
||||
if (this.options.show_labels) {
|
||||
this.off_label.show();
|
||||
this.on_label.show();
|
||||
}
|
||||
else {
|
||||
this.off_label.hide();
|
||||
this.on_label.hide();
|
||||
}
|
||||
|
||||
// Move labels around depending on labels_placement option
|
||||
switch(this.options.labels_placement) {
|
||||
case "both":
|
||||
{
|
||||
// Don't move anything if labels are already in place
|
||||
if(this.button_bg.prev() !== this.off_label || this.button_bg.next() !== this.on_label)
|
||||
{
|
||||
// Detach labels form DOM and place them correctly
|
||||
this.off_label.detach();
|
||||
this.on_label.detach();
|
||||
this.off_label.insertBefore(this.button_bg);
|
||||
this.on_label.insertAfter(this.button_bg);
|
||||
|
||||
// Update label classes
|
||||
this.on_label.addClass(this.options.checked ? "on" : "off").removeClass(this.options.checked ? "off" : "on");
|
||||
this.off_label.addClass(this.options.checked ? "off" : "on").removeClass(this.options.checked ? "on" : "off");
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "left":
|
||||
{
|
||||
// Don't move anything if labels are already in place
|
||||
if(this.button_bg.prev() !== this.on_label || this.on_label.prev() !== this.off_label)
|
||||
{
|
||||
// Detach labels form DOM and place them correctly
|
||||
this.off_label.detach();
|
||||
this.on_label.detach();
|
||||
this.off_label.insertBefore(this.button_bg);
|
||||
this.on_label.insertBefore(this.button_bg);
|
||||
|
||||
// update label classes
|
||||
this.on_label.addClass("on").removeClass("off");
|
||||
this.off_label.addClass("off").removeClass("on");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "right":
|
||||
{
|
||||
// Don't move anything if labels are already in place
|
||||
if(this.button_bg.next() !== this.off_label || this.off_label.next() !== this.on_label)
|
||||
{
|
||||
// Detach labels form DOM and place them correctly
|
||||
this.off_label.detach();
|
||||
this.on_label.detach();
|
||||
this.off_label.insertAfter(this.button_bg);
|
||||
this.on_label.insertAfter(this.off_label);
|
||||
|
||||
// update label classes
|
||||
this.on_label.addClass("on").removeClass("off");
|
||||
this.off_label.addClass("off").removeClass("on");
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Refresh labels texts
|
||||
this.on_label.html(this.options.on_label);
|
||||
this.off_label.html(this.options.off_label);
|
||||
|
||||
// Refresh button's dimensions
|
||||
this.button_bg.width(this.options.width);
|
||||
this.button_bg.height(this.options.height);
|
||||
this.button.width(this.options.button_width);
|
||||
this.button.height(this.options.height);
|
||||
},
|
||||
|
||||
_initEvents: function() {
|
||||
var self = this;
|
||||
|
||||
// Toggle switch when the switch is clicked
|
||||
this.button_bg.click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
self._toggleSwitch();
|
||||
return false;
|
||||
});
|
||||
this.button.click(function(e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
self._toggleSwitch();
|
||||
return false;
|
||||
});
|
||||
|
||||
// Set switch value when clicking labels
|
||||
this.on_label.click(function(e) {
|
||||
if (self.options.checked && self.options.labels_placement === "both") {
|
||||
return false;
|
||||
}
|
||||
|
||||
self._toggleSwitch();
|
||||
return false;
|
||||
});
|
||||
|
||||
this.off_label.click(function(e) {
|
||||
if (!self.options.checked && self.options.labels_placement === "both") {
|
||||
return false;
|
||||
}
|
||||
|
||||
self._toggleSwitch();
|
||||
return false;
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
_setOption: function(key, value) {
|
||||
if (key === "checked") {
|
||||
this._setChecked(value);
|
||||
return;
|
||||
}
|
||||
|
||||
this.options[key] = value;
|
||||
this._refresh();
|
||||
},
|
||||
|
||||
_setChecked: function(value) {
|
||||
if (value === this.options.checked) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.options.checked = !value;
|
||||
this._toggleSwitch();
|
||||
},
|
||||
|
||||
_toggleSwitch: function() {
|
||||
this.options.checked = !this.options.checked;
|
||||
var newLeft = "";
|
||||
if (this.options.checked) {
|
||||
// Update the underlying checkbox state
|
||||
this.element.prop("checked", true);
|
||||
this.element.change();
|
||||
|
||||
var dLeft = this.options.width - this.options.button_width;
|
||||
newLeft = "+=" + dLeft;
|
||||
|
||||
// Update labels states
|
||||
if(this.options.labels_placement == "both")
|
||||
{
|
||||
this.off_label.removeClass("on").addClass("off");
|
||||
this.on_label.removeClass("off").addClass("on");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.off_label.hide();
|
||||
this.on_label.show();
|
||||
}
|
||||
this.button_bg.addClass("checked");
|
||||
//execute on state callback if its supplied
|
||||
if(typeof this.options.on_callback === 'function') this.options.on_callback.call(this);
|
||||
}
|
||||
else {
|
||||
// Update the underlying checkbox state
|
||||
this.element.prop("checked", false);
|
||||
this.element.change();
|
||||
newLeft = "-1px";
|
||||
|
||||
// Update labels states
|
||||
if(this.options.labels_placement == "both")
|
||||
{
|
||||
this.off_label.removeClass("off").addClass("on");
|
||||
this.on_label.removeClass("on").addClass("off");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.off_label.show();
|
||||
this.on_label.hide();
|
||||
}
|
||||
this.button_bg.removeClass("checked");
|
||||
//execute off state callback if its supplied
|
||||
if(typeof this.options.off_callback === 'function') this.options.off_callback.call(this);
|
||||
}
|
||||
// Animate the switch
|
||||
this.button.animate({ left: newLeft }, 250, "easeInOutCubic");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,44 @@
|
||||
.switch-button-label {
|
||||
float: left;
|
||||
|
||||
font-size: 10pt;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch-button-label.off {
|
||||
color: #adadad;
|
||||
}
|
||||
|
||||
.switch-button-label.on {
|
||||
color: #0088CC;
|
||||
}
|
||||
|
||||
.switch-button-background {
|
||||
float: left;
|
||||
position: relative;
|
||||
|
||||
background: #ccc;
|
||||
border: 1px solid #aaa;
|
||||
|
||||
margin: 1px 10px;
|
||||
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.switch-button-button {
|
||||
position: absolute;
|
||||
|
||||
left: -1px;
|
||||
top : -1px;
|
||||
|
||||
background: #FAFAFA;
|
||||
border: 1px solid #aaa;
|
||||
|
||||
-webkit-border-radius: 4px;
|
||||
-moz-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
@@ -335,6 +335,33 @@ img
|
||||
}
|
||||
|
||||
|
||||
|
||||
.modalcover {
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
z-index: 9001;
|
||||
display: none;
|
||||
background-color: rgba(0, 0, 0, 0.25);
|
||||
|
||||
}
|
||||
|
||||
.modal
|
||||
{
|
||||
position: absolute;
|
||||
top: 60px;
|
||||
height: 75%;
|
||||
width: 980px;
|
||||
box-shadow: black 0px 0px 30px 2px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* LOGINBOX */
|
||||
|
||||
body.loginpage
|
||||
|
||||
Reference in New Issue
Block a user