mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-11-28 17:32:44 +08:00
Merge
--HG-- branch : dev
This commit is contained in:
@@ -226,12 +226,13 @@
|
||||
if (!shapeId) {
|
||||
// remove selection ?
|
||||
shapeTracingOverlay.hide();
|
||||
$('.shape-tracing-selected').removeClass('shape-tracing-selected');
|
||||
shapeTracingWindowTree.find('.shape-tracing-selected').removeClass('shape-tracing-selected');
|
||||
$('[shape-id-meta]:visible').toggle(false);
|
||||
return;
|
||||
}
|
||||
|
||||
shapeTracingWindowTree.find('.shape-tracing-selected').removeClass('shape-tracing-selected');
|
||||
$('.shape-tracing-selected').removeClass('shape-tracing-selected');
|
||||
$('li[tree-shape-id="' + shapeId + '"] > div').add('[shape-id="' + shapeId + '"]').addClass('shape-tracing-selected');
|
||||
shapeTracingOverlay.hide();
|
||||
|
||||
@@ -359,7 +360,7 @@
|
||||
_this.addClass('shape-tracing-selected');
|
||||
|
||||
// display breadcrumb
|
||||
var breadcrumb;
|
||||
var breadcrumb = null;
|
||||
_this.parentsUntil('.model').children('.name').each(function () {
|
||||
if (breadcrumb != null) {
|
||||
breadcrumb = $(this).text() + '.' + breadcrumb;
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Reflection;
|
||||
using System.Xml.Linq;
|
||||
using ClaySharp;
|
||||
using ClaySharp.Behaviors;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.DisplayManagement;
|
||||
|
||||
namespace Orchard.DesignerTools.Services {
|
||||
@@ -70,7 +71,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
private void DumpObject(object o, string name) {
|
||||
_node.Add(
|
||||
new XElement("div", new XAttribute("class", "name"), name),
|
||||
new XElement("div", new XAttribute("class", "type"), FormatType(o.GetType()))
|
||||
new XElement("div", new XAttribute("class", "type"), FormatType(o))
|
||||
);
|
||||
|
||||
if (_parents.Count >= _levels) {
|
||||
@@ -88,7 +89,8 @@ namespace Orchard.DesignerTools.Services {
|
||||
DumpEnumerable((IEnumerable) o);
|
||||
}
|
||||
}
|
||||
else if (o is IEnumerable) {
|
||||
else if (o is IEnumerable)
|
||||
{
|
||||
DumpEnumerable((IEnumerable)o);
|
||||
}
|
||||
else {
|
||||
@@ -109,12 +111,24 @@ namespace Orchard.DesignerTools.Services {
|
||||
|
||||
_node.Add(_node = new XElement("ul"));
|
||||
foreach (var member in members) {
|
||||
if (o is ContentItem && member.Name == "ContentManager") {
|
||||
// ignore Content Manager explicitly
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
DumpMember(o, member);
|
||||
}
|
||||
catch {
|
||||
}
|
||||
}
|
||||
|
||||
if (o is ContentItem) {
|
||||
foreach(var part in ((ContentItem)o).Parts) {
|
||||
Dump(part, part.PartDefinition.Name);
|
||||
}
|
||||
}
|
||||
|
||||
_node = _node.Parent;
|
||||
}
|
||||
|
||||
@@ -212,17 +226,21 @@ namespace Orchard.DesignerTools.Services {
|
||||
return formatted;
|
||||
}
|
||||
|
||||
private static string FormatType(Type t) {
|
||||
if(t.IsGenericType) {
|
||||
var genericArguments = String.Join(", ", t.GetGenericArguments().Select(FormatType).ToArray());
|
||||
return String.Format("{0}<{1}>", t.Name.Substring(0, t.Name.IndexOf('`')), genericArguments);
|
||||
private static string FormatType(object item) {
|
||||
if(item is IShape) {
|
||||
return ((IShape)item).Metadata.Type + " Shape";
|
||||
}
|
||||
|
||||
if(typeof(IShape).IsAssignableFrom(t)) {
|
||||
return "Shape";
|
||||
}
|
||||
return FormatType(item.GetType());
|
||||
}
|
||||
|
||||
return t.Name;
|
||||
private static string FormatType(Type type) {
|
||||
if (type.IsGenericType) {
|
||||
var genericArguments = String.Join(", ", type.GetGenericArguments().Select(t => FormatType((Type)t)).ToArray());
|
||||
return String.Format("{0}<{1}>", type.Name.Substring(0, type.Name.IndexOf('`')), genericArguments);
|
||||
}
|
||||
|
||||
return type.Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ namespace Orchard.DesignerTools.Services {
|
||||
var dumper = new ObjectDumper(6);
|
||||
var el = dumper.Dump(context.Shape, "Model");
|
||||
using (var sw = new StringWriter()) {
|
||||
el.WriteTo(new XmlTextWriter(sw) {Formatting = Formatting.Indented});
|
||||
el.WriteTo(new XmlTextWriter(sw) {Formatting = Formatting.None});
|
||||
context.Shape._Dump = sw.ToString();
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
}
|
||||
|
||||
#shape-tracing-container .shape-tracing-meta-content {
|
||||
padding:0 0 0 30px;
|
||||
padding:0 0 30px 30px;
|
||||
margin:8px 0 0 0;
|
||||
border:1px solid #E4E5E6;
|
||||
}
|
||||
@@ -201,15 +201,18 @@
|
||||
font-size:15px;
|
||||
line-height:32px;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .shape-tracing-tabs li {
|
||||
margin:0 2px;
|
||||
padding: 8px 18px 7px 18px;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .shape-tracing-tabs li.middle, #shape-tracing-window-content .shape-tracing-tabs li.first, #shape-tracing-window-content .shape-tracing-tabs li.last {
|
||||
border:1px solid #E4E5E6;
|
||||
border-bottom:none;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .shape-tracing-tabs li.first {
|
||||
margin-left:16px;
|
||||
}
|
||||
@@ -223,29 +226,30 @@
|
||||
color: #3A822E;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .model ul ul {
|
||||
#shape-tracing-window-content .grid-display {
|
||||
position:relative;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .grid-display li {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .grid-display ul ul {
|
||||
margin:0 0 0 18px;
|
||||
padding:0 0 0 10px;
|
||||
list-style-type:none;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .model div {
|
||||
#shape-tracing-window-content .grid-display div.name {
|
||||
float:left;
|
||||
display:block;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .model div.type, #shape-tracing-window-content .model div.value {
|
||||
float:right;
|
||||
display:inline;
|
||||
width:66%;
|
||||
#shape-tracing-window-content .grid-display div.type, #shape-tracing-window-content .grid-display div.value {
|
||||
position:absolute;
|
||||
left:300px;
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
|
||||
#shape-tracing-window-content .model li {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
#shape-tracing-window-content .shape-tracing-breadcrumb
|
||||
{
|
||||
#shape-tracing-window-content .shape-tracing-breadcrumb {
|
||||
margin: 3px 0px;
|
||||
}
|
||||
@@ -25,38 +25,23 @@
|
||||
</ul>
|
||||
|
||||
<div class="shape-tracing-meta-content">
|
||||
<div class="shape">
|
||||
<div class="shape grid-display">
|
||||
<ul class="properties">
|
||||
<li>
|
||||
<div class="name">Shape</div>
|
||||
<div class="value">@Model.ShapeType</div>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<div class="name">Definition</div>
|
||||
<div class="value">@Model.Definition</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="name">Display Type</div>
|
||||
<div class="value">@(String.IsNullOrEmpty((string)Model.DisplayType) ? T("n/a").Text : Model.DisplayType.ToString())</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="name">Position</div>
|
||||
<div class="value">@(String.IsNullOrEmpty((string)Model.Position) ? T("n/a").Text : Model.Position.ToString())</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="name">Placement Source</div>
|
||||
<div class="value">@(String.IsNullOrEmpty((string)Model.PlacementSource) ? T("n/a").Text : Model.PlacementSource.ToString())</div>
|
||||
</li>
|
||||
<li><div class="name">Shape</div><div class="value">@Model.ShapeType</div></li>
|
||||
<li><div class="name">Definition</div><div class="value">@Model.Definition</div></li>
|
||||
<li><div class="name">Display Type</div><div class="value">@(String.IsNullOrEmpty((string)Model.DisplayType) ? T("n/a").Text : Model.DisplayType.ToString())</div></li>
|
||||
<li><div class="name">Position</div><div class="value">@(String.IsNullOrEmpty((string)Model.Position) ? T("n/a").Text : Model.Position.ToString())</div></li>
|
||||
<li><div class="name">Placement Source</div><div class="value">@(String.IsNullOrEmpty((string)Model.PlacementSource) ? T("n/a").Text : Model.PlacementSource.ToString())</div></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="model" style="display:none">
|
||||
<div class="shape-tracing-breadcrumb">foo</div>
|
||||
<div class="model grid-display" style="display:none">
|
||||
<div class="shape-tracing-breadcrumb"></div>
|
||||
@(new MvcHtmlString(@Model.Dump))
|
||||
</div>
|
||||
|
||||
<div class="placement" style="display:none">
|
||||
<div class="shape-tracing-breadcrumb">@(String.IsNullOrEmpty((string)Model.PlacementSource) ? T("").Text : Model.PlacementSource.ToString())</div>
|
||||
<textarea id="placement-@Model.ShapeId" name="placement-@Model.ShapeId">@Model.PlacementContent</textarea>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user