diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt b/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt new file mode 100644 index 000000000..e67e8a770 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt @@ -0,0 +1,13 @@ +Name: Designer Tools +AntiForgery: enabled +Author: The Orchard Team +Website: http://orchardproject.net +Version: 1.0 +OrchardVersion: 1.0 +Description: Description for the module +Features: + Orchard.DesignerTools: + Name: Shape Tracing + Category: Designer + Description: Description for feature Orchard.DesignerTools. + Dependencies: Orchard.jQuery diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj b/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj new file mode 100644 index 000000000..047e2118b --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Orchard.DesignerTools.csproj @@ -0,0 +1,129 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Orchard.DesignerTools + Orchard.DesignerTools + v4.0 + false + + + 3.5 + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + + + + 3.5 + + + + False + ..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll + + + + + + + + + + + + + + + + + + + + + {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} + Orchard.Framework + + + {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + Orchard.Core + + + + + + + + + + + + + + + + + + $(ProjectDir)\..\Manifests + + + + + + + + + + + + False + True + 45979 + / + + + False + True + http://orchard.codeplex.com + False + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..30c2724cc --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Properties/AssemblyInfo.cs @@ -0,0 +1,34 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Orchard.DesignerTools")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyProduct("Orchard")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ba95bc63-b148-42ce-ac32-223929b8091f")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config new file mode 100644 index 000000000..178ff35ba --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/Web.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js new file mode 100644 index 000000000..955564989 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Scripts/orchard-designertools-shapetracing.js @@ -0,0 +1,23 @@ +(function($) { + $(function() { + $("
»
") + .appendTo("body"); + $("#debug-shape-templates").click(function() { + var _this = $(this); + $("html").toggleClass(_this.attr("id")); + $(this).toggleClass("debug-active"); + }); + $("#debug-control-toggle").click(function() { + var _this = $(this), open = "debug-open"; + if (_this.is(":animated")) { + alert("aghhhh!"); + return; + } + if (_this.is("."+open)) { + _this.prev().hide("fast", function() {_this.removeClass(open).html("»");}); + } else { + _this.prev().show("fast", function() {_this.addClass(open).html("«");}); + } + }); + }); +})(jQuery); diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs new file mode 100644 index 000000000..c737e4d50 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Services/ShapeTracingFactory.cs @@ -0,0 +1,16 @@ +using Orchard.DisplayManagement.Implementation; +using Orchard.Environment.Extensions; + +namespace Orchard.DesignerTools.Services { + [OrchardFeature("Orchard.DesignerTools")] + public class ShapeTracingFactory : IShapeFactoryEvents { + public void Creating(ShapeCreatingContext context) { + } + + public void Created(ShapeCreatedContext context) { + if (context.ShapeType != "Layout" && context.ShapeType != "DocumentZone") { + context.Shape.Metadata.Wrappers.Add("ShapeTracing_Wrapper"); + } + } + } +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config new file mode 100644 index 000000000..178ff35ba --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/Web.config @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css new file mode 100644 index 000000000..2c2bf0874 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Styles/orchard-designertools-shapetracing.css @@ -0,0 +1,46 @@ +#debug-control * { + margin:0 !important; + padding:0 !important; +} +#debug-control { + background:#666; + border:1px solid #000; + color:#FFF; + float:left; + font:12px/12px Consolas,"Lucida Console",Monaco,monospace; + left:0; + position:fixed; + top:0; +} +#debug-control :hover { + color:yellow; +} +#debug-control .debug-active { + color:greenyellow; +} +#debug-control ul { + display:none; +} +#debug-control ul, #debug-control-toggle { + float:left; + padding:2px !important; +} +#debug-control li, #debug-control-toggle { + cursor:pointer; + display:inline; + list-style-type:none; + padding-left:2px !important; + padding-right:2px !important; + white-space:nowrap; +} +#debug-control li { + border-right:1px solid #999; +} +html.debug-shape-templates .shapeTracingWrapper { + background:#FFF; + border:1px dotted #CA7230; + padding:5px; +} +html.debug-shape-templates .shapeTracingWrapper:hover { + background:#E0E9EE; +} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/ShapeTracing.Wrapper.cshtml b/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/ShapeTracing.Wrapper.cshtml new file mode 100644 index 000000000..4d7b9c9e7 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/ShapeTracing.Wrapper.cshtml @@ -0,0 +1,24 @@ +@using Orchard; +@using Orchard.DisplayManagement.Descriptors; +@{ + Script.Require("jQuery"); + Script.Include("orchard-designertools-shapetracing.js"); + Style.Include("orchard-designertools-shapetracing.css"); + + var workContext = ViewContext.GetWorkContext(); + var shapeTable = workContext.Resolve().GetShapeTable(workContext.CurrentTheme.Id); + var descriptor = shapeTable.Descriptors[Model.Metadata.Type]; +} + +
+@Display(Model.Metadata.ChildContent) + +@foreach(var alternate in Model.Metadata.Alternates) { +
@alternate
+} +@foreach(var wrapper in Model.Metadata.Wrappers) { + if(wrapper != "ShapeTracing_Wrapper") { +
@wrapper
+ } +} +
\ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/Web.config new file mode 100644 index 000000000..b7d215131 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Views/Web.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config new file mode 100644 index 000000000..5884c5879 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config @@ -0,0 +1,39 @@ + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Orchard.Experimental.csproj b/src/Orchard.Web/Modules/Orchard.Experimental/Orchard.Experimental.csproj index 7cd20dad6..d1d5378c5 100644 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Orchard.Experimental.csproj +++ b/src/Orchard.Web/Modules/Orchard.Experimental/Orchard.Experimental.csproj @@ -68,7 +68,6 @@ - @@ -89,10 +88,6 @@ - - - - diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Shapes.cs b/src/Orchard.Web/Modules/Orchard.Experimental/Shapes.cs deleted file mode 100644 index d343bc32d..000000000 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Shapes.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Orchard.DisplayManagement.Implementation; - -namespace Orchard.Experimental { - public class Shapes : IShapeFactoryEvents { - public void Creating(ShapeCreatingContext context) { - - } - - public void Created(ShapeCreatedContext context) { - if (context.ShapeType != "Layout" && context.ShapeType != "DocumentZone") { - context.Shape.Metadata.Wrappers.Add("ThinBorder"); - } - if (context.ShapeType == "Header") { - context.Shape.Metadata.Wrappers.Add("HackScript"); - context.Shape.Metadata.Wrappers.Add("HackStyle"); - } - if (context.ShapeType == "Layout") { - context.Shape.Metadata.Wrappers.Add("DumpShapeTable"); - } - } - } -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Views/DumpShapeTable.cshtml b/src/Orchard.Web/Modules/Orchard.Experimental/Views/DumpShapeTable.cshtml deleted file mode 100644 index c353a1237..000000000 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Views/DumpShapeTable.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@using Orchard; -@using Orchard.DisplayManagement.Descriptors; -@Display(Model.Metadata.ChildContent) -@{ - var workContext = ViewContext.GetWorkContext(); - var shapeTable = workContext.Resolve().GetShapeTable(workContext.CurrentTheme.Id); - -} \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackScript.cshtml b/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackScript.cshtml deleted file mode 100644 index 19b9b2bd3..000000000 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackScript.cshtml +++ /dev/null @@ -1,31 +0,0 @@ - - -@Display(Model.Metadata.ChildContent) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackStyle.cshtml b/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackStyle.cshtml deleted file mode 100644 index 6b51056fe..000000000 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Views/HackStyle.cshtml +++ /dev/null @@ -1,49 +0,0 @@ - -@Display(Model.Metadata.ChildContent) \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Experimental/Views/ThinBorder.cshtml b/src/Orchard.Web/Modules/Orchard.Experimental/Views/ThinBorder.cshtml deleted file mode 100644 index a252fc93b..000000000 --- a/src/Orchard.Web/Modules/Orchard.Experimental/Views/ThinBorder.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@using Orchard; -@using Orchard.DisplayManagement.Descriptors; -@{ - var workContext = ViewContext.GetWorkContext(); - var shapeTable = workContext.Resolve().GetShapeTable(workContext.CurrentTheme.Id); - var descriptor = shapeTable.Descriptors[Model.Metadata.Type]; -} - -
-@Display(Model.Metadata.ChildContent) -
\ No newline at end of file diff --git a/src/Orchard.sln b/src/Orchard.sln index 10d7b6af4..8173caa63 100644 --- a/src/Orchard.sln +++ b/src/Orchard.sln @@ -104,6 +104,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.Scripting", "Orchar EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Specs", "Specs", "{3E10BF6D-ADA5-417D-B36C-EBB0660B475E}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Orchard.DesignerTools", "Orchard.Web\Modules\Orchard.DesignerTools\Orchard.DesignerTools.csproj", "{4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution CodeCoverage|Any CPU = CodeCoverage|Any CPU @@ -113,6 +115,10 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}.Release|Any CPU.Build.0 = Release|Any CPU {50B779EA-EC00-4699-84C0-03B395C365D2}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU {50B779EA-EC00-4699-84C0-03B395C365D2}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU {50B779EA-EC00-4699-84C0-03B395C365D2}.Coverage|Any CPU.ActiveCfg = Release|Any CPU @@ -596,5 +602,6 @@ Global {CB70A642-8CEC-4DDE-8C9F-AD08900EC98D} = {74492CBC-7201-417E-BC29-28B4C25A58B0} {7354DF37-934B-46CF-A13C-455D5F5F5413} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E} {94E694A2-D140-468D-A277-C5FCE1D13E9B} = {3E10BF6D-ADA5-417D-B36C-EBB0660B475E} + {4A4595EF-6C37-4F99-96ED-4AE0B9E438D3} = {E9C9F120-07BA-4DFB-B9C3-3AFB9D44C9D5} EndGlobalSection EndGlobal