Checkpoint commit: upgrading EasyUI to 1.4.2. Much breakage. So ouch. (not finished)

This commit is contained in:
Rick Falkvinge
2015-03-18 20:23:23 +01:00
parent b015d6f7e9
commit b56aa3a87d
13 changed files with 305 additions and 43 deletions
+5
View File
@@ -9,3 +9,8 @@ database.config*
Database.config*
Database.Config*
database.Config*
# Ignore Experimental scripts (used to evaluate/debug new versions of script packages)
Scripts/Experimental/*
+20 -17
View File
@@ -1,25 +1,28 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ComboGeographies.ascx.cs" Inherits="Swarmops.Controls.Base.ComboGeographies" %>
<%@ Import Namespace="System.Threading" %>
<script type="text/javascript">
$(document).ready(function () {
$('#<%=this.ClientID %>_DropGeographies').combotree({
animate: true,
height: 30,
onLoadSuccess: function() {
$('#<%=this.ClientID %>_DropGeographies').combotree('setText', "<%=this.RootGeographyName%>");
<%
if (!String.IsNullOrEmpty(this.OnClientLoaded))
{
Response.Write(this.OnClientLoaded + "(); ");
}%>
},
loader: function (param, success, error) {
if (!param.id) {
$.getJSON("/Automation/Json-GeographiesTree.aspx?ParentGeographyId=<%=this.ParentGeographyId%>", null, success);
} else {
$.getJSON("/Automation/Json-GeographiesTree.aspx?InitialExpand=false&ParentGeographyId=" + param.id, null, success);
}
},
animate: true,
height: 32,
panelWidth: 300,
panelAlign: '<%= Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft? "right": "left" %>',
onLoadSuccess: function () {
$('#<%=this.ClientID %>_DropGeographies').combotree('setText', "<%=this.RootGeographyName%>");
<%
if (!String.IsNullOrEmpty(this.OnClientLoaded))
{
Response.Write(this.OnClientLoaded + "(); ");
}%>
},
loader: function (param, success, error) {
if (!param.id) {
$.getJSON("/Automation/Json-GeographiesTree.aspx?ParentGeographyId=<%=this.ParentGeographyId%>", null, success);
} else {
$.getJSON("/Automation/Json-GeographiesTree.aspx?InitialExpand=false&ParentGeographyId=" + param.id, null, success);
}
},
onSelect: function (row) {
<%
if (!String.IsNullOrEmpty(this.OnClientSelect))
+5 -2
View File
@@ -1,10 +1,13 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="DropDown.ascx.cs" Inherits="Swarmops.Frontend.Controls.v5.Base.DropDown" %>
<%@ Import Namespace="System.Threading" %>
<script language="javascript" type="text/javascript">
<script language="javascript" type="text/javascript">
$(document).ready(function () {
$('#<%=this.DropControl.ClientID %>').combobox({
editable: false,
height: 30,
height: 32,
panelWidth: 300,
panelAlign: '<%= Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft? "right": "left" %>',
width: 300<%
if (!String.IsNullOrEmpty(this.OnClientChange))
{
@@ -1,11 +1,15 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ComboBudgets.ascx.cs" Inherits="Swarmops.Controls.Financial.ComboBudgets" %>
<%@ Import Namespace="System.Threading" %>
<script type="text/javascript">
$(document).ready(function () {
$('#<%= this.ClientID %>_DropBudgets').combotree({
animate: true,
height: 30,
onLoadSuccess: function () {
animate: true,
editable: false,
height: 32,
panelWidth: 300,
panelAlign: '<%= Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft? "right": "left" %>',
onLoadSuccess: function () {
<%
if (!SuppressPrompt)
{
@@ -107,4 +111,4 @@
</script>
<span id="<%=this.ClientID %>_SpanBudgets"><select class="easyui-combotree" url="<%=this.DataUrl %>" name="DropBudgets" id="<%=this.ClientID %>_DropBudgets" animate="true" style="width:300px"></select></span>
<span id="<%=this.ClientID %>_SpanBudgets"><select class="easyui-combotree" url="<%=this.DataUrl %>" name="DropBudgets" id="<%=this.ClientID %>_DropBudgets" animate="true" style="width:324px"></select></span>
@@ -40,7 +40,7 @@ namespace Swarmops.Controls.Financial
protected void Page_Init (object sender, EventArgs e)
{
((PageV5Base) this.Page).RegisterControl (EasyUIControl.Tree);
((PageV5Base) this.Page).RegisterControl (EasyUIControl.Tree | EasyUIControl.Combo | EasyUIControl.ComboBox);
}
protected void Page_Load (object sender, EventArgs e)
+5 -2
View File
@@ -1,10 +1,13 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ComboPeople.ascx.cs" Inherits="Swarmops.Controls.Financial.ComboPeople" %>
<%@ Import Namespace="System.Threading" %>
<script type="text/javascript">
$(document).ready(function () {
$('#<%=this.ClientID %>_DropPeople').combobox({
animate: true,
height: 30,
height: 32,
panelWidth: 300,
panelAlign: '<%= Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft? "right": "left" %>',
loader: <%=this.ClientID %>_autoCompleteLoader,
mode: 'remote',
valueField: 'id',
@@ -96,4 +99,4 @@
}
</script>
<span id="<%=this.ClientID %>_SpanPeople" class="fakePlaceholderText"><select class="easyui-combobox comboperson" url="" name="DropPeople" id="<%=this.ClientID %>_DropPeople" animate="true" style="width:300px"></select></span>
<span id="<%=this.ClientID %>_SpanPeople" class="fakePlaceholderText"><select class="easyui-combobox comboperson" url="" name="DropPeople" id="<%=this.ClientID %>_DropPeople" animate="true" style="width:324px"></select></span>
+25 -4
View File
@@ -2,6 +2,7 @@
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Threading;
using System.Web.UI;
using Swarmops.Logic.Support;
@@ -28,15 +29,35 @@ namespace Swarmops.Frontend.Controls.v5.UI
// use staging area for new script versions on Sandbox and for all debugging
}
// If we're debugging a seriously experimental new version of JEasyUI, look for it in /Scripts/Experimental
// (a folder which doesn't commit to the github repo)
if (File.Exists (Server.MapPath ("~/Scripts/Experimental/easyui/jquery.easyui.min.js")))
{
externalScriptUrl = "/Scripts/Experimental";
}
if (Package == "easyui")
{
StringBuilder scriptRef = new StringBuilder();
scriptRef.Append ("<script src=\"" + externalScriptUrl +
scriptRef.Append("<script src=\"" + externalScriptUrl +
"/easyui/jquery.easyui.min.js\" type=\"text/javascript\"></script>\r\n");
scriptRef.Append ("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/icon.css\" />\r\n");
string[] controlNames = Controls.Split (',');
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/themes/default/easyui.css\" />\r\n"); // Supposed to contain all CSS
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
{
scriptRef.Append("<script src=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.js\" type=\"text/javascript\"></script>\r\n");
scriptRef.Append("<link rel=\"stylesheet\" type=\"text/css\" href=\"" + externalScriptUrl +
"/easyui/extensions/easyui-rtl.css\" />\r\n");
}
/* -- with the inclusion of the catchall CSS file, this code _should_ no longer be necessary...
string[] controlNames = Controls.Split(',');
foreach (string controlName in controlNames)
{
string controlNameLower = controlName.Trim().ToLowerInvariant();
@@ -47,7 +68,7 @@ namespace Swarmops.Frontend.Controls.v5.UI
"/easyui/themes/default/{0}.css\" />\r\n",
controlNameLower);
}
}
}*/
this.LiteralReference.Text = scriptRef.ToString();
}
+2 -2
View File
@@ -41,7 +41,7 @@
<!-- external packages that are commonly used (on practically all pages) -->
<Swarmops5:ExternalScripts ID="ExternalScriptEasyUI" Package="easyui" runat="server" />
<link href="/Style/v5-easyui-elements.css" rel="stylesheet" type="text/css" />
<link href="/Style/v5-easyui-overrides.css" rel="stylesheet" type="text/css" />
<!-- additional scripts etc from individual pages -->
<Swarmops5:IncludedScripts ID="IncludedScripts" runat="server" />
@@ -118,7 +118,7 @@
</script>
</head>
<body class='<asp:Literal ID="LiteralBodyClass" runat="server" />'>
<body <asp:Literal ID="LiteralBodyAttributes" runat="server" />>
<form id="form1" runat="server">
<script type="text/javascript">
//Put your JavaScript code here.
+1 -1
View File
@@ -168,7 +168,7 @@ namespace Swarmops
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
{
this.LiteralBodyClass.Text = "rtl";
this.LiteralBodyAttributes.Text = @"dir='rtl' class='rtl'";
}
// If we're running as an open-something identity, remove the Preferences div
+2 -2
View File
@@ -521,12 +521,12 @@
});
}
ac
function onAccountTreeLoaded() {
var accountTree = $('#<%=DropParents.ClientID %>_DropBudgets');
// accountTree.combotree('select', 0); // clear any previous selection
accountTreeLoaded = true;
if (parentAccountName.length > 0) {
if (parentAccountName != null && parentAccountName.length > 0) {
accountTree.combotree('setText', parentAccountName);
$('span#<%= DropParents.ClientID %>_SpanBudgets span input.combo-text').css('background-color', '#FFF');
}
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
using Resources;
using Swarmops.Common.Enums;
using Swarmops.Logic.Financial;
@@ -21,6 +22,8 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
private int _year = 2012;
private int _resultAccountId;
private string _nearEdge;
protected void Page_Load (object sender, EventArgs e)
{
this._authenticationData = GetAuthenticationDataAndCulture();
@@ -37,6 +40,13 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
Response.ContentType = "application/json";
_nearEdge = "left";
if (Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft)
{
_nearEdge = "right";
}
string response = string.Empty;
PopulateLookups (FinancialAccounts.ForOrganization (this._authenticationData.CurrentOrganization));
@@ -120,7 +130,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
// TODO: add zoom, write capability
ownerString =
"<span style=\\\"padding-left:20px;background-repeat:no-repeat;background-image:url('" +
"<span style=\\\"padding-" + _nearEdge + ":20px;background-repeat:no-repeat;background-position:center " + _nearEdge + ";background-image:url('" +
account.Owner.GetSecureAvatarLink (16) + "')\\\">" +
JsonSanitize (Server.HtmlEncode (account.Owner.Canonical)) + "</span>";
}
@@ -129,7 +139,7 @@ namespace Swarmops.Frontend.Pages.v5.Ledgers
// TODO: add write capability
ownerString =
"<span style=\\\"padding-left:20px;background-repeat:no-repeat;background-position:center left;background-image:url('/Images/Icons/iconshock-warning-16x12px.png')\\\">" +
"<span style=\\\"padding-" + _nearEdge + ":20px;background-repeat:no-repeat;background-position:center " + _nearEdge + ";background-image:url('/Images/Icons/iconshock-warning-16x12px.png')\\\">" +
JsonSanitize (Server.HtmlEncode (Global.Global_NoOwner)) + "</span>";
}
}
+8 -6
View File
@@ -389,7 +389,7 @@ body.rtl .sidebar {
}
body.rtl .modalIconClose, body.rtl #fancybox-close {
right: inherit !important;
right: initial !important;
left: -15px !important;
}
@@ -639,10 +639,12 @@ body.rtl .entryFields {
.entryFields input, .entryFields textarea, .entryFields select
{
border-radius: 10px;
padding: 0px 10px 0px 10px;
font-size: 24px;
margin-bottom: 3px;
/* "important" here overrides the easyUI native styling */
border-radius: 10px !important;
padding: 0px 10px 0px 10px !important;
font-size: 24px !important;
margin-bottom: 3px !important;
}
.entryFields input:not(.buttonAccentColor), .entryFields textarea
@@ -824,7 +826,7 @@ input[type="radio"] {
margin-left: 5px;
}
label {
div.content > p > label {
margin-left: 10px;
font-size: 120%;
font-weight: 500;
+211
View File
@@ -0,0 +1,211 @@
/* COMBO BOX */
/* combo outer span, make transparent and remove border to display downarrow beside text field */
span.textbox.combo {
border: none;
background: transparent;
}
/* combo inner, add input field attributes */
.textbox .textbox-text {
border: 2px inset;
}
/* combo inner, add some distance to dropdown arrow */
span.textbox.combo > .textbox-text {
width: 278px !important;
}
.combo-arrow {
position: relative;
top: 7px;
width: 18px !important;
height: 19px !important;
border-radius: 5px;
background: #FFFFFF url('/Images/Abstract/easyui-elements-downarrow.gif') no-repeat 3px 4px;
}
/* RTL fixes for combo */
.combo-panel
{
font-size: 14px;
margin: 0px 0px 0px 5px;
padding-top: 8px;
list-style-type: none;
background: white;
border-radius: 8px;
border: none;
box-shadow: 0px 1px 4px 1px #1C397E inset, 0 1px 4px 1px #1c397e;
overflow:auto;
overflow-x: hidden;
}
.combo-panel > .combobox-item {
font-weight: lighter;
}
.combo-panel > .combobox-item-selected {
font-weight: 400;
border-top: 1px solid #c8d9ff;
border-bottom: 1px solid #c8d9ff;
background: #e4ecff;
}
.combo-panel > .treenode-item-selected {
background: #e4ecff;
}
.combo-panel > ul.tree > li > div.tree-node:first-child {
padding-left: 4px;
}
div.combobox-item {
cursor: pointer;
}
div.combo-p.panel {
overflow: visible;
}
/*,
border-radius: 10px;
border: 2px inset;
}*/
/*
.combo{
display:inline-block;
white-space:nowrap;
font-size:12px;
margin:0;
padding:0;
background:transparent;
}
.combo-text{
_font-size:12px;
_border:0px;
_line-height:20px;
_height:20px;
_padding:0px;
_height:18px;
_line-height:18px;
}
.combo-arrow{
background:#FFFFFF url('/Images/Abstract/easyui-elements-downarrow.gif') no-repeat 3px 4px;
width:18px;
height:20px !important;
overflow:hidden;
display:inline-block;
vertical-align:top;
position: relative;
top: 8px;
left: 3px;
border-radius: 5px;
cursor:pointer;
opacity:0.4;
filter:alpha(opacity=40);
}
body.rtl .combo-arrow {
left: inherit;
right: 3px;
}
.content h2 span span.combo {
padding-left: 4px !important;
padding-top: 0;
border: 1px solid #cccccc;
border-radius: 4px;
box-shadow: 0 0 3px 0 #dddddd inset;
cursor: default;
}
.content h2 span span.combo:hover {
border: 1px solid #aaaaaa;
box-shadow: 0 0 3px 0 #bbbbbb inset;
}
.content > h2 > span > span.combo > input.combo-text {
height: 20px !important;
line-height: 20px !important;
border: 0 !important;
}
.content h2 span span.combo span span.combo-arrow{
top: 0px !important;
left: 0px !important;
}
.combo-arrow-hover{
opacity:0.7;
filter:alpha(opacity=70);
}
.tree
{
}
.tree-node-hover, .tree-node-selected{
background: #E4ECFF;
box-shadow: 0px 0px 4px 1px #C8D9FF inset;
}
.tree-icon.tree-folder.countryNode {
display: none;
}
.tabs-header {
background: transparent;
border: none;
padding-top: 0;
}
.tabs {
padding: 0;
padding-top: 2px;
border-color: #CCC;
}
.tabs-panels {
border: none;
padding-top: 5px;
}
.tabs li a.tabs-inner {
width: 64px !important;
padding: 0;
padding-left: 2px;
padding-right: 2px;
border: none;
border-radius: 5px;
background: transparent;
border-right: 1px solid #DDD;
margin-right: 5px;
}
*/