mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 04:43:35 +08:00
Creating Orchard.DesignerTools module
- Creating Shape Tracing feature from Experimental feature --HG-- branch : dev
This commit is contained in:
13
src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt
Normal file
13
src/Orchard.Web/Modules/Orchard.DesignerTools/Module.txt
Normal file
@@ -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
|
@@ -0,0 +1,129 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{4A4595EF-6C37-4F99-96ED-4AE0B9E438D3}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Orchard.DesignerTools</RootNamespace>
|
||||
<AssemblyName>Orchard.DesignerTools</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<MvcBuildViews>false</MvcBuildViews>
|
||||
<FileUpgradeFlags>
|
||||
</FileUpgradeFlags>
|
||||
<OldToolsVersion>3.5</OldToolsVersion>
|
||||
<UpgradeBackupLocation />
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations">
|
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\lib\aspnetmvc\System.Web.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Web.Abstractions" />
|
||||
<Reference Include="System.Web.Routing" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Scripts\orchard-designertools-shapetracing.js" />
|
||||
<Content Include="Styles\orchard-designertools-shapetracing.css" />
|
||||
<Content Include="Web.config" />
|
||||
<Content Include="Views\Web.config" />
|
||||
<Content Include="Scripts\Web.config" />
|
||||
<Content Include="Styles\Web.config" />
|
||||
<Content Include="Properties\AssemblyInfo.cs" />
|
||||
<Content Include="Module.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
<Project>{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}</Project>
|
||||
<Name>Orchard.Framework</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Core\Orchard.Core.csproj">
|
||||
<Project>{9916839C-39FC-4CEB-A5AF-89CA7E87119F}</Project>
|
||||
<Name>Orchard.Core</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Services\ShapeTracingFactory.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\ShapeTracing.Wrapper.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
<Folder Include="Models\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target> -->
|
||||
<Target Name="AfterBuild" DependsOnTargets="AfterBuildCompiler">
|
||||
<PropertyGroup>
|
||||
<AreasManifestDir>$(ProjectDir)\..\Manifests</AreasManifestDir>
|
||||
</PropertyGroup>
|
||||
<!-- If this is an area child project, uncomment the following line:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Child" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
-->
|
||||
<!-- If this is an area parent project, uncomment the following lines:
|
||||
<CreateAreaManifest AreaName="$(AssemblyName)" AreaType="Parent" AreaPath="$(ProjectDir)" ManifestPath="$(AreasManifestDir)" ContentFiles="@(Content)" />
|
||||
<CopyAreaManifests ManifestPath="$(AreasManifestDir)" CrossCopy="false" RenameViews="true" />
|
||||
-->
|
||||
</Target>
|
||||
<Target Name="AfterBuildCompiler" Condition="'$(MvcBuildViews)'=='true'">
|
||||
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" />
|
||||
</Target>
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>45979</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>
|
||||
</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>True</UseCustomServer>
|
||||
<CustomServerUrl>http://orchard.codeplex.com</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
@@ -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")]
|
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<!-- iis6 - for any request in this location, return via managed static file handler -->
|
||||
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers accessPolicy="Script,Read">
|
||||
<!--
|
||||
iis7 - for any request to a file exists on disk, return it via native http module.
|
||||
accessPolicy 'Script' is to allow for a managed 404 page.
|
||||
-->
|
||||
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
@@ -0,0 +1,23 @@
|
||||
(function($) {
|
||||
$(function() {
|
||||
$("<div id='debug-control'><ul><li id='debug-shape-templates'>shape templates</li></ul><div id='debug-control-toggle'>»</div></div>")
|
||||
.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);
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
<!-- iis6 - for any request in this location, return via managed static file handler -->
|
||||
<add path="*" verb="*" type="System.Web.StaticFileHandler" />
|
||||
</httpHandlers>
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers accessPolicy="Script,Read">
|
||||
<!--
|
||||
iis7 - for any request to a file exists on disk, return it via native http module.
|
||||
accessPolicy 'Script' is to allow for a managed 404 page.
|
||||
-->
|
||||
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule" preCondition="integratedMode" resourceType="File" requireAccess="Read" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</configuration>
|
@@ -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;
|
||||
}
|
@@ -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<IShapeTableManager>().GetShapeTable(workContext.CurrentTheme.Id);
|
||||
var descriptor = shapeTable.Descriptors[Model.Metadata.Type];
|
||||
}
|
||||
|
||||
<div class="shapeTracingWrapper" title="@Model.Metadata.Type @descriptor.BindingSource">
|
||||
@Display(Model.Metadata.ChildContent)
|
||||
|
||||
@foreach(var alternate in Model.Metadata.Alternates) {
|
||||
<div style="color:red">@alternate</div>
|
||||
}
|
||||
@foreach(var wrapper in Model.Metadata.Wrappers) {
|
||||
if(wrapper != "ShapeTracing_Wrapper") {
|
||||
<div style="color:green">@wrapper</div>
|
||||
}
|
||||
}
|
||||
</div>
|
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
<appSettings>
|
||||
<add key="webpages:Enabled" value="false" />
|
||||
</appSettings>
|
||||
<system.web>
|
||||
<httpHandlers>
|
||||
</httpHandlers>
|
||||
|
||||
<!--
|
||||
Enabling request validation in view pages would cause validation to occur
|
||||
after the input has already been processed by the controller. By default
|
||||
MVC performs request validation before a controller processes the input.
|
||||
To change this behavior apply the ValidateInputAttribute to a
|
||||
controller or action.
|
||||
-->
|
||||
<pages
|
||||
validateRequest="false"
|
||||
pageParserFilterType="System.Web.Mvc.ViewTypeParserFilter, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"
|
||||
userControlBaseType="System.Web.Mvc.ViewUserControl, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<controls>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" namespace="System.Web.Mvc" tagPrefix="mvc" />
|
||||
</controls>
|
||||
</pages>
|
||||
</system.web>
|
||||
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<handlers>
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="2.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
39
src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config
Normal file
39
src/Orchard.Web/Modules/Orchard.DesignerTools/Web.config
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0"?>
|
||||
<configuration>
|
||||
|
||||
<configSections>
|
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
|
||||
<remove name="host" />
|
||||
<remove name="pages" />
|
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<system.web.webPages.razor>
|
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
<pages pageBaseType="Orchard.Mvc.ViewEngines.Razor.WebViewPage">
|
||||
<namespaces>
|
||||
<add namespace="System.Web.Mvc" />
|
||||
<add namespace="System.Web.Mvc.Ajax" />
|
||||
<add namespace="System.Web.Mvc.Html" />
|
||||
<add namespace="System.Web.Routing" />
|
||||
<add namespace="System.Linq"/>
|
||||
<add namespace="System.Collections.Generic"/>
|
||||
<add namespace="Orchard.Mvc.Html"/>
|
||||
</namespaces>
|
||||
</pages>
|
||||
</system.web.webPages.razor>
|
||||
|
||||
<system.web>
|
||||
<compilation targetFramework="4.0">
|
||||
<assemblies>
|
||||
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
|
||||
<add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
</system.web>
|
||||
|
||||
</configuration>
|
@@ -68,7 +68,6 @@
|
||||
<Compile Include="Permissions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Settings\ExperimentalSettings.cs" />
|
||||
<Compile Include="Shapes.cs" />
|
||||
<Compile Include="ViewModels\CommandsExecuteViewModel.cs" />
|
||||
<Compile Include="ViewModels\ContentDetailsViewModel.cs" />
|
||||
<Compile Include="ViewModels\ContentIndexViewModel.cs" />
|
||||
@@ -89,10 +88,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\Parts\Experimental.ShowDebugLink.cshtml" />
|
||||
<Content Include="Views\DumpShapeTable.cshtml" />
|
||||
<Content Include="Views\HackScript.cshtml" />
|
||||
<Content Include="Views\HackStyle.cshtml" />
|
||||
<Content Include="Views\ThinBorder.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\Orchard\Orchard.Framework.csproj">
|
||||
|
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,14 +0,0 @@
|
||||
@using Orchard;
|
||||
@using Orchard.DisplayManagement.Descriptors;
|
||||
@Display(Model.Metadata.ChildContent)
|
||||
@{
|
||||
var workContext = ViewContext.GetWorkContext();
|
||||
var shapeTable = workContext.Resolve<IShapeTableManager>().GetShapeTable(workContext.CurrentTheme.Id);
|
||||
<!--
|
||||
<ul>
|
||||
@foreach(var binding in shapeTable.Bindings) {
|
||||
<li>@binding.Key : @binding.Value.BindingSource</li>
|
||||
}
|
||||
</ul>
|
||||
-->
|
||||
}
|
@@ -1,31 +0,0 @@
|
||||
<script>
|
||||
if (typeof jQuery == 'undefined') {
|
||||
document.write(unescape("%3Cscript src='/orchardlocal/modules/orchard.jquery/scripts/jquery-1.4.2.min.js'%3E%3C/script%3E"));
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
(function($) {
|
||||
$(function() {
|
||||
$("<div id='debug-control'><ul><li id='debug-shape-templates'>shape templates</li></ul><div id='debug-control-toggle'>»</div></div>")
|
||||
.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);
|
||||
</script>
|
||||
@Display(Model.Metadata.ChildContent)
|
@@ -1,49 +0,0 @@
|
||||
<style>
|
||||
#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 .thin-dotted-orange-border-with-a-little-padding {
|
||||
background:#FFF;
|
||||
border:1px dotted #CA7230;
|
||||
padding:5px;
|
||||
}
|
||||
html.debug-shape-templates .thin-dotted-orange-border-with-a-little-padding:hover {
|
||||
background:#E0E9EE;
|
||||
}
|
||||
</style>
|
||||
@Display(Model.Metadata.ChildContent)
|
@@ -1,11 +0,0 @@
|
||||
@using Orchard;
|
||||
@using Orchard.DisplayManagement.Descriptors;
|
||||
@{
|
||||
var workContext = ViewContext.GetWorkContext();
|
||||
var shapeTable = workContext.Resolve<IShapeTableManager>().GetShapeTable(workContext.CurrentTheme.Id);
|
||||
var descriptor = shapeTable.Descriptors[Model.Metadata.Type];
|
||||
}
|
||||
|
||||
<!-- ----DEBUG---- --><div class="thin-dotted-orange-border-with-a-little-padding" title="@Model.Metadata.Type @descriptor.BindingSource">
|
||||
@Display(Model.Metadata.ChildContent)
|
||||
</div><!-- ----/DEBUG---- -->
|
@@ -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
|
||||
|
Reference in New Issue
Block a user