Merge with 6.0.4

This commit is contained in:
Shannon Deminick
2013-04-20 04:01:22 +06:00
12 changed files with 886 additions and 333 deletions

View File

@@ -433,6 +433,14 @@
<DependentUpon>EditMacro.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\dialogs\Sort.aspx.cs">
<DependentUpon>sort.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\dialogs\Sort.aspx.designer.cs">
<DependentUpon>sort.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Umbraco\Dialogs\EditMacro.aspx.designer.cs">
<DependentUpon>EditMacro.aspx</DependentUpon>
</Compile>
@@ -793,6 +801,8 @@
<Content Include="Umbraco_Client\ContextMenu\Js\jquery.contextMenu.js" />
<Content Include="Umbraco_Client\Dashboards\ExamineManagement.css" />
<Content Include="Umbraco_Client\Dashboards\ExamineManagement.js" />
<Content Include="umbraco_Client\Dialogs\SortDialog.css" />
<Content Include="umbraco_client\Dialogs\SortDialog.js" />
<Content Include="Umbraco_Client\Dialogs\AssignDomain2.js" />
<Content Include="Umbraco_Client\Dialogs\AssignDomain2.css" />
<Content Include="Umbraco_Client\Dialogs\CreateDialog.css" />
@@ -817,6 +827,9 @@
<Content Include="Umbraco_Client\Installer\Images\pbar.gif" />
<Content Include="Umbraco_Client\Installer\Js\PackageInstaller.js" />
<Content Include="Umbraco_Client\Splitbutton\InsertMacroSplitButton.js" />
<Content Include="umbraco_Client\tablesorting\img\asc.gif" />
<Content Include="umbraco_Client\tablesorting\img\desc.gif" />
<Content Include="umbraco_Client\tablesorting\jquery.tablesorter.min.js" />
<Content Include="Umbraco_Client\Splitbutton\jquery.splitbutton.js" />
<Content Include="Umbraco_Client\Tablesorting\Img\asc.gif" />
<Content Include="Umbraco_Client\Tablesorting\Img\desc.gif" />

View File

@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace Umbraco.Web.UI.Umbraco.Dialogs
{
public partial class Sort : global::umbraco.cms.presentation.sort
{
}
}

View File

@@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Web.UI.Umbraco.Dialogs {
public partial class Sort {
/// <summary>
/// CssInclude1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.CssInclude CssInclude1;
/// <summary>
/// JsInclude3 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::ClientDependency.Core.Controls.JsInclude JsInclude3;
}
}

View File

@@ -1,135 +1,81 @@
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master"Codebehind="sort.aspx.cs" AutoEventWireup="True" Inherits="umbraco.cms.presentation.sort" %>
<%@ Page Language="c#" MasterPageFile="../masterpages/umbracoDialog.Master" CodeBehind="sort.aspx.cs" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Umbraco.Dialogs.Sort" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="Umbraco.Core.IO" %>
<%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %>
<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %>
<asp:Content ContentPlaceHolderID="head" runat="server">
<style type="text/css">
#sortableFrame{height: 270px; overflow: auto; border: 1px solid #ccc;}
#sortableNodes{padding: 4px; display: block}
#sortableNodes thead tr th{border-bottom:1px solid #ccc; padding: 4px; padding-right: 25px;
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/bg.gif);
cursor: pointer;
font-weight: bold;
background-repeat: no-repeat;
background-position: center right;
}
#sortableNodes thead tr th.headerSortDown {
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/desc.gif);
}
#sortableNodes thead tr th.headerSortUp {
background-image: url(<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco_client) %>/tableSorting/img/asc.gif);
}
#sortableNodes tbody tr td{border-bottom:1px solid #efefef}
#sortableNodes td{padding: 4px; cursor: move;}
tr.tDnD_whileDrag , tr.tDnD_whileDrag td{background:#dcecf3; border-color: #a8d8eb !Important; margin-top: 20px;}
#sortableNodes .nowrap{white-space: nowrap; }
</style>
<umb:CssInclude ID="CssInclude1" runat="server" FilePath="Dialogs/SortDialog.css" PathNameAlias="UmbracoClient"></umb:CssInclude>
</asp:Content>
<asp:Content ContentPlaceHolderID="body" runat="server">
<umb:JsInclude ID="JsInclude3" runat="server" FilePath="Dialogs/SortDialog.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="tablesorting/jquery.tablesorter.min.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="tablesorting/tableDragAndDrop.js" PathNameAlias="UmbracoClient" />
<umb:JsInclude ID="JsInclude1" runat="server" FilePath="tablesorting/tableFilter.js" PathNameAlias="UmbracoClient"/>
<umb:JsInclude ID="JsInclude2" runat="server" FilePath="tablesorting/tableDragAndDrop.js" PathNameAlias="UmbracoClient"/>
<div id="loading" style="display: none;">
<div class="notice">
<p><%= umbraco.ui.Text("sort", "sortPleaseWait") %></p>
</div>
<br />
<cc1:ProgressBar ID="prog1" runat="server" Title="sorting.." />
</div>
<div id="loading" style="display: none;">
<div class="notice">
<p><%= umbraco.ui.Text("sort", "sortPleaseWait") %></p>
</div>
<br />
<cc1:ProgressBar ID="prog1" runat="server" Title="sorting.." />
</div>
<div id="sortingDone" style="display: none;" class="success">
<p>
<asp:Literal runat="server" ID="sortDone"></asp:Literal></p>
<p>
<a href="#" onclick="UmbClientMgr.closeModalWindow()"><%= umbraco.ui.Text("defaultdialogs", "closeThisWindow")%></a>
</p>
</div>
<div id="sortingDone" style="display: none;" class="success">
<p><asp:Literal runat="server" ID="sortDone"></asp:Literal></p>
<p>
<a href="#" onclick="UmbClientMgr.closeModalWindow()"><%= umbraco.ui.Text("defaultdialogs", "closeThisWindow")%></a>
</p>
</div>
<div id="sortArea">
<cc1:Pane runat="server" ID="sortPane">
<p class="help">
<%= umbraco.ui.Text("sort", "sortHelp") %>
</p>
<div id="sortArea">
<cc1:Pane runat="server" ID="sortPane">
<p class="help">
<%= umbraco.ui.Text("sort", "sortHelp") %>
</p>
<div id="sortableFrame">
<table id="sortableNodes" cellspacing="0">
<colgroup>
<col/>
<col/>
<col/>
</colgroup>
<thead>
<tr>
<th style="width: 100%">Name</th>
<th class="nowrap">Creation date</th>
<th class="nowrap">Sort order</th>
</tr>
</thead>
<tbody>
<asp:Literal ID="lt_nodes" runat="server" />
</tbody>
</table>
</div>
</cc1:Pane>
<div id="sortableFrame">
<table id="sortableNodes">
<thead>
<tr>
<th style="width: 100%">Name</th>
<th class="nowrap">Creation date</th>
<th class="nowrap">Sort order</th>
</tr>
</thead>
<tbody>
<asp:Literal ID="lt_nodes" runat="server" />
</tbody>
</table>
</div>
</cc1:Pane>
<br />
<p>
<input type="button" onclick="sort(); return false;" value="<%=umbraco.ui.Text("save") %>" />
<em> or </em><a href="#" style="color: blue" onclick="UmbClientMgr.closeModalWindow()"><%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
</p>
</div>
<script type="text/javascript">
<br />
<p>
<input id="submitButton" type="button" value="<%=umbraco.ui.Text("save") %>" />
<em>or </em><a id="closeWindowButton" href="#" style="color: blue"><%=umbraco.ui.Text("general", "cancel", this.getUser())%></a>
</p>
</div>
jQuery(document).ready(function() {
jQuery("#sortableNodes").tablesorter();
jQuery("#sortableNodes").tableDnD({containment: jQuery("#sortableFrame") } );
});
<script type="text/javascript">
jQuery(document).ready(function () {
function sort() {
var rows = jQuery('#sortableNodes tbody tr');
var sortOrder = "";
jQuery.each(rows, function() {
sortOrder += jQuery(this).attr("id").replace("node_","") + ",";
});
document.getElementById("sortingDone").style.display = 'none';
document.getElementById("sortArea").style.display = 'none';
document.getElementById("loading").style.display = 'block';
var _this = this;
$.ajax({
type: "POST",
url: "<%= umbraco.IO.IOHelper.ResolveUrl(umbraco.IO.SystemDirectories.Umbraco)%>/WebServices/NodeSorter.asmx/UpdateSortOrder?app=<%=umbraco.helper.Request("app")%>",
data: '{ "ParentId": ' + parseInt(<%=umbraco.helper.Request("ID")%>) + ', "SortOrder": "' + sortOrder + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
showConfirm();
}
var sortDialog = new Umbraco.Dialogs.SortDialog({
submitButton: jQuery("#submitButton"),
closeWindowButton : jQuery("#closeWindowButton"),
dateTimeFormat: "<%=CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern%> <%=CultureInfo.CurrentCulture.DateTimeFormat.ShortTimePattern%>",
currentId: "<%=umbraco.helper.Request("ID")%>",
serviceUrl: "<%= IOHelper.ResolveUrl(SystemDirectories.Umbraco)%>/WebServices/NodeSorter.asmx/UpdateSortOrder?app=<%=umbraco.helper.Request("app")%>"
});
}
function showConfirm() {
document.getElementById("loading").style.display = 'none';
document.getElementById("sortingDone").style.display = 'block';
UmbClientMgr.mainTree().reloadActionNode();
}
</script>
sortDialog.init();
});
</script>
</asp:Content>

View File

@@ -0,0 +1,59 @@
#sortableFrame
{
height: 270px;
overflow: auto;
border: 1px solid #ccc;
}
#sortableNodes
{
padding: 4px;
display: block;
border-spacing:0;
border-collapse:collapse;
}
#sortableNodes thead tr th
{
border-bottom: 1px solid #ccc;
padding: 4px;
padding-right: 25px;
background-image: url(../tableSorting/img/bg.gif);
cursor: pointer;
font-weight: bold;
background-repeat: no-repeat;
background-position: center right;
}
#sortableNodes thead tr th.headerSortDown
{
background-image: url(../tableSorting/img/desc.gif);
}
#sortableNodes thead tr th.headerSortUp
{
background-image: url(../tableSorting/img/asc.gif);
}
#sortableNodes tbody tr td
{
border-bottom: 1px solid #efefef;
}
#sortableNodes td
{
padding: 4px;
cursor: move;
}
tr.tDnD_whileDrag, tr.tDnD_whileDrag td
{
background: #dcecf3;
border-color: #a8d8eb !Important;
margin-top: 20px;
}
#sortableNodes .nowrap
{
white-space: nowrap;
}

View File

@@ -0,0 +1,121 @@
Umbraco.Sys.registerNamespace("Umbraco.Dialogs");
(function ($) {
Umbraco.Dialogs.SortDialog = base2.Base.extend({
//private methods/variables
_opts: null,
_setupTableSorter: function () {
//adds a custom sorter to the tablesorter based on the current cultures date/time format
$.tablesorter.addParser({
// use a unique id
id: 'cultureDateParser',
is: function(s, table, cell) {
//don't auto-detect this parser
return false;
},
format: function(s, table, cell, cellIndex) {
var c = table.config;
s = s.replace(/\-/g, "/");
//all of these basically transform the string into year-month-day since that
//is what JS understands when creating a Date object
if (c.dateFormat.indexOf("dd/MM/yyyy") == 0 || c.dateFormat.indexOf("dd-MM-yyyy") == 0) {
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3-$2-$1");
}
else if (c.dateFormat.indexOf("dd/MM/yy") == 0 || c.dateFormat.indexOf("dd-MM-yy") == 0) {
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$3-$2-$1");
}
else if (c.dateFormat.indexOf("MM/dd/yyyy") == 0 || c.dateFormat.indexOf("MM-dd-yyyy") == 0) {
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3-$1-$2");
}
else if (c.dateFormat.indexOf("MM/dd/yy") == 0 || c.dateFormat.indexOf("MM-dd-yy") == 0) {
s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$3-$1-$2");
}
return $.tablesorter.formatFloat(new Date(s).getTime());
},
// set the type to either numeric or text (text uses a natural sort function
// so it will work for everything, but numeric is faster for numbers
type: 'numeric'
});
},
_saveSort: function() {
var rows = jQuery('#sortableNodes tbody tr');
var sortOrder = "";
$.each(rows, function () {
sortOrder += $(this).attr("id").replace("node_", "") + ",";
});
document.getElementById("sortingDone").style.display = 'none';
document.getElementById("sortArea").style.display = 'none';
document.getElementById("loading").style.display = 'block';
var self = this;
$.ajax({
type: "POST",
url: self._opts.serviceUrl,
data: '{ "ParentId": ' + parseInt(self._opts.currentId) + ', "SortOrder": "' + sortOrder + '"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
self._showConfirm();
}
});
},
_showConfirm: function() {
document.getElementById("loading").style.display = 'none';
document.getElementById("sortingDone").style.display = 'block';
UmbClientMgr.mainTree().reloadActionNode();
},
// Constructor
constructor: function (opts) {
// Merge options with default
this._opts = $.extend({
// Default options go here
}, opts);
this._setupTableSorter();
},
//public methods/variables
init: function () {
var self = this;
//create the sorter
$("#sortableNodes").tablesorter({
dateFormat: self._opts.dateTimeFormat,
headers: {
0: { sorter: "text" },
1: { sorter: "cultureDateParser" }, //ensure to set our custom parser here
2: { sorter: "numeric" }
}
});
//setup the drag/drop sorting
$("#sortableNodes").tableDnD({ containment: jQuery("#sortableFrame") });
//wire up the submit button
self._opts.submitButton.click(function() {
self._saveSort();
});
//wire up the close button
self._opts.closeWindowButton.click(function () {
UmbClientMgr.closeModalWindow();
});
},
});
})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long