Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -29,11 +29,6 @@ module.exports = function(grunt) {
|
||||
tasks: ['copy:html']
|
||||
},
|
||||
|
||||
config: {
|
||||
files: ['config/package.manifest'],
|
||||
tasks: ['copy:config']
|
||||
},
|
||||
|
||||
dll: {
|
||||
files: ['app/Umbraco/**/*.dll'],
|
||||
tasks: ['copy:dll']
|
||||
@@ -83,12 +78,6 @@ module.exports = function(grunt) {
|
||||
},
|
||||
config: {
|
||||
files: [
|
||||
{
|
||||
cwd: 'config/',
|
||||
src: ['package.manifest'],
|
||||
dest: '<%= basePath %>',
|
||||
expand: true
|
||||
},
|
||||
{
|
||||
cwd: 'app/langs/',
|
||||
src: ['**'],
|
||||
|
||||
@@ -37,8 +37,9 @@
|
||||
<Reference Include="AutoMapper.Net4">
|
||||
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.Net4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\businesslogic.dll</HintPath>
|
||||
<Reference Include="businesslogic, Version=1.0.5211.22378, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\businesslogic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
@@ -46,17 +47,20 @@
|
||||
<Reference Include="ClientDependency.Core.Mvc">
|
||||
<HintPath>..\packages\ClientDependency-Mvc.1.7.0.4\lib\ClientDependency.Core.Mvc.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\cms.dll</HintPath>
|
||||
<Reference Include="cms, Version=1.0.5211.22378, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\cms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="controls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\controls.dll</HintPath>
|
||||
<Reference Include="controls, Version=1.0.5211.22379, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Examine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Examine.dll</HintPath>
|
||||
<Reference Include="Examine, Version=0.1.55.2941, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Examine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
@@ -70,22 +74,24 @@
|
||||
<Reference Include="ImageProcessor.Web">
|
||||
<HintPath>..\packages\ImageProcessor.Web.3.2.1.0\lib\net45\ImageProcessor.Web.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="interfaces, Version=1.0.5206.24609, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="interfaces, Version=1.0.5211.22376, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\interfaces.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=1.2.11.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\log4net.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data, Version=1.0.1559.20655, Culture=neutral">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Reference Include="Microsoft.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
@@ -103,24 +109,26 @@
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net40\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework">
|
||||
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Reference Include="SQLCE4Umbraco, Version=1.0.5211.22379, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
@@ -163,39 +171,49 @@
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="TidyNet">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\TidyNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core, Version=1.0.5206.24609, Culture=neutral, processorArchitecture=MSIL">
|
||||
<Reference Include="TidyNet, Version=1.0.0.0, Culture=neutral">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Umbraco.Core.dll</HintPath>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\TidyNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Reference Include="umbraco, Version=1.0.5211.22381, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Reference Include="Umbraco.Core, Version=1.0.5211.22376, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Umbraco.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Reference Include="umbraco.DataLayer, Version=1.0.5211.22378, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.DataLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.providers.dll</HintPath>
|
||||
<Reference Include="umbraco.editorControls, Version=1.0.5211.22383, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.editorControls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Reference Include="umbraco.MacroEngines, Version=1.0.5211.22384, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Reference Include="umbraco.providers, Version=1.0.5211.22380, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.providers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\UmbracoExamine.dll</HintPath>
|
||||
<Reference Include="Umbraco.Web.UI, Version=1.0.5211.22384, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Reference Include="umbraco.XmlSerializers, Version=1.0.5211.22381, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine, Version=0.6.0.22379, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\UmbracoExamine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter, Version=2.0.60829.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -20,9 +20,9 @@
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.2.1312.1622" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="NUnit" version="2.6.3" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.1" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -41,8 +41,7 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="businesslogic">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\businesslogic.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\businesslogic.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ClientDependency.Core">
|
||||
<HintPath>..\packages\ClientDependency.1.7.1.2\lib\ClientDependency.Core.dll</HintPath>
|
||||
@@ -53,20 +52,17 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="cms">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\cms.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\cms.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="controls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\controls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\controls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CookComputing.XmlRpcV2">
|
||||
<HintPath>..\packages\xmlrpcnet.2.5.0\lib\net20\CookComputing.XmlRpcV2.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Examine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Examine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Examine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="HtmlAgilityPack">
|
||||
<HintPath>..\packages\HtmlAgilityPack.1.4.6\lib\Net45\HtmlAgilityPack.dll</HintPath>
|
||||
@@ -85,24 +81,20 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="interfaces">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\interfaces.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="log4net">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\log4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Lucene.Net">
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationBlocks.Data">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Microsoft.ApplicationBlocks.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Helpers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Microsoft.Web.Helpers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
@@ -121,22 +113,20 @@
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SQLCE4Umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\SQLCE4Umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\System.Data.SqlServerCe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
@@ -183,48 +173,37 @@
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="TidyNet">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\TidyNet.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\TidyNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Core">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Umbraco.Core.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Umbraco.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.DataLayer">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.DataLayer.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.DataLayer.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.editorControls">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.editorControls.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.editorControls.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.MacroEngines">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.MacroEngines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.providers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.providers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.providers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Umbraco.Web.UI">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\Umbraco.Web.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="umbraco.XmlSerializers">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\umbraco.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UmbracoExamine">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\UmbracoExamine.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\UmbracoExamine.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="UrlRewritingNet.UrlRewriter">
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.0\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
<HintPath>..\packages\UmbracoCms.Core.7.1.1\lib\UrlRewritingNet.UrlRewriter.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -242,8 +221,10 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\VersionInfo.cs" />
|
||||
<Compile Include="PropertyConverters\ArchetypeValueConverter.cs" />
|
||||
<Compile Include="PropertyEditors\ArchetypePropertyEditor.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
|
||||
@@ -1,15 +1,9 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
|
||||
namespace Archetype.Umbraco.Extensions
|
||||
{
|
||||
@@ -28,6 +22,30 @@ namespace Archetype.Umbraco.Extensions
|
||||
_app = ApplicationContext.Current;
|
||||
}
|
||||
|
||||
internal Models.Archetype DeserializeJsonToArchetype(string sourceJson, PreValueCollection dataTypePreValues)
|
||||
{
|
||||
try
|
||||
{
|
||||
var archetype = JsonConvert.DeserializeObject<Models.Archetype>(sourceJson, _jsonSettings);
|
||||
|
||||
try
|
||||
{
|
||||
// Get list of configured properties and their types and map them to the deserialized archetype model
|
||||
var preValue = GetArchetypePreValueFromPreValuesCollection(dataTypePreValues);
|
||||
RetrieveAdditionalProperties(ref archetype, preValue);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return new Models.Archetype();
|
||||
}
|
||||
}
|
||||
|
||||
internal Models.Archetype DeserializeJsonToArchetype(string sourceJson, int dataTypeId)
|
||||
{
|
||||
try
|
||||
@@ -72,6 +90,14 @@ namespace Archetype.Umbraco.Extensions
|
||||
}) as ArchetypePreValue;
|
||||
}
|
||||
|
||||
private ArchetypePreValue GetArchetypePreValueFromPreValuesCollection(PreValueCollection dataTypePreValues)
|
||||
{
|
||||
var preValueAsString = dataTypePreValues.PreValuesAsDictionary.First().Value.Value;
|
||||
var preValue = JsonConvert.DeserializeObject<ArchetypePreValue>(preValueAsString, _jsonSettings);
|
||||
return preValue;
|
||||
}
|
||||
|
||||
|
||||
private IDataTypeDefinition GetDataTypeByGuid(Guid guid)
|
||||
{
|
||||
return (IDataTypeDefinition) ApplicationContext.Current.ApplicationCache.RuntimeCache.GetCacheItem(
|
||||
@@ -96,6 +122,7 @@ namespace Archetype.Umbraco.Extensions
|
||||
var propertyAlias = property.Alias;
|
||||
foreach ( var propertyInst in fieldsetInst.Properties.Where(x => x.Alias == propertyAlias))
|
||||
{
|
||||
propertyInst.DataTypeGuid = property.DataTypeGuid.ToString();
|
||||
propertyInst.DataTypeId = GetDataTypeByGuid(property.DataTypeGuid).Id;
|
||||
propertyInst.PropertyEditorAlias = property.PropertyEditorAlias;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
using Umbraco.Core;
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Web;
|
||||
using Archetype.Umbraco.Models;
|
||||
|
||||
namespace Archetype.Umbraco.Extensions
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
using System.Collections;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace Archetype.Umbraco.Models
|
||||
{
|
||||
@@ -24,5 +27,18 @@ namespace Archetype.Umbraco.Models
|
||||
{
|
||||
return this.GetEnumerator();
|
||||
}
|
||||
|
||||
internal string SerializeForPersistence()
|
||||
{
|
||||
var json = JObject.Parse(JsonConvert.SerializeObject(this));
|
||||
var propertiesToRemove = new String[] { "propertyEditorAlias", "dataTypeId", "dataTypeGuid" };
|
||||
|
||||
json.Descendants().OfType<JProperty>()
|
||||
.Where(p => propertiesToRemove.Contains(p.Name))
|
||||
.ToList()
|
||||
.ForEach(x => x.Remove());
|
||||
|
||||
return json.ToString(Formatting.None);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,9 +28,6 @@ namespace Archetype.Umbraco.Models
|
||||
|
||||
public T GetValue<T>()
|
||||
{
|
||||
// If the value is of type T, just return it
|
||||
if (Value is T)
|
||||
return (T)Value;
|
||||
|
||||
// Try Umbraco's PropertyValueConverters
|
||||
var converters = UmbracoContext.Current != null ? PropertyValueConvertersResolver.Current.Converters : Enumerable.Empty<IPropertyValueConverter>();
|
||||
@@ -41,6 +38,10 @@ namespace Archetype.Umbraco.Models
|
||||
return convertedAttempt.Result;
|
||||
}
|
||||
|
||||
// If the value is of type T, just return it
|
||||
if (Value is T)
|
||||
return (T)Value;
|
||||
|
||||
// No PropertyValueConverters matched, so try a regular type conversion
|
||||
var convertAttempt2 = Value.TryConvertTo<T>();
|
||||
if (convertAttempt2.Success)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("0.0.0.0")]
|
||||
[assembly: AssemblyVersion("1.0")]
|
||||
[assembly: AssemblyFileVersion("1.0-beta")]
|
||||
@@ -1,13 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using Archetype.Umbraco.Models;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Models.PublishedContent;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
|
||||
namespace Archetype.Umbraco.PropertyConverters
|
||||
@@ -42,8 +42,7 @@ namespace Archetype.Umbraco.PropertyConverters
|
||||
var archetype = new ArchetypeHelper().DeserializeJsonToArchetype(source.ToString(),
|
||||
(propertyType != null ? propertyType.DataTypeId : -1));
|
||||
|
||||
return archetype;
|
||||
return archetype;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Archetype.Umbraco.Extensions;
|
||||
using ClientDependency.Core;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Editors;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
|
||||
namespace Archetype.Umbraco.PropertyEditors
|
||||
{
|
||||
[PropertyEditorAsset(ClientDependencyType.Javascript, "/App_Plugins/Archetype/js/archetype.js")]
|
||||
[PropertyEditor("Imulus.Archetype", "Archetype", "/App_Plugins/Archetype/views/archetype.html",
|
||||
ValueType = "JSON")]
|
||||
public class ArchetypePropertyEditor : PropertyEditor
|
||||
{
|
||||
#region Pre Value Editor
|
||||
|
||||
protected override PreValueEditor CreatePreValueEditor()
|
||||
{
|
||||
return new ArchetypePreValueEditor();
|
||||
}
|
||||
|
||||
internal class ArchetypePreValueEditor : PreValueEditor
|
||||
{
|
||||
[PreValueField("archetypeConfig", "Config", "/App_Plugins/Archetype/views/archetype.config.html",
|
||||
Description = "(Required) Describe your Archetype.")]
|
||||
public string Config { get; set; }
|
||||
|
||||
[PreValueField("hideLabel", "Hide Label", "boolean",
|
||||
Description = "Hide the Umbraco property title and description, making the Archetype span the entire page width")]
|
||||
public bool HideLabel { get; set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Value Editor
|
||||
|
||||
protected override PropertyValueEditor CreateValueEditor()
|
||||
{
|
||||
return new ArchetypePropertyValueEditor(base.CreateValueEditor());
|
||||
}
|
||||
|
||||
internal class ArchetypePropertyValueEditor : PropertyValueEditorWrapper
|
||||
{
|
||||
protected JsonSerializerSettings _jsonSettings;
|
||||
|
||||
public ArchetypePropertyValueEditor(PropertyValueEditor wrapped)
|
||||
: base(wrapped) { }
|
||||
|
||||
public override string ConvertDbToString(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
|
||||
{
|
||||
if (property.Value == null || property.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
var archetype = new ArchetypeHelper().DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
|
||||
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
foreach (var propDef in fieldset.Properties)
|
||||
{
|
||||
var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
|
||||
var propType = new PropertyType(dtd) { Alias = propDef.Alias };
|
||||
var prop = new Property(propType, propDef.Value);
|
||||
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
|
||||
propDef.Value = propEditor.ValueEditor.ConvertDbToString(prop, propType, dataTypeService);
|
||||
}
|
||||
}
|
||||
|
||||
return archetype.SerializeForPersistence();
|
||||
}
|
||||
|
||||
public override object ConvertDbToEditor(Property property, PropertyType propertyType, IDataTypeService dataTypeService)
|
||||
{
|
||||
if (property.Value == null || property.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
var archetype = new ArchetypeHelper().DeserializeJsonToArchetype(property.Value.ToString(), propertyType.DataTypeDefinitionId);
|
||||
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
foreach (var propDef in fieldset.Properties)
|
||||
{
|
||||
var dtd = dataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
|
||||
var propType = new PropertyType(dtd) { Alias = propDef.Alias };
|
||||
var prop = new Property(propType, propDef.Value);
|
||||
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
|
||||
propDef.Value = propEditor.ValueEditor.ConvertDbToEditor(prop, propType, dataTypeService);
|
||||
}
|
||||
}
|
||||
|
||||
return archetype;
|
||||
}
|
||||
public override object ConvertEditorToDb(ContentPropertyData editorValue, object currentValue)
|
||||
{
|
||||
if (editorValue.Value == null || editorValue.Value.ToString() == "")
|
||||
return string.Empty;
|
||||
|
||||
var archetype = new ArchetypeHelper().DeserializeJsonToArchetype(editorValue.Value.ToString(), editorValue.PreValues);
|
||||
|
||||
foreach (var fieldset in archetype.Fieldsets)
|
||||
{
|
||||
foreach (var propDef in fieldset.Properties)
|
||||
{
|
||||
var dtd = ApplicationContext.Current.Services.DataTypeService.GetDataTypeDefinitionById(Guid.Parse(propDef.DataTypeGuid));
|
||||
var preValues = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(dtd.Id);
|
||||
var propData = new ContentPropertyData(propDef.Value, preValues, new Dictionary<string, object>());
|
||||
var propEditor = PropertyEditorResolver.Current.GetByAlias(dtd.PropertyEditorAlias);
|
||||
propDef.Value = propEditor.ValueEditor.ConvertEditorToDb(propData, propDef.Value);
|
||||
}
|
||||
}
|
||||
|
||||
return archetype.SerializeForPersistence();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -19,8 +19,8 @@
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.0" targetFramework="net45" />
|
||||
<package id="UmbracoCms.Core" version="7.1.1" targetFramework="net45" />
|
||||
<package id="xmlrpcnet" version="2.5.0" targetFramework="net45" />
|
||||
</packages>
|
||||
+34
-103
@@ -11,14 +11,11 @@
|
||||
|
||||
//ini the model
|
||||
$scope.model.value = $scope.model.value || getDefaultModel($scope.model.config);
|
||||
|
||||
//ini the render model
|
||||
$scope.archetypeRenderModel = {};
|
||||
initArchetypeRenderModel();
|
||||
init();
|
||||
|
||||
//helper to get $eval the labelTemplate
|
||||
$scope.getFieldsetTitle = function(fieldsetConfigModel, fieldsetIndex) {
|
||||
var fieldset = $scope.archetypeRenderModel.fieldsets[fieldsetIndex];
|
||||
var fieldset = $scope.model.value.fieldsets[fieldsetIndex];
|
||||
var fieldsetConfig = $scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
var template = fieldsetConfigModel.labelTemplate;
|
||||
|
||||
@@ -61,11 +58,11 @@
|
||||
|
||||
if (typeof $index != 'undefined')
|
||||
{
|
||||
$scope.archetypeRenderModel.fieldsets.splice($index + 1, 0, newFieldset);
|
||||
$scope.model.value.fieldsets.splice($index + 1, 0, newFieldset);
|
||||
}
|
||||
else
|
||||
{
|
||||
$scope.archetypeRenderModel.fieldsets.push(newFieldset);
|
||||
$scope.model.value.fieldsets.push(newFieldset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,15 +71,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
//rather than splice the archetypeRenderModel, we're hiding this and cleaning onFormSubmitting
|
||||
$scope.removeRow = function ($index) {
|
||||
if ($scope.canRemove()) {
|
||||
if (confirm('Are you sure you want to remove this?')) {
|
||||
$scope.archetypeRenderModel.fieldsets[$index].remove = true;
|
||||
/*
|
||||
Touches the model. Not sure why this is needed but without it the Digest doesn't run on a remove row.
|
||||
*/
|
||||
$scope.archetypeRenderModel = JSON.parse(JSON.stringify($scope.archetypeRenderModel));
|
||||
$scope.model.value.fieldsets.splice($index, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,16 +106,20 @@
|
||||
//helpers for determining if the add button should be shown
|
||||
$scope.showAddButton = function () {
|
||||
return $scope.model.config.startWithAddButton
|
||||
&& countVisible() === 0;
|
||||
&& countVisible() === 0
|
||||
&& !$scope.model.config.enableMultipleFieldsets;
|
||||
}
|
||||
|
||||
//helper, ini the render model from the server (model.value)
|
||||
function initArchetypeRenderModel() {
|
||||
$scope.archetypeRenderModel = removeNulls($scope.model.value);
|
||||
function init() {
|
||||
$scope.model.value = removeNulls($scope.model.value);
|
||||
addDefaultProperties($scope.model.value.fieldsets);
|
||||
}
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function (fieldset)
|
||||
function addDefaultProperties(fieldsets)
|
||||
{
|
||||
_.each(fieldsets, function (fieldset)
|
||||
{
|
||||
fieldset.remove = false;
|
||||
fieldset.collapse = false;
|
||||
fieldset.isValid = true;
|
||||
});
|
||||
@@ -144,6 +140,15 @@
|
||||
return (typeof property !== 'undefined') ? property.value : '';
|
||||
};
|
||||
|
||||
$scope.isCollapsed = function(fieldset)
|
||||
{
|
||||
if(typeof fieldset.collapse === "undefined")
|
||||
{
|
||||
fieldset.collapse = true;
|
||||
}
|
||||
return fieldset.collapse;
|
||||
}
|
||||
|
||||
//helper for expanding/collapsing fieldsets
|
||||
$scope.focusFieldset = function(fieldset){
|
||||
fixDisableSelection();
|
||||
@@ -159,13 +164,13 @@
|
||||
iniState = fieldset.collapse;
|
||||
}
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
_.each($scope.model.value.fieldsets, function(fieldset){
|
||||
fieldset.collapse = true;
|
||||
});
|
||||
|
||||
if(!fieldset && $scope.archetypeRenderModel.fieldsets.length == 1 && $scope.archetypeRenderModel.fieldsets[0].remove == false)
|
||||
if(!fieldset && $scope.model.value.fieldsets.length == 1)
|
||||
{
|
||||
$scope.archetypeRenderModel.fieldsets[0].collapse = false;
|
||||
$scope.model.value.fieldsets[0].collapse = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -179,7 +184,7 @@
|
||||
$scope.focusFieldset();
|
||||
|
||||
//developerMode helpers
|
||||
$scope.archetypeRenderModel.toString = stringify;
|
||||
$scope.model.value.toString = stringify;
|
||||
|
||||
//encapsulate stringify (should be built into browsers, not sure of IE support)
|
||||
function stringify() {
|
||||
@@ -187,12 +192,12 @@
|
||||
}
|
||||
|
||||
//watch for changes
|
||||
$scope.$watch('archetypeRenderModel', function (v) {
|
||||
$scope.$watch('model.value', function (v) {
|
||||
if ($scope.model.config.developerMode) {
|
||||
console.log(v);
|
||||
if (typeof v === 'string') {
|
||||
$scope.archetypeRenderModel = JSON.parse(v);
|
||||
$scope.archetypeRenderModel.toString = stringify;
|
||||
$scope.model.value = JSON.parse(v);
|
||||
$scope.model.value.toString = stringify;
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -200,64 +205,7 @@
|
||||
//helper to count what is visible
|
||||
function countVisible()
|
||||
{
|
||||
var count = 0;
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
if (fieldset.remove == false) {
|
||||
count++;
|
||||
}
|
||||
});
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
//helper to sync the model to the renderModel
|
||||
function syncModelToRenderModel()
|
||||
{
|
||||
$scope.model.value = { fieldsets: [] };
|
||||
|
||||
_.each($scope.archetypeRenderModel.fieldsets, function(fieldset){
|
||||
var cleanedFieldset = cleanFieldset(fieldset);
|
||||
|
||||
if(cleanedFieldset){
|
||||
$scope.model.value.fieldsets.push(cleanedFieldset);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//helper to remove properties only used during editing that we don't want in the saved data
|
||||
//also removes properties that are no longer in the config
|
||||
function cleanFieldset(fieldset)
|
||||
{
|
||||
if (typeof fieldset != 'function' && !fieldset.remove){
|
||||
|
||||
var fieldsetConfig = $scope.getConfigFieldsetByAlias(fieldset.alias);
|
||||
|
||||
//clone and clean
|
||||
var tempFieldset = JSON.parse(JSON.stringify(fieldset));
|
||||
delete tempFieldset.remove;
|
||||
delete tempFieldset.isValid;
|
||||
delete tempFieldset.collapse;
|
||||
|
||||
_.each(tempFieldset.properties, function(property, index){
|
||||
var propertyConfig = _.find(fieldsetConfig.properties, function(p){
|
||||
return property.alias == p.alias;
|
||||
});
|
||||
|
||||
//just prune the property
|
||||
if(propertyConfig){
|
||||
delete property.isValid;
|
||||
}
|
||||
else
|
||||
{
|
||||
//need to remove the whole property
|
||||
tempFieldset.properties.splice(index, 1);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return tempFieldset;
|
||||
}
|
||||
return $scope.model.value.fieldsets.length;
|
||||
}
|
||||
|
||||
// helper to get initial model if none was provided
|
||||
@@ -270,7 +218,7 @@
|
||||
|
||||
//helper to add an empty fieldset to the render model
|
||||
function getEmptyRenderFieldset (fieldsetModel) {
|
||||
return {alias: fieldsetModel.alias, remove: false, isValid: true, properties: []};
|
||||
return {alias: fieldsetModel.alias, collapse: false, isValid: true, properties: []};
|
||||
}
|
||||
|
||||
//helper to ensure no nulls make it into the model
|
||||
@@ -300,9 +248,9 @@
|
||||
//helper to lookup validity when given a fieldsetIndex and property alias
|
||||
$scope.getPropertyValidity = function(fieldsetIndex, alias)
|
||||
{
|
||||
if($scope.archetypeRenderModel.fieldsets[fieldsetIndex])
|
||||
if($scope.model.value.fieldsets[fieldsetIndex])
|
||||
{
|
||||
var property = _.find($scope.archetypeRenderModel.fieldsets[fieldsetIndex].properties, function(property){
|
||||
var property = _.find($scope.model.value.fieldsets[fieldsetIndex].properties, function(property){
|
||||
return property.alias == alias;
|
||||
});
|
||||
}
|
||||
@@ -310,23 +258,6 @@
|
||||
return (typeof property == 'undefined') ? true : property.isValid;
|
||||
}
|
||||
|
||||
//sync things up on save
|
||||
$scope.$on("formSubmitting", function (ev, args) {
|
||||
|
||||
//test for form; may have to do this differently for nested archetypes
|
||||
if(!form)
|
||||
return;
|
||||
|
||||
if(form.$invalid)
|
||||
{
|
||||
notificationsService.warning("Cannot Save Document", "The document could not be saved because of missing required fields.")
|
||||
}
|
||||
else
|
||||
{
|
||||
syncModelToRenderModel();
|
||||
}
|
||||
});
|
||||
|
||||
//custom js
|
||||
if ($scope.model.config.customJsPath) {
|
||||
assetsService.loadJs($scope.model.config.customJsPath);
|
||||
|
||||
@@ -75,11 +75,10 @@ angular.module("umbraco.directives").directive('archetypeProperty', function ($c
|
||||
|
||||
//load in the DefaultPreValues for the PropertyEditor, if any
|
||||
var defaultConfigObj = {};
|
||||
if (propertyEditor.hasOwnProperty('defaultPreValues') && propertyEditor.defaultPreValues != null && propertyEditor.defaultPreValues.length > 0) {
|
||||
_.each(propertyEditor.defaultPreValues, function(p) {
|
||||
_.extend(defaultConfigObj, p)
|
||||
});
|
||||
if (propertyEditor.hasOwnProperty('defaultPreValues') && propertyEditor.defaultPreValues != null) {
|
||||
_.extend(defaultConfigObj, propertyEditor.defaultPreValues);
|
||||
}
|
||||
|
||||
var mergedConfig = _.extend(defaultConfigObj, config);
|
||||
|
||||
loadView(pathToView, mergedConfig, defaultValue, alias, umbracoPropertyAlias, scope, element, ngModelCtrl);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="archetypeEditor ng-class:model.config.customCssClass" ng-controller="Imulus.ArchetypeController">
|
||||
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="archetypeRenderModel"></textarea>
|
||||
<textarea class="archetypeDeveloperModel" ng-show="model.config.developerMode" ng-model="model.value"></textarea>
|
||||
<div class="archetypeFieldsetToolbar" ng-show="model.config.fieldsets.length > 1 && model.config.hideFieldsetToolbar != '1'">
|
||||
<ul>
|
||||
<li ng-repeat="fieldsetModel in model.config.fieldsets" ng-click="addRow(fieldsetModel.alias)">
|
||||
@@ -8,29 +8,25 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul ui-sortable="sortableOptions" ng-model="archetypeRenderModel.fieldsets" ng-show="!showAddButton()">
|
||||
<li ng-repeat="fieldset in archetypeRenderModel.fieldsets" ng-hide="fieldset.remove">
|
||||
<ul ui-sortable="sortableOptions" ng-model="model.value.fieldsets" ng-show="!showAddButton()">
|
||||
<li ng-repeat="fieldset in model.value.fieldsets">
|
||||
<fieldset ng-class="{archetypeFieldsetError: !fieldset.isValid}" ng-init="fieldsetConfigModel = getConfigFieldsetByAlias(fieldset.alias)">
|
||||
|
||||
<div class="archetypeFieldsetLabel" ng-class="{enableCollapsing: model.config.enableCollapsing}">
|
||||
<div ng-click="focusFieldset(fieldset)" class="label-sub module-label">
|
||||
<span class="caret" ng-hide="fieldset.collapse || !model.config.enableCollapsing"></span>
|
||||
<span class="caret caret-right" ng-show="fieldset.collapse && model.config.enableCollapsing"></span>
|
||||
|
||||
<label>
|
||||
<i class="fieldsetIcon icon ng-class:fieldsetConfigModel.icon"></i>
|
||||
<span ng-bind="getFieldsetTitle(fieldsetConfigModel, $index)"></span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="archetypeEditorControls label-sub" ng-hide="model.config.hideFieldsetControls">
|
||||
<i class="icon icon-add" ng-click="addRow(fieldset.alias, $index)" ng-show="canAdd()"></i>
|
||||
<i class="icon icon-remove" ng-click="removeRow($index)" ng-show="canRemove()"></i>
|
||||
<i class="icon icon-navigation handle" ng-show="canSort()"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="archetypeCollapser animate-hide" ng-hide="fieldset.collapse">
|
||||
<div class="archetypeCollapser animate-hide" ng-hide="isCollapsed(fieldset)">
|
||||
<form class="form-inline">
|
||||
<div ng-class="{archetypePropertyError: getPropertyValidity($parent.$index, property.alias) === false}" class="archetypeProperty control-group" ng-repeat="property in fieldsetConfigModel.properties">
|
||||
<label ng-hide="archetypeConfig.hidePropertyLabels == '1'" class="control-label" for="archetype-property-{{model.alias}}-{{$parent.$index}}-{{$index}}">
|
||||
@@ -41,7 +37,7 @@
|
||||
</label>
|
||||
|
||||
<div class="controls">
|
||||
<archetype-property class="archetypeEditor ng-class:property.alias" property="property" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="archetypeRenderModel" umbraco-property-alias="model.alias"></archetype-property>
|
||||
<archetype-property class="archetypeEditor ng-class:property.alias" property="property" fieldset-index="$parent.$index" fieldset="fieldset" archetype-config="model.config" property-config-index="$index" archetype-render-model="model.value" umbraco-property-alias="model.alias"></archetype-property>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@@ -49,7 +45,6 @@
|
||||
</fieldset>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div ng-show="showAddButton()">
|
||||
<a class="archetypeAddButton" href="#" ng-click="addRow(model.config.fieldsets[0].alias, 0)" prevent-default="">
|
||||
<i class="icon icon-add"></i>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Archetype",
|
||||
"version": "0.5.1-alpha",
|
||||
"version": "1.0-beta",
|
||||
"url": "http://github.com/imulus/archetype/",
|
||||
"author": "Imulus",
|
||||
"authorUrl": "http://imulus.com/",
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
propertyEditors: [
|
||||
{
|
||||
alias: "Imulus.Archetype",
|
||||
name: "Archetype",
|
||||
editor: {
|
||||
view: "~/App_Plugins/Archetype/views/archetype.html",
|
||||
valueType: "JSON"
|
||||
},
|
||||
prevalues: {
|
||||
fields: [
|
||||
{
|
||||
label: "Config",
|
||||
description: "(Required) Describe your Archetype.",
|
||||
key: "archetypeConfig",
|
||||
view: "/App_Plugins/Archetype/views/archetype.config.html",
|
||||
validation: [
|
||||
{
|
||||
type: "Required"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
label: "Hide Label",
|
||||
description: "Hide the Umbraco property title and description, making the Archetype span the entire page width",
|
||||
key: "hideLabel",
|
||||
view: "boolean"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
javascript: [
|
||||
'~/App_Plugins/Archetype/js/archetype.js'
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user