diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 2f5ccf8bec..08d431fad6 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -180,14 +180,6 @@ ChangeDocType.aspx - - sort.aspx - ASPXCodeBehind - - - sort.aspx - ASPXCodeBehind - default.Master ASPXCodeBehind @@ -348,8 +340,6 @@ ASPXCodeBehind - - @@ -487,7 +477,6 @@ Form - diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.cs b/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.cs deleted file mode 100644 index 11f155f047..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.cs +++ /dev/null @@ -1,11 +0,0 @@ -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 - { - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.designer.cs b/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.designer.cs deleted file mode 100644 index fb4bea6b1a..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/Sort.aspx.designer.cs +++ /dev/null @@ -1,33 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Umbraco.Web.UI.Umbraco.Dialogs { - - - public partial class Sort { - - /// - /// CssInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.CssInclude CssInclude1; - - /// - /// JsInclude3 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude3; - } -} diff --git a/src/Umbraco.Web.UI/Umbraco/dialogs/sort.aspx b/src/Umbraco.Web.UI/Umbraco/dialogs/sort.aspx deleted file mode 100644 index f4200e113c..0000000000 --- a/src/Umbraco.Web.UI/Umbraco/dialogs/sort.aspx +++ /dev/null @@ -1,86 +0,0 @@ -<%@ 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" %> -<%@ Import Namespace="Umbraco.Web" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> -<%@ Register TagPrefix="cc1" Namespace="Umbraco.Web._Legacy.Controls" Assembly="Umbraco.Web" %> - - - - - - - - - - - - - - - - - <%= Services.TextService.Localize("sort/sortPleaseWait") %> - - - - - - - - - - - - - <%= Services.TextService.Localize("defaultdialogs/closeThisWindow")%> - - - - - - <%= Services.TextService.Localize("sort/sortHelp") %> - - - - - - - <%= Services.TextService.Localize("general/name") %> - ;"><%= Services.TextService.Localize("sort/sortCreationDate") %> - <%= Services.TextService.Localize("sort/sortOrder") %> - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.css b/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.css deleted file mode 100644 index a562e4475e..0000000000 --- a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.css +++ /dev/null @@ -1,58 +0,0 @@ -#sortableFrame -{ - height: auto; - overflow: auto; -} - -#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; -} diff --git a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js b/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js deleted file mode 100644 index da5ae6d61e..0000000000 --- a/src/Umbraco.Web.UI/umbraco_client/Dialogs/SortDialog.js +++ /dev/null @@ -1,122 +0,0 @@ -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() { - //don't auto-detect this parser - return false; - }, - format: function(s, table) { - 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 || 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 || 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 = $('#sortableNodes tbody tr'); - var sortOrder = ""; - - $.each(rows, function () { - sortOrder += $(this).attr("id").replace("node_", "") + ","; - }); - - $("#sortingDone").hide(); - $("#sortArea").hide(); - $("#loading").show(); - - var self = this; - - $.ajax({ - type: "POST", - url: self._opts.serviceUrl, - data: '{ "ParentId": "' + self._opts.currentId + '", "SortOrder": "' + sortOrder + '"}', - contentType: "application/json; charset=utf-8", - dataType: "json", - success: function(msg) { - self._showConfirm(); - } - }); - }, - - _showConfirm: function () { - $(".umb-dialog-footer").hide(); - $("#loading").hide(); - $("#sortingDone").show(); - 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: $("#sortableFrame") }); - - //wire up the submit button - self._opts.submitButton.click(function() { - this.disabled = true; - self._saveSort(); - }); - - //wire up the close button - self._opts.closeWindowButton.click(function () { - UmbClientMgr.closeModalWindow(); - }); - }, - - }); - - - -})(jQuery); diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 427c7fdd66..b1d950cc1f 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1130,9 +1130,6 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs deleted file mode 100644 index f85114aaec..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/dialogs/sort.aspx.cs +++ /dev/null @@ -1,265 +0,0 @@ -using System; -using System.Linq; -using Umbraco.Core; -using Umbraco.Core.Services; -using Umbraco.Web; -using System.Web.UI; -using System.Collections.Generic; -using Umbraco.Web.Composing; -using Umbraco.Web.UI.Pages; -using Umbraco.Core.Exceptions; -using Umbraco.Core.Models; -using Umbraco.Web._Legacy.Actions; - -namespace umbraco.cms.presentation -{ - /// - /// Summary description for sort. - /// - public partial class sort : UmbracoEnsuredPage - { - /// - /// The Parent Id being sorted - /// - protected int? ParentIdAsInt { get; private set; } - protected string ParentIdAsString { get; private set; } - - private readonly List _nodes = new List(); - - protected bool HideDateColumn - { - set { ViewState["HideDateColumn"] = value; } - get { return ViewState["HideDateColumn"] == null ? false : (bool) ViewState["HideDateColumn"]; } - } - - protected override void OnInit(EventArgs e) - { - CurrentApp = Request.GetItemAsString("app"); - - ParentIdAsString = Request.GetItemAsString("ID"); - int parentId; - if (int.TryParse(ParentIdAsString, out parentId)) - { - ParentIdAsInt = parentId; - - if (CurrentApp == Constants.Applications.Content || CurrentApp == Constants.Applications.Media) - { - CheckPathAndPermissions( - ParentIdAsInt.Value, - CurrentApp == Constants.Applications.Content ? UmbracoObjectTypes.Document : UmbracoObjectTypes.Media, - ActionSort.Instance); - } - } - - base.OnInit(e); - } - - protected void Page_Load(object sender, EventArgs e) - { - sortDone.Text = Services.TextService.Localize("sort/sortDone"); - } - protected override void OnPreRender(EventArgs e) - { - base.OnPreRender(e); - - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/nodesorter.asmx")); - ScriptManager.GetCurrent(Page).Services.Add(new ServiceReference("../webservices/legacyAjaxCalls.asmx")); - - var app = Request.GetItemAsString("app"); - - var icon = "../images/umbraco/doc.gif"; - - if (ParentIdAsInt.HasValue) - { - if (app == Constants.Applications.Media) - { - icon = "../images/umbraco/mediaPhoto.gif"; - var mediaService = Current.Services.MediaService; - - if (ParentIdAsInt.Value == -1) - { - foreach (var child in mediaService.GetRootMedia().ToList().OrderBy(x => x.SortOrder)) - _nodes.Add(CreateNode(child.Id.ToInvariantString(), child.SortOrder, child.Name, child.CreateDate, icon)); - } - else - { - var children = mediaService.GetChildren(ParentIdAsInt.Value); - foreach (var child in children.OrderBy(x => x.SortOrder)) - _nodes.Add(CreateNode(child.Id.ToInvariantString(), child.SortOrder, child.Name, child.CreateDate, icon)); - } - } - - if (app == Constants.Applications.Content) - { - var contentService = Current.Services.ContentService; - - if (ParentIdAsInt.Value == -1) - { - foreach (var child in contentService.GetRootContent().ToList().OrderBy(x => x.SortOrder)) - _nodes.Add(CreateNode(child.Id.ToInvariantString(), child.SortOrder, child.Name, child.CreateDate, icon)); - } - else - { - var children = contentService.GetChildren(ParentIdAsInt.Value); - foreach (var child in children) - _nodes.Add(CreateNode(child.Id.ToInvariantString(), child.SortOrder, child.Name, child.CreateDate, icon)); - } - } - - bindNodesToList(string.Empty); - } - else - { - // hack for stylesheet, used to sort stylesheet properties - if (app == Constants.Applications.Settings) - { - icon = "../images/umbraco/settingCss.gif"; - - HideDateColumn = true; - - var stylesheetName = ParentIdAsString; - if (stylesheetName.IsNullOrWhiteSpace())throw new NullReferenceException("No Id passed in to editor"); - var stylesheet = Services.FileService.GetStylesheetByName(stylesheetName.EnsureEndsWith(".css")); - if (stylesheet == null) throw new InvalidOperationException("No stylesheet found by name " + stylesheetName); - - var sort = 0; - foreach (var child in stylesheet.Properties) - { - _nodes.Add(CreateNode(child.Name, sort, child.Name, DateTime.Now, icon)); - sort++; - } - - bindNodesToList(string.Empty); - } - } - } - - public void bindNodesToList(string sortBy) - { - if (string.IsNullOrEmpty(sortBy) == false) - { - switch (sortBy) - { - case "nodeName": - _nodes.Sort(new nodeNameCompare()); - break; - case "createDate": - _nodes.Sort(new createDateCompare()); - break; - } - } - - foreach (var n in _nodes) - lt_nodes.Text += string.Format( - "{1}{2} {3}{4}", - n.id, n.Name, n.createDate.ToShortDateString(), n.createDate.ToShortTimeString(), n.sortOrder, HideDateColumn ? "none" : "table-cell"); - } - - private static SortableNode CreateNode(string id, int sortOrder, string name, DateTime createDateTime, string icon) - { - var node = new SortableNode - { - id = id, - sortOrder = sortOrder, - Name = name, - icon = icon, - createDate = createDateTime - }; - return node; - } - - public class SortableNode - { - public string id; - public int sortOrder; - public string Name; - public string icon; - public DateTime createDate; - } - - /// - /// JsInclude1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude1; - - /// - /// JsInclude2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::ClientDependency.Core.Controls.JsInclude JsInclude2; - - /// - /// prog1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.ProgressBar prog1; - - /// - /// sortDone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal sortDone; - - /// - /// sortPane control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::Umbraco.Web._Legacy.Controls.Pane sortPane; - - /// - /// lt_nodes control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal lt_nodes; - - } - - public class nodeNameCompare : IComparer - { - - #region IComparer Members - - public int Compare(sort.SortableNode x, sort.SortableNode y) - { - var returnValue = String.Compare(x.Name, y.Name, StringComparison.Ordinal); - - return returnValue; - } - - #endregion - } - - public class createDateCompare : IComparer - { - - #region IComparer Members - - public int Compare(sort.SortableNode x, sort.SortableNode y) - { - var returnValue = x.createDate.CompareTo(y.createDate); - - return returnValue; - } - - #endregion - } -}
<%= Services.TextService.Localize("sort/sortPleaseWait") %>
- -
- <%= Services.TextService.Localize("defaultdialogs/closeThisWindow")%> -
- <%= Services.TextService.Localize("sort/sortHelp") %> -