Compare commits
216 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b60aa3031c | |||
| 2a0e3d803f | |||
| 670a67225a | |||
| 0bedf09f48 | |||
| 41ad18deef | |||
| 4745be4765 | |||
| 13891bb033 | |||
| a2efd7ab53 | |||
| 3c204da150 | |||
| ab7371e146 | |||
| 0f5c79afbc | |||
| 4a516f7da9 | |||
| fcb080658d | |||
| 08d74e3320 | |||
| 98fd75b55d | |||
| e7da70e076 | |||
| 200cec0e23 | |||
| 807778a737 | |||
| 66d61c9d20 | |||
| ecae5a856a | |||
| bf8add4f8d | |||
| 256fa3385a | |||
| ebaa46b2fc | |||
| e207185d51 | |||
| 5efc45a7dd | |||
| c3fc27565d | |||
| 0af3f9dce0 | |||
| 426b02b08a | |||
| a4e23ef82b | |||
| d0c6c4aafa | |||
| 3ea7e6fb8a | |||
| 9940b78a57 | |||
| 8371105c10 | |||
| d4b0f3c570 | |||
| 29416320d2 | |||
| d11eb485e1 | |||
| 300bd3bed4 | |||
| 3ca5443350 | |||
| f6d56f51d4 | |||
| 53c0bd6938 | |||
| 174aa9f4ad | |||
| a768fe5bb3 | |||
| d9c66cd4b3 | |||
| 6d3e8e1f6d | |||
| b6185b847f | |||
| c8877d0a2c | |||
| 891810b045 | |||
| 77d910b6b6 | |||
| 47044b3a77 | |||
| 5b693f9310 | |||
| 40ebc1295c | |||
| b769b224c2 | |||
| 89efe40f41 | |||
| 51660d918c | |||
| ea7b053106 | |||
| 3e17201ce7 | |||
| 1f03983628 | |||
| 15aa6fc4b8 | |||
| 41e8a9ef2d | |||
| a492976a32 | |||
| 88e09f9077 | |||
| 65a1709bd3 | |||
| 6478a8424a | |||
| 55ade4e491 | |||
| a767aa9f3a | |||
| 50321e5936 | |||
| 1321702d19 | |||
| 005ff2f830 | |||
| dff3fde840 | |||
| 44504ff6af | |||
| 25d3389759 | |||
| 3f97c74712 | |||
| 1152b61fb0 | |||
| b1842de045 | |||
| 750a2862ee | |||
| 7632075df4 | |||
| aa75cd4ea8 | |||
| 06827bd7a5 | |||
| 9a82ab7d4a | |||
| b1037d1936 | |||
| ccdc3a1eab | |||
| a47387fec0 | |||
| c29d08c915 | |||
| b8f796eb2c | |||
| b9088c9ac0 | |||
| 7a8f8ac0fe | |||
| 49cf0f98ce | |||
| 22ffa86e18 | |||
| c4e2d98138 | |||
| c01211c62d | |||
| d8a3e00440 | |||
| 264c537b50 | |||
| f26c61d736 | |||
| 43f647fd94 | |||
| cc0bcc2d59 | |||
| 1b23540b87 | |||
| c309e18f13 | |||
| dec60885b4 | |||
| eee09ec45b | |||
| b4daab2856 | |||
| fdfbad254d | |||
| 0c6e766030 | |||
| 7444363cef | |||
| a82097b92b | |||
| 07934161a4 | |||
| 9194030a9a | |||
| 1cbaace777 | |||
| ef5052324b | |||
| 204a8d813c | |||
| 8009cb3892 | |||
| 284d168cd7 | |||
| fdd025aefd | |||
| e36d4768e1 | |||
| df2047e8f8 | |||
| d9280d5238 | |||
| 388249f500 | |||
| a08b75592e | |||
| 38ea6dfbfe | |||
| 39ccde221a | |||
| 17b6366ea3 | |||
| 3d6a608b12 | |||
| 851f58df9c | |||
| 0ff0cc6366 | |||
| 08004ecc68 | |||
| 4a2544d0e6 | |||
| bace1cce74 | |||
| acc88e25d8 | |||
| 2a1a16d478 | |||
| a5afb8ed19 | |||
| d02678e05c | |||
| 9e0bbd3c99 | |||
| 539efcc669 | |||
| d0d9d85151 | |||
| ffa307613c | |||
| 19ea6d6005 | |||
| 155b1737d3 | |||
| b66253f33e | |||
| bcbadfe648 | |||
| 3325b06873 | |||
| 852914bf6b | |||
| 3e14807370 | |||
| e44cb6708d | |||
| fd43b27d00 | |||
| 524f113611 | |||
| 04dcf50218 | |||
| 2b497deaa3 | |||
| dbe2f8ea37 | |||
| 7dc0239ad1 | |||
| 72fdc5f472 | |||
| cde3c42cec | |||
| 10b544abb9 | |||
| 88aecdf672 | |||
| ad95736eaa | |||
| 34a21a78a0 | |||
| 1e01c2669f | |||
| d3a7389b89 | |||
| bc8b6c4bea | |||
| 3953a48a3b | |||
| 2f44e94bd0 | |||
| 5eeb8d7df6 | |||
| 231f23cc6e | |||
| 3235678d29 | |||
| f13ddddc16 | |||
| 490c346fcf | |||
| 8f1d8419a0 | |||
| be8320bb4b | |||
| 1d4b6178e5 | |||
| 3427f596e3 | |||
| c31ea7409f | |||
| f88e60bcb5 | |||
| c81919e269 | |||
| c936aaa517 | |||
| b8f88e0459 | |||
| 1628ac917c | |||
| ab586a49ce | |||
| ff2ee540e2 | |||
| b450299d45 | |||
| 0ebe535922 | |||
| f5f8fe7b42 | |||
| f51a66b728 | |||
| f8a7b453c7 | |||
| 89235f707c | |||
| 550166c41b | |||
| 40be3957f6 | |||
| 6ccce4d914 | |||
| 14ea374b24 | |||
| 4d49268c47 | |||
| a569796adb | |||
| 59de0613f5 | |||
| 8391c32886 | |||
| bf2efd30e9 | |||
| 187373132f | |||
| 79584a9cf9 | |||
| 96fa8c7dc9 | |||
| 5e43ddc13c | |||
| 98f76a989f | |||
| 2e8993adb8 | |||
| 81600f0f3c | |||
| 74ccd79408 | |||
| 3e0a754dc0 | |||
| 006a89e136 | |||
| 29dbbee173 | |||
| cd31637371 | |||
| ab70c98d4c | |||
| 424ff02734 | |||
| 80bd8d962b | |||
| 956364decd | |||
| 6133e8f8c2 | |||
| b048ae4d36 | |||
| 6eeb9d6af4 | |||
| cbefabb724 | |||
| f7f6cc64ce | |||
| 1408e4f64e | |||
| 0a68d2f4ee | |||
| 11a4a0436d | |||
| 2583800b2c |
+6
-2
@@ -1,6 +1,6 @@
|
||||
@ECHO OFF
|
||||
SET release=7.1.0
|
||||
SET comment=RC
|
||||
SET release=7.1.1
|
||||
SET comment=
|
||||
SET version=%release%
|
||||
|
||||
IF [%comment%] EQU [] (SET version=%release%) ELSE (SET version=%release%-%comment%)
|
||||
@@ -12,6 +12,9 @@ ECHO Installing the Microsoft.Bcl.Build package before anything else, otherwise
|
||||
SET nuGetFolder=%CD%\..\src\packages\
|
||||
..\src\.nuget\NuGet.exe install ..\src\Umbraco.Web.UI\packages.config -OutputDirectory %nuGetFolder%
|
||||
|
||||
ECHO Removing the belle build folder to make sure everything is clean as a whistle
|
||||
RD ..\src\Umbraco.Web.UI.Client\build /Q /S
|
||||
|
||||
ECHO Performing MSBuild and producing Umbraco binaries zip files
|
||||
%windir%\Microsoft.NET\Framework\v4.0.30319\msbuild.exe "Build.proj" /p:BUILD_RELEASE=%release% /p:BUILD_COMMENT=%comment%
|
||||
|
||||
@@ -30,6 +33,7 @@ echo This file is only here so that the containing folder will be included in th
|
||||
ECHO Adding Web.config transform files to the NuGet package
|
||||
ren .\_BuildOutput\WebApp\MacroScripts\Web.config Web.config.transform
|
||||
ren .\_BuildOutput\WebApp\Views\Web.config Web.config.transform
|
||||
ren .\_BuildOutput\WebApp\Xslt\Web.config Web.config.transform
|
||||
|
||||
ECHO Packing the NuGet release files
|
||||
..\src\.nuget\NuGet.exe pack NuSpecs\UmbracoCms.Core.nuspec -Version %version%
|
||||
|
||||
+11
-1
@@ -310,7 +310,12 @@
|
||||
</Target>
|
||||
|
||||
<Target Name="SetVersionNumber" Condition="'$(BUILD_RELEASE)'!=''">
|
||||
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
|
||||
<PropertyGroup>
|
||||
<NewVersion>$(BUILD_RELEASE)</NewVersion>
|
||||
<NewVersion Condition="'$(BUILD_COMMENT)'!=''">$(BUILD_RELEASE)-$(BUILD_COMMENT)</NewVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Match & replace 3 and 4 digit version numbers and -beta (if it's there) -->
|
||||
<FileUpdate
|
||||
Files="..\src\Umbraco.Core\Configuration\UmbracoVersion.cs"
|
||||
Regex="(\d+)\.(\d+)\.(\d+)(.(\d+))?"
|
||||
@@ -319,5 +324,10 @@
|
||||
<FileUpdate Files="..\src\Umbraco.Core\Configuration\UmbracoVersion.cs"
|
||||
Regex="CurrentComment { get { return "([a-zA-Z]+)?""
|
||||
ReplacementText="CurrentComment { get { return "$(BUILD_COMMENT)""/>
|
||||
|
||||
<XmlPoke XmlInputPath=".\NuSpecs\build\UmbracoCms.targets"
|
||||
Namespaces="<Namespace Prefix='x' Uri='http://schemas.microsoft.com/developer/msbuild/2003' />"
|
||||
Query="//x:UmbracoVersion"
|
||||
Value="$(NewVersion)" />
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -26,12 +26,12 @@
|
||||
<dependency id="SharpZipLib" version="[0.86.0, 1.0.0)" />
|
||||
<dependency id="MySql.Data" version="[6.6.5]" />
|
||||
<dependency id="xmlrpcnet" version="[2.5.0, 3.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.7.0, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc" version="[1.7.0, 2.0.0)" />
|
||||
<dependency id="ClientDependency" version="[1.7.1.2, 2.0.0)" />
|
||||
<dependency id="ClientDependency-Mvc" version="[1.7.0.4, 2.0.0)" />
|
||||
<dependency id="AutoMapper" version="[3.0.0, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[4.5.11, 5.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[1.8.6.1, 2.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[3.2.0, 4.0.0)" />
|
||||
<dependency id="Newtonsoft.Json" version="[6.0.2, 7.0.0)" />
|
||||
<dependency id="ImageProcessor" version="[1.8.7, 2.0.0)" />
|
||||
<dependency id="ImageProcessor.Web" version="[3.2.1, 4.0.0)" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
|
||||
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
</PropertyGroup>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
|
||||
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<UmbracoVersion>7.1.1</UmbracoVersion>
|
||||
</PropertyGroup>
|
||||
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
|
||||
<PropertyGroup>
|
||||
<UmbracoFilesFolder>..\packages\UmbracoCms.$(UmbracoVersion)\UmbracoFiles\</UmbracoFilesFolder>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<UmbracoFiles Include="$(UmbracoFilesFolder)**\*" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="%(UmbracoFiles.FullPath)" DestinationFiles="%(RecursiveDir)%(Filename)%(Extension)" Condition="!Exists('%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</Target>
|
||||
<Target Name="AddUmbracoFilesToOutput">
|
||||
<!-- With help from: http://blog.samstephens.co.nz/2010-10-18/msbuild-including-extra-files-multiple-builds/ -->
|
||||
<ItemGroup>
|
||||
<CustomFilesToInclude Include=".\App_Browsers\**\*">
|
||||
<Dir>App_Browsers</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\App_Code\**\*">
|
||||
<Dir>App_Code</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\App_Plugins\**\*">
|
||||
<Dir>App_Plugins</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\bin\amd64\**\*">
|
||||
<Dir>bin\amd64</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\bin\x86\**\*">
|
||||
<Dir>bin\x86</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\Config\Splashes\**\*">
|
||||
<Dir>Config\Splashes</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\umbraco\**\*">
|
||||
<Dir>umbraco</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\umbraco_client\**\*">
|
||||
<Dir>umbraco_client</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<CustomFilesToInclude Include=".\Global.asax">
|
||||
<Dir>.</Dir>
|
||||
</CustomFilesToInclude>
|
||||
<FilesForPackagingFromProject Include="@(CustomFilesToInclude)">
|
||||
<DestinationRelativePath>%(CustomFilesToInclude.Dir)\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Browsers\**\*" />
|
||||
<AppPluginsFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Plugins\**\*" />
|
||||
<SplashesFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\Config\Splashes\**\*;" />
|
||||
<SqlCeBinFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\bin\**\*;" />
|
||||
<UmbracoFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco_client\**\*;" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="%(AppBrowsersFiles.FullPath)"
|
||||
DestinationFiles="App_Browsers\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Browsers\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(AppPluginsFiles.FullPath)"
|
||||
DestinationFiles="App_Plugins\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Plugins\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SplashesFiles.FullPath)"
|
||||
DestinationFiles="Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SqlCeBinFiles.FullPath)"
|
||||
DestinationFiles="bin\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('bin\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoFiles.FullPath)"
|
||||
DestinationFiles="umbraco\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoClientFiles.FullPath)"
|
||||
DestinationFiles="umbraco_client\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco_client\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</Target>
|
||||
<Target Name="AddUmbracoFilesToOutput">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
|
||||
<AppCodeFiles Include=".\App_Code\**\*" />
|
||||
<AppPluginsFiles Include=".\App_Plugins\**\*" />
|
||||
<GlobalAsaxFile Include=".\Global.asax;" />
|
||||
<SqlCeAmd64Files Include=".\bin\amd64\**\*" />
|
||||
<SqlCeX86Files Include=".\bin\x86\**\*" />
|
||||
<SplashesFiles Include=".\Config\Splashes\**\*;" />
|
||||
<UmbracoFiles Include=".\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
|
||||
|
||||
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
|
||||
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppCodeFiles.Identity)">
|
||||
<DestinationRelativePath>App_Code\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppPluginsFiles.Identity)">
|
||||
<DestinationRelativePath>App_Plugins\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(GlobalAsaxFile.Identity)">
|
||||
<DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeAmd64Files.Identity)">
|
||||
<DestinationRelativePath>bin\amd64\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeX86Files.Identity)">
|
||||
<DestinationRelativePath>bin\x86\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SplashesFiles.Identity)">
|
||||
<DestinationRelativePath>Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
|
||||
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Browsers\**\*" />
|
||||
<AppPluginsFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Plugins\**\*" />
|
||||
<SplashesFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\Config\Splashes\**\*;" />
|
||||
<SqlCeBinFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\bin\**\*;" />
|
||||
<UmbracoFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco_client\**\*;" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="%(AppBrowsersFiles.FullPath)"
|
||||
DestinationFiles="App_Browsers\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Browsers\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(AppPluginsFiles.FullPath)"
|
||||
DestinationFiles="App_Plugins\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Plugins\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SplashesFiles.FullPath)"
|
||||
DestinationFiles="Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SqlCeBinFiles.FullPath)"
|
||||
DestinationFiles="bin\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('bin\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoFiles.FullPath)"
|
||||
DestinationFiles="umbraco\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoClientFiles.FullPath)"
|
||||
DestinationFiles="umbraco_client\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco_client\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</Target>
|
||||
<Target Name="AddUmbracoFilesToOutput">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
|
||||
<AppCodeFiles Include=".\App_Code\**\*" />
|
||||
<AppPluginsFiles Include=".\App_Plugins\**\*" />
|
||||
<GlobalAsaxFile Include=".\Global.asax;" />
|
||||
<SqlCeAmd64Files Include=".\bin\amd64\**\*" />
|
||||
<SqlCeX86Files Include=".\bin\x86\**\*" />
|
||||
<SplashesFiles Include=".\Config\Splashes\**\*;" />
|
||||
<UmbracoFiles Include=".\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
|
||||
|
||||
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
|
||||
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppCodeFiles.Identity)">
|
||||
<DestinationRelativePath>App_Code\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppPluginsFiles.Identity)">
|
||||
<DestinationRelativePath>App_Plugins\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(GlobalAsaxFile.Identity)">
|
||||
<DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeAmd64Files.Identity)">
|
||||
<DestinationRelativePath>bin\amd64\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeX86Files.Identity)">
|
||||
<DestinationRelativePath>bin\x86\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SplashesFiles.Identity)">
|
||||
<DestinationRelativePath>Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -1,14 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForPackageDependsOn>
|
||||
|
||||
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
AddUmbracoFilesToOutput;
|
||||
$(CopyAllFilesToSingleFolderForPackageDependsOn);
|
||||
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Target Name="CopyUmbracoFilesToWebRoot" BeforeTargets="AfterBuild">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Browsers\**\*" />
|
||||
<AppPluginsFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\App_Plugins\**\*" />
|
||||
<SplashesFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\Config\Splashes\**\*;" />
|
||||
<SqlCeBinFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\bin\**\*;" />
|
||||
<UmbracoFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include="..\packages\UmbracoCms.7.1.0-RC\UmbracoFiles\umbraco_client\**\*;" />
|
||||
</ItemGroup>
|
||||
<Copy SourceFiles="%(AppBrowsersFiles.FullPath)"
|
||||
DestinationFiles="App_Browsers\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Browsers\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(AppPluginsFiles.FullPath)"
|
||||
DestinationFiles="App_Plugins\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('App_Plugins\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SplashesFiles.FullPath)"
|
||||
DestinationFiles="Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(SqlCeBinFiles.FullPath)"
|
||||
DestinationFiles="bin\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('bin\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoFiles.FullPath)"
|
||||
DestinationFiles="umbraco\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
<Copy SourceFiles="%(UmbracoClientFiles.FullPath)"
|
||||
DestinationFiles="umbraco_client\%(RecursiveDir)%(Filename)%(Extension)"
|
||||
Condition="!Exists('umbraco_client\%(RecursiveDir)%(Filename)%(Extension)')" />
|
||||
</Target>
|
||||
<Target Name="AddUmbracoFilesToOutput">
|
||||
<ItemGroup>
|
||||
<AppBrowsersFiles Include=".\App_Browsers\**\*" />
|
||||
<AppCodeFiles Include=".\App_Code\**\*" />
|
||||
<AppPluginsFiles Include=".\App_Plugins\**\*" />
|
||||
<GlobalAsaxFile Include=".\Global.asax;" />
|
||||
<SqlCeAmd64Files Include=".\bin\amd64\**\*" />
|
||||
<SqlCeX86Files Include=".\bin\x86\**\*" />
|
||||
<SplashesFiles Include=".\Config\Splashes\**\*;" />
|
||||
<UmbracoFiles Include=".\umbraco\**\*;" />
|
||||
<UmbracoClientFiles Include=".\umbraco_client\**\*;" />
|
||||
|
||||
<FilesForPackagingFromProject Include="%(AppBrowsersFiles.Identity)">
|
||||
<DestinationRelativePath>App_Browsers\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppCodeFiles.Identity)">
|
||||
<DestinationRelativePath>App_Code\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(AppPluginsFiles.Identity)">
|
||||
<DestinationRelativePath>App_Plugins\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(GlobalAsaxFile.Identity)">
|
||||
<DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeAmd64Files.Identity)">
|
||||
<DestinationRelativePath>bin\amd64\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SqlCeX86Files.Identity)">
|
||||
<DestinationRelativePath>bin\x86\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(SplashesFiles.Identity)">
|
||||
<DestinationRelativePath>Config\Splashes\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
<FilesForPackagingFromProject Include="%(UmbracoClientFiles.Identity)">
|
||||
<DestinationRelativePath>umbraco_client\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
|
||||
</FilesForPackagingFromProject>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
@@ -2,10 +2,15 @@ A note about running Umbraco from Visual Studio.
|
||||
|
||||
When upgrading your website using NuGet you should answer "No" to the questions to overwrite the Web.config
|
||||
file (and config files in the config folder).
|
||||
We will overwrite Web.config anyway but we keep a backup in the App_Data\ConfigBackup folder. There you'll
|
||||
We will overwrite Web.config anyway but we keep a backup in the App_Data\NuGetBackup folder. There you'll
|
||||
find a folder with the current date and time in which the backup has been placed. Make sure to merge the
|
||||
new file with the old backup files before you proceed.
|
||||
Only the web.config will be overwritten by default to ensure that it has the necessary settings from the current release.
|
||||
The web.config will be overwritten by default to ensure that it has the necessary settings from the current release.
|
||||
|
||||
We've also overwritten all the files in the Umbraco and Umbraco_Client folder, these have also been backed up in
|
||||
App_Data\NuGetBackup. We didn't overwrite the UI.xml file nor did we remove any files or folders that you or a package
|
||||
might have added. Only the existing files were overwritten. If you customized anything then make sure to do a compare
|
||||
and merge with the NuGetBackup folder.
|
||||
|
||||
The config files found in the config folder will usually not be changed for patch releases, so they can usually be skipped,
|
||||
but the web.config will have to have its previous "umbracoConfigurationStatus"-appsetting and "umbracoDbDSN" connection string
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
param($rootPath, $toolsPath, $package, $project)
|
||||
|
||||
if ($project) {
|
||||
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
|
||||
$backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\ConfigBackup\$dateTime"
|
||||
if ($project) {
|
||||
$dateTime = Get-Date -Format yyyyMMdd-HHmmss
|
||||
$backupPath = Join-Path (Split-Path $project.FullName -Parent) "\App_Data\NuGetBackup\$dateTime"
|
||||
|
||||
# Create backup folder if it doesn't exist yet
|
||||
New-Item -ItemType Directory -Force -Path $backupPath
|
||||
@@ -15,7 +15,24 @@ if ($project) {
|
||||
# Copy Web.config from package to project folder
|
||||
$umbracoFilesPath = Join-Path $rootPath "UmbracoFiles\Web.config"
|
||||
Copy-Item $umbracoFilesPath $projectDestinationPath -Force
|
||||
|
||||
|
||||
# Copy umbraco and umbraco_files from package to project folder
|
||||
# This is only done when these folders already exist because we
|
||||
# only want to do this for upgrades
|
||||
$umbracoFolder = Join-Path $projectDestinationPath "Umbraco\"
|
||||
if(Test-Path $umbracoFolder) {
|
||||
$umbracoFolderSource = Join-Path $rootPath "UmbracoFiles\Umbraco"
|
||||
Copy-Item $umbracoFolder $backupPath -Force
|
||||
robocopy $umbracoFolderSource $umbracoFolder /e /xf UI.xml
|
||||
}
|
||||
|
||||
$umbracoClientFolder = Join-Path $projectDestinationPath "Umbraco_Client"
|
||||
if(Test-Path $umbracoClientFolder) {
|
||||
$umbracoClientFolderSource = Join-Path $rootPath "UmbracoFiles\Umbraco_Client"
|
||||
Copy-Item $umbracoClientFolder $backupPath -Force
|
||||
robocopy $umbracoFolderSource $umbracoClientFolder /e
|
||||
}
|
||||
|
||||
# Open readme.txt file
|
||||
$DTE.ItemOperations.OpenFile($toolsPath + '\Readme.txt')
|
||||
}
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Configuration
|
||||
{
|
||||
public class UmbracoVersion
|
||||
{
|
||||
private static readonly Version Version = new Version("7.1.0");
|
||||
private static readonly Version Version = new Version("7.1.1");
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current version of Umbraco.
|
||||
@@ -23,7 +23,7 @@ namespace Umbraco.Core.Configuration
|
||||
/// Gets the version comment (like beta or RC).
|
||||
/// </summary>
|
||||
/// <value>The version comment.</value>
|
||||
public static string CurrentComment { get { return "RC"; } }
|
||||
public static string CurrentComment { get { return ""; } }
|
||||
|
||||
// Get the version of the umbraco.dll by looking at a class in that dll
|
||||
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
|
||||
|
||||
@@ -5,10 +5,17 @@
|
||||
/// </summary>
|
||||
public class PreValue
|
||||
{
|
||||
public PreValue(int id, string value, int sortOrder)
|
||||
{
|
||||
Id = id;
|
||||
Value = value;
|
||||
SortOrder = sortOrder;
|
||||
}
|
||||
|
||||
public PreValue(int id, string value)
|
||||
{
|
||||
Value = value;
|
||||
Id = id;
|
||||
Id = id;
|
||||
Value = value;
|
||||
}
|
||||
|
||||
public PreValue(string value)
|
||||
@@ -25,5 +32,10 @@
|
||||
/// The database id for the pre-value field value
|
||||
/// </summary>
|
||||
public int Id { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The sort order stored for the pre-value field value
|
||||
/// </summary>
|
||||
public int SortOrder { get; private set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Concurrent;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Mappers
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a <see cref="Tag"/> to DTO mapper used to translate the properties of the public api
|
||||
/// implementation to that of the database's DTO as sql: [tableName].[columnName].
|
||||
/// </summary>
|
||||
[MapperFor(typeof(Tag))]
|
||||
[MapperFor(typeof(ITag))]
|
||||
public sealed class TagMapper : BaseMapper
|
||||
{
|
||||
private static readonly ConcurrentDictionary<string, DtoMapModel> PropertyInfoCacheInstance = new ConcurrentDictionary<string, DtoMapModel>();
|
||||
|
||||
//NOTE: its an internal class but the ctor must be public since we're using Activator.CreateInstance to create it
|
||||
// otherwise that would fail because there is no public constructor.
|
||||
public TagMapper()
|
||||
{
|
||||
BuildMap();
|
||||
}
|
||||
|
||||
#region Overrides of BaseMapper
|
||||
|
||||
internal override ConcurrentDictionary<string, DtoMapModel> PropertyInfoCache
|
||||
{
|
||||
get { return PropertyInfoCacheInstance; }
|
||||
}
|
||||
|
||||
internal override void BuildMap()
|
||||
{
|
||||
if (PropertyInfoCache.IsEmpty)
|
||||
{
|
||||
CacheMap<Tag, TagDto>(src => src.Id, dto => dto.Id);
|
||||
CacheMap<Tag, TagDto>(src => src.Text, dto => dto.Tag);
|
||||
CacheMap<Tag, TagDto>(src => src.Group, dto => dto.Group);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+54
-30
@@ -7,6 +7,7 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
@@ -32,48 +33,71 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSeven
|
||||
var propertyData =
|
||||
database.Fetch<PropertyDataDto>(
|
||||
"WHERE propertyTypeId in (SELECT id from cmsPropertyType where dataTypeID IN (@dataTypeIds))", new { dataTypeIds = dataTypeIds });
|
||||
if (!propertyData.Any()) return string.Empty;
|
||||
|
||||
var nodesIdsWithProperty = propertyData.Select(x => x.NodeId).Distinct();
|
||||
var cmsContentXmlEntries = database.Fetch<ContentXmlDto>(
|
||||
"WHERE nodeId in (@nodeIds)", new { nodeIds = nodesIdsWithProperty });
|
||||
var propertyTypeIds = propertyData.Select(x => x.PropertyTypeId).Distinct();
|
||||
var propertyTypes = database.Fetch<PropertyTypeDto>(
|
||||
"WHERE id in (@propertyTypeIds)", new { propertyTypeIds = propertyTypeIds });
|
||||
|
||||
foreach (var data in propertyData)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(data.Text))
|
||||
if (string.IsNullOrEmpty(data.Text) == false)
|
||||
{
|
||||
//var cs = ApplicationContext.Current.Services.ContentService;
|
||||
|
||||
//fetch the current data (that's in xml format)
|
||||
var xml = new XmlDocument();
|
||||
xml.LoadXml(data.Text);
|
||||
|
||||
if (xml != null)
|
||||
var links = new List<ExpandoObject>();
|
||||
|
||||
//loop all the stored links
|
||||
foreach (XmlNode node in xml.DocumentElement.ChildNodes)
|
||||
{
|
||||
var links = new List<ExpandoObject>();
|
||||
var title = node.Attributes["title"].Value;
|
||||
var type = node.Attributes["type"].Value;
|
||||
var newwindow = node.Attributes["newwindow"].Value.Equals("1") ? true : false;
|
||||
var lnk = node.Attributes["link"].Value;
|
||||
|
||||
//loop all the stored links
|
||||
foreach (XmlNode node in xml.DocumentElement.ChildNodes)
|
||||
{
|
||||
var title = node.Attributes["title"].Value;
|
||||
var type = node.Attributes["type"].Value;
|
||||
var newwindow = node.Attributes["newwindow"].Value.Equals("1") ? true : false;
|
||||
var lnk = node.Attributes["link"].Value;
|
||||
//create the links in the format the new prop editor expects it to be
|
||||
var link = new ExpandoObject() as IDictionary<string, Object>;
|
||||
link.Add("title", title);
|
||||
link.Add("caption", title);
|
||||
link.Add("link", lnk);
|
||||
link.Add("newWindow", newwindow);
|
||||
link.Add("type", type.Equals("internal") ? "internal" : "external");
|
||||
link.Add("internal", type.Equals("internal") ? lnk : null);
|
||||
|
||||
//create the links in the format the new prop editor expects it to be
|
||||
var link = new ExpandoObject() as IDictionary<string, Object>;
|
||||
link.Add("title", title);
|
||||
link.Add("caption", title);
|
||||
link.Add("link", lnk);
|
||||
link.Add("newWindow", newwindow);
|
||||
link.Add("type", type.Equals("internal") ? "internal" : "external");
|
||||
link.Add("internal", type.Equals("internal") ? lnk : null);
|
||||
link.Add("edit", false);
|
||||
link.Add("isInternal", type.Equals("internal"));
|
||||
|
||||
link.Add("edit", false);
|
||||
link.Add("isInternal", type.Equals("internal"));
|
||||
|
||||
links.Add((ExpandoObject)link);
|
||||
}
|
||||
|
||||
//store the serialized data
|
||||
data.Text = JsonConvert.SerializeObject(links);
|
||||
|
||||
database.Update(data);
|
||||
links.Add((ExpandoObject)link);
|
||||
}
|
||||
|
||||
//store the serialized data
|
||||
data.Text = JsonConvert.SerializeObject(links);
|
||||
|
||||
database.Update(data);
|
||||
|
||||
//now we need to update the cmsContentXml table
|
||||
var propertyType = propertyTypes.SingleOrDefault(x => x.Id == data.PropertyTypeId);
|
||||
if (propertyType != null)
|
||||
{
|
||||
var xmlItem = cmsContentXmlEntries.SingleOrDefault(x => x.NodeId == data.NodeId);
|
||||
if (xmlItem != null)
|
||||
{
|
||||
var x = XElement.Parse(xmlItem.Xml);
|
||||
var prop = x.Element(propertyType.Alias);
|
||||
if (prop != null)
|
||||
{
|
||||
prop.ReplaceAll(new XCData(data.Text));
|
||||
database.Update(xmlItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
}
|
||||
else
|
||||
{
|
||||
//In order to update the ContentVersion we need to retreive its primary key id
|
||||
//In order to update the ContentVersion we need to retrieve its primary key id
|
||||
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
|
||||
contentVersionDto.Id = contentVerDto.Id;
|
||||
|
||||
@@ -638,4 +638,4 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
return currentName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,8 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
foreach (var textDto in dto.LanguageTextDtos)
|
||||
{
|
||||
var language = _languageRepository.Get(textDto.LanguageId);
|
||||
if (language == null)
|
||||
continue;
|
||||
var translationFactory = new DictionaryTranslationFactory(dto.UniqueId, language);
|
||||
list.Add(translationFactory.BuildEntity(textDto));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
var sql = GetBaseQuery(false);
|
||||
sql.Where(GetBaseWhereClause(), new { Id = id });
|
||||
|
||||
var languageDto = Database.First<LanguageDto>(sql);
|
||||
var languageDto = Database.FirstOrDefault<LanguageDto>(sql);
|
||||
if (languageDto == null)
|
||||
return null;
|
||||
|
||||
|
||||
@@ -299,7 +299,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
Database.Update(newContentDto);
|
||||
}
|
||||
|
||||
//In order to update the ContentVersion we need to retreive its primary key id
|
||||
//In order to update the ContentVersion we need to retrieve its primary key id
|
||||
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
|
||||
dto.Id = contentVerDto.Id;
|
||||
//Updates the current version - cmsContentVersion
|
||||
@@ -403,4 +403,4 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
return currentName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
Database.Update(newContentDto);
|
||||
}
|
||||
|
||||
//In order to update the ContentVersion we need to retreive its primary key id
|
||||
//In order to update the ContentVersion we need to retrieve its primary key id
|
||||
var contentVerDto = Database.SingleOrDefault<ContentVersionDto>("WHERE VersionId = @Version", new { Version = entity.Version });
|
||||
dto.ContentVersionDto.Id = contentVerDto.Id;
|
||||
//Updates the current version - cmsContentVersion
|
||||
@@ -646,4 +646,4 @@ namespace Umbraco.Core.Persistence.Repositories
|
||||
return entities;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
var sourceString = source.ToString();
|
||||
if (string.IsNullOrWhiteSpace(sourceString)) return Enumerable.Empty<string>();
|
||||
|
||||
//SD: I have no idea why this logic is here, I'm pretty sure we've never saved the multiple txt string
|
||||
// as xml in the database, it's always been new line delimited. Will ask Stephen about this.
|
||||
// In the meantime, we'll do this xml check, see if it parses and if not just continue with
|
||||
// splitting by newline
|
||||
var values = new List<string>();
|
||||
var pos = sourceString.IndexOf("<value>", StringComparison.Ordinal);
|
||||
while (pos >= 0)
|
||||
@@ -41,6 +45,13 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
|
||||
values.Add(value);
|
||||
pos = sourceString.IndexOf("<value>", pos, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
// Fall back on normal behaviour
|
||||
if (values.Any() == false)
|
||||
{
|
||||
return sourceString.Split(Environment.NewLine.ToCharArray());
|
||||
}
|
||||
|
||||
return values.ToArray();
|
||||
}
|
||||
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Umbraco.Core.Services
|
||||
using (var uow = _uowProvider.GetUnitOfWork())
|
||||
{
|
||||
var dtos = uow.Database.Fetch<DataTypePreValueDto>("WHERE datatypeNodeId = @Id", new { Id = id });
|
||||
var list = dtos.Select(x => new Tuple<PreValue, string, int>(new PreValue(x.Id, x.Value), x.Alias, x.SortOrder)).ToList();
|
||||
var list = dtos.Select(x => new Tuple<PreValue, string, int>(new PreValue(x.Id, x.Value, x.SortOrder), x.Alias, x.SortOrder)).ToList();
|
||||
|
||||
return PreValueConverter.ConvertToPreValuesCollection(list);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object from the path stored in the 'umbracoFile' property.
|
||||
/// </summary>
|
||||
/// <param name="mediaPath">Path of the media item to retreive (for example: /media/1024/koala_403x328.jpg)</param>
|
||||
/// <param name="mediaPath">Path of the media item to retrieve (for example: /media/1024/koala_403x328.jpg)</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia GetMediaByPath(string mediaPath);
|
||||
|
||||
@@ -272,4 +272,4 @@ namespace Umbraco.Core.Services
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
IMedia CreateMediaWithIdentity(string name, int parentId, string mediaTypeAlias, int userId = 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,13 @@ namespace Umbraco.Core.Services
|
||||
IEnumerable<T> GetMembersInRole(string roleName);
|
||||
IEnumerable<T> FindMembersInRole(string roleName, string usernameToMatch, StringPropertyMatchType matchType = StringPropertyMatchType.StartsWith);
|
||||
bool DeleteRole(string roleName, bool throwIfBeingUsed);
|
||||
void AssignRole(string username, string roleName);
|
||||
void AssignRoles(string[] usernames, string[] roleNames);
|
||||
void DissociateRole(string username, string roleName);
|
||||
void DissociateRoles(string[] usernames, string[] roleNames);
|
||||
void AssignRole(int memberId, string roleName);
|
||||
void AssignRoles(int[] memberIds, string[] roleNames);
|
||||
void DissociateRole(int memberId, string roleName);
|
||||
void DissociateRoles(int[] memberIds, string[] roleNames);
|
||||
}
|
||||
}
|
||||
@@ -63,6 +63,21 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByParentId(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their parent entity
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent Entity to retrieve relations for</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByParent(IUmbracoEntity parent);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their parent entity
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent Entity to retrieve relations for</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Id
|
||||
/// </summary>
|
||||
@@ -70,6 +85,21 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByChildId(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Entity
|
||||
/// </summary>
|
||||
/// <param name="child">Child Entity to retrieve relations for</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByChild(IUmbracoEntity child);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Entity
|
||||
/// </summary>
|
||||
/// <param name="child">Child Entity to retrieve relations for</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
IEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child or parent Id.
|
||||
/// Using this method will get you all relations regards of it being a child or parent relation.
|
||||
@@ -190,6 +220,23 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>Returns <c>True</c> if any relations exists with the given Ids, otherwise <c>False</c></returns>
|
||||
bool AreRelated(int parentId, int childId);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether two items are related
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent entity</param>
|
||||
/// <param name="child">Child entity</param>
|
||||
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
|
||||
bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether two items are related
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent entity</param>
|
||||
/// <param name="child">Child entity</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to create</param>
|
||||
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
|
||||
bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a <see cref="Relation"/>
|
||||
/// </summary>
|
||||
|
||||
@@ -451,7 +451,7 @@ namespace Umbraco.Core.Services
|
||||
/// <summary>
|
||||
/// Gets an <see cref="IMedia"/> object from the path stored in the 'umbracoFile' property.
|
||||
/// </summary>
|
||||
/// <param name="mediaPath">Path of the media item to retreive (for example: /media/1024/koala_403x328.jpg)</param>
|
||||
/// <param name="mediaPath">Path of the media item to retrieve (for example: /media/1024/koala_403x328.jpg)</param>
|
||||
/// <returns><see cref="IMedia"/></returns>
|
||||
public IMedia GetMediaByPath(string mediaPath)
|
||||
{
|
||||
@@ -1109,4 +1109,4 @@ namespace Umbraco.Core.Services
|
||||
public static event TypedEventHandler<IMediaService, RecycleBinEventArgs> EmptiedRecycleBin;
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,18 +109,21 @@ namespace Umbraco.Core.Services
|
||||
{
|
||||
provider.ChangePassword(member.Username, "", password);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new NotSupportedException("When using a non-Umbraco membership provider you must change the member password by using the MembershipProvider.ChangePassword method");
|
||||
}
|
||||
|
||||
//go re-fetch the member and update the properties that may have changed
|
||||
var result = GetByUsername(member.Username);
|
||||
if (result != null)
|
||||
{
|
||||
//should never be null but it could have been deleted by another thread.
|
||||
member.RawPasswordValue = result.RawPasswordValue;
|
||||
member.LastPasswordChangeDate = result.LastPasswordChangeDate;
|
||||
member.UpdateDate = member.UpdateDate;
|
||||
}
|
||||
|
||||
throw new NotSupportedException("When using a non-Umbraco membership provider you must change the member password by using the MembershipProvider.ChangePassword method");
|
||||
|
||||
//should never be null but it could have been deleted by another thread.
|
||||
if (result == null)
|
||||
return;
|
||||
|
||||
member.RawPasswordValue = result.RawPasswordValue;
|
||||
member.LastPasswordChangeDate = result.LastPasswordChangeDate;
|
||||
member.UpdateDate = member.UpdateDate;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -959,6 +962,10 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
}
|
||||
public void AssignRole(string username, string roleName)
|
||||
{
|
||||
AssignRoles(new[] { username }, new[] { roleName });
|
||||
}
|
||||
|
||||
public void AssignRoles(string[] usernames, string[] roleNames)
|
||||
{
|
||||
@@ -969,6 +976,11 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public void DissociateRole(string username, string roleName)
|
||||
{
|
||||
DissociateRoles(new[] { username }, new[] { roleName });
|
||||
}
|
||||
|
||||
public void DissociateRoles(string[] usernames, string[] roleNames)
|
||||
{
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
@@ -977,6 +989,11 @@ namespace Umbraco.Core.Services
|
||||
repository.DissociateRoles(usernames, roleNames);
|
||||
}
|
||||
}
|
||||
|
||||
public void AssignRole(int memberId, string roleName)
|
||||
{
|
||||
AssignRoles(new[] { memberId }, new[] { roleName });
|
||||
}
|
||||
|
||||
public void AssignRoles(int[] memberIds, string[] roleNames)
|
||||
{
|
||||
@@ -987,6 +1004,11 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public void DissociateRole(int memberId, string roleName)
|
||||
{
|
||||
DissociateRoles(new[] { memberId }, new[] { roleName });
|
||||
}
|
||||
|
||||
public void DissociateRoles(int[] memberIds, string[] roleNames)
|
||||
{
|
||||
var uow = _uowProvider.GetUnitOfWork();
|
||||
@@ -1023,7 +1045,7 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rebuilds all xml content in the cmsContentXml table for all media
|
||||
/// Rebuilds all xml content in the cmsContentXml table for all members
|
||||
/// </summary>
|
||||
/// <param name="memberTypeIds">
|
||||
/// Only rebuild the xml structures for the content type ids passed in, if none then rebuilds the structures
|
||||
|
||||
@@ -128,6 +128,27 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their parent entity
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent Entity to retrieve relations for</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent)
|
||||
{
|
||||
return GetByParentId(parent.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their parent entity
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent Entity to retrieve relations for</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
public IEnumerable<IRelation> GetByParent(IUmbracoEntity parent, string relationTypeAlias)
|
||||
{
|
||||
return GetByParent(parent).Where(relation => relation.RelationType.Alias == relationTypeAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Id
|
||||
/// </summary>
|
||||
@@ -142,6 +163,27 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Entity
|
||||
/// </summary>
|
||||
/// <param name="child">Child Entity to retrieve relations for</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child)
|
||||
{
|
||||
return GetByChildId(child.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child Entity
|
||||
/// </summary>
|
||||
/// <param name="child">Child Entity to retrieve relations for</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to retrieve</param>
|
||||
/// <returns>An enumerable list of <see cref="Relation"/> objects</returns>
|
||||
public IEnumerable<IRelation> GetByChild(IUmbracoEntity child, string relationTypeAlias)
|
||||
{
|
||||
return GetByChild(child).Where(relation => relation.RelationType.Alias == relationTypeAlias);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of <see cref="Relation"/> objects by their child or parent Id.
|
||||
/// Using this method will get you all relations regards of it being a child or parent relation.
|
||||
@@ -422,7 +464,7 @@ namespace Umbraco.Core.Services
|
||||
public bool AreRelated(int parentId, int childId, string relationTypeAlias)
|
||||
{
|
||||
var relType = GetRelationTypeByAlias(relationTypeAlias);
|
||||
if(relType == null)
|
||||
if (relType == null)
|
||||
return false;
|
||||
|
||||
return AreRelated(parentId, childId, relType);
|
||||
@@ -445,6 +487,29 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether two items are related
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent entity</param>
|
||||
/// <param name="child">Child entity</param>
|
||||
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
|
||||
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child)
|
||||
{
|
||||
return AreRelated(parent.Id, child.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether two items are related
|
||||
/// </summary>
|
||||
/// <param name="parent">Parent entity</param>
|
||||
/// <param name="child">Child entity</param>
|
||||
/// <param name="relationTypeAlias">Alias of the type of relation to create</param>
|
||||
/// <returns>Returns <c>True</c> if any relations exist between the entities, otherwise <c>False</c></returns>
|
||||
public bool AreRelated(IUmbracoEntity parent, IUmbracoEntity child, string relationTypeAlias)
|
||||
{
|
||||
return AreRelated(parent.Id, child.Id, relationTypeAlias);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Saves a <see cref="Relation"/>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// An interface exposing a server address to use for server syncing
|
||||
/// </summary>
|
||||
internal interface IServerAddress
|
||||
public interface IServerAddress
|
||||
{
|
||||
string ServerAddress { get; }
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// Defines a server messenger for server sync and distrubuted cache
|
||||
/// </summary>
|
||||
internal interface IServerMessenger
|
||||
public interface IServerMessenger
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// An interface to expose a list of server registrations for server syncing
|
||||
/// </summary>
|
||||
internal interface IServerRegistrar
|
||||
public interface IServerRegistrar
|
||||
{
|
||||
IEnumerable<IServerAddress> Registrations { get; }
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// A resolver to return the currently registered IServerMessenger object
|
||||
/// </summary>
|
||||
internal class ServerMessengerResolver : SingleObjectResolverBase<ServerMessengerResolver, IServerMessenger>
|
||||
public sealed class ServerMessengerResolver : SingleObjectResolverBase<ServerMessengerResolver, IServerMessenger>
|
||||
{
|
||||
internal ServerMessengerResolver(IServerMessenger factory)
|
||||
: base(factory)
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// The resolver to return the currently registered IServerRegistrar object
|
||||
/// </summary>
|
||||
internal class ServerRegistrarResolver : SingleObjectResolverBase<ServerRegistrarResolver, IServerRegistrar>
|
||||
public sealed class ServerRegistrarResolver : SingleObjectResolverBase<ServerRegistrarResolver, IServerRegistrar>
|
||||
{
|
||||
|
||||
internal ServerRegistrarResolver(IServerRegistrar factory)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
@@ -364,6 +364,7 @@
|
||||
<Compile Include="Persistence\EntityNotFoundException.cs" />
|
||||
<Compile Include="Persistence\Factories\MemberGroupFactory.cs" />
|
||||
<Compile Include="Persistence\Mappers\MemberGroupMapper.cs" />
|
||||
<Compile Include="Persistence\Mappers\TagMapper.cs" />
|
||||
<Compile Include="Persistence\Migrations\DataLossException.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenOneZero\AssignMissingPrimaryForMySqlKeys.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSixTwoZero\AssignMissingPrimaryForMySqlKeys.cs" />
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<package id="Microsoft.Net.Http" version="2.0.20710.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
||||
<package id="MiniProfiler" version="2.1.0" targetFramework="net40" />
|
||||
<package id="Newtonsoft.Json" version="4.5.11" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
<package id="MySql.Data" version="6.6.5" targetFramework="net40" />
|
||||
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
|
||||
</packages>
|
||||
@@ -120,6 +120,14 @@
|
||||
|
||||
</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>
|
||||
|
||||
@@ -4,12 +4,15 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using AutoMapper;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Dictionary;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Tests.TestHelpers;
|
||||
using Umbraco.Tests.TestHelpers.Entities;
|
||||
using Umbraco.Web.Dictionary;
|
||||
using Umbraco.Web.Models.ContentEditing;
|
||||
using Umbraco.Web.Models.Mapping;
|
||||
using umbraco;
|
||||
@@ -21,6 +24,14 @@ namespace Umbraco.Tests.Models.Mapping
|
||||
[TestFixture]
|
||||
public class ContentWebModelMappingTests : BaseDatabaseFactoryTest
|
||||
{
|
||||
protected override void FreezeResolution()
|
||||
{
|
||||
CultureDictionaryFactoryResolver.Current = new CultureDictionaryFactoryResolver(
|
||||
Mock.Of<ICultureDictionaryFactory>());
|
||||
|
||||
base.FreezeResolution();
|
||||
}
|
||||
|
||||
[PropertyEditor("Test.Test", "Test", "~/Test.html")]
|
||||
public class TestPropertyEditor : PropertyEditor
|
||||
{
|
||||
|
||||
@@ -67,6 +67,38 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Get_Ignores_Item_WhenLanguageMissing()
|
||||
{
|
||||
// Arrange
|
||||
var language = ServiceContext.LocalizationService.GetLanguageByCultureCode("en-US");
|
||||
var itemMissingLanguage = new DictionaryItem("I have invalid language");
|
||||
var translations = new List<IDictionaryTranslation>
|
||||
{
|
||||
new DictionaryTranslation(new Language("") { Id = 0 }, ""),
|
||||
new DictionaryTranslation(language, "I have language")
|
||||
};
|
||||
itemMissingLanguage.Translations = translations;
|
||||
ServiceContext.LocalizationService.Save(itemMissingLanguage);//Id 3?
|
||||
|
||||
var provider = new PetaPocoUnitOfWorkProvider();
|
||||
var unitOfWork = provider.GetUnitOfWork();
|
||||
LanguageRepository languageRepository;
|
||||
using (var repository = CreateRepository(unitOfWork, out languageRepository))
|
||||
{
|
||||
// Act
|
||||
var dictionaryItem = repository.Get(3);
|
||||
|
||||
// Assert
|
||||
Assert.That(dictionaryItem, Is.Not.Null);
|
||||
Assert.That(dictionaryItem.ItemKey, Is.EqualTo("I have invalid language"));
|
||||
Assert.That(dictionaryItem.Translations.Any(), Is.True);
|
||||
Assert.That(dictionaryItem.Translations.Any(x => x == null), Is.False);
|
||||
Assert.That(dictionaryItem.Translations.First().Value, Is.EqualTo("I have language"));
|
||||
Assert.That(dictionaryItem.Translations.Count(), Is.EqualTo(1));
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Perform_GetAll_On_DictionaryRepository()
|
||||
{
|
||||
|
||||
@@ -60,6 +60,22 @@ namespace Umbraco.Tests.Persistence.Repositories
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Get_WhenIdDoesntExist_ReturnsNull()
|
||||
{
|
||||
// Arrange
|
||||
var provider = new PetaPocoUnitOfWorkProvider();
|
||||
var unitOfWork = provider.GetUnitOfWork();
|
||||
using (var repository = CreateRepository(unitOfWork))
|
||||
{
|
||||
// Act
|
||||
var language = repository.Get(0);
|
||||
|
||||
// Assert
|
||||
Assert.That(language, Is.Null);
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Can_Perform_GetAll_On_LanguageRepository()
|
||||
{
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Umbraco.Tests
|
||||
public void Resolves_Assigned_Mappers()
|
||||
{
|
||||
var foundTypes1 = PluginManager.Current.ResolveAssignedMapperTypes();
|
||||
Assert.AreEqual(21, foundTypes1.Count());
|
||||
Assert.AreEqual(22, foundTypes1.Count());
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -9,15 +9,36 @@ namespace Umbraco.Tests.PropertyEditors
|
||||
[TestFixture]
|
||||
public class ImageCropperTest
|
||||
{
|
||||
private const string cropperJson = "{\"focalPoint\": {\"left\": 0.96,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0671.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}";
|
||||
|
||||
private const string mediaPath = "/media/1005/img_0671.jpg";
|
||||
|
||||
[Test]
|
||||
public void GetCropUrl_Test()
|
||||
public void GetCropUrl_CropAliasTest()
|
||||
{
|
||||
var cropperJson =
|
||||
"{\"src\": \"/media/1001/img_0671.jpg\",\"crops\": [{\"alias\": \"Thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.36664230810213955,\"y1\": 0.25767203967761981,\"x2\": 0.48805391012476662,\"y2\": 0.54858958462492169}}],\"focalPoint\": {\"left\": 0.8075,\"top\": 0.8666666666666667}}";
|
||||
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "Thumb", useCropDimensions: true);
|
||||
Assert.AreEqual(mediaPath + "?crop=0.58729977382575338,0.055768992440203169,0,0.32457553600198386&cropmode=percentage&width=100&height=100", urlString);
|
||||
}
|
||||
|
||||
var urlString = "/media/1001/img_0671.jpg".GetCropUrl(imageCropperValue:cropperJson, cropAlias:"Thumb", width:100, height:100);
|
||||
[Test]
|
||||
public void GetCropUrl_WidthHeightTest()
|
||||
{
|
||||
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 200, height: 300);
|
||||
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=200&height=300", urlString);
|
||||
}
|
||||
|
||||
Assert.AreEqual(urlString, "/media/1001/img_0671.jpg?crop=0.36664230810213955,0.25767203967761981,0.48805391012476662,0.54858958462492169&cropmode=percentage&width=100&height=100");
|
||||
[Test]
|
||||
public void GetCropUrl_FocalPointTest()
|
||||
{
|
||||
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "thumb", preferFocalPoint: true, useCropDimensions: true);
|
||||
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=100&height=100", urlString);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void GetCropUrlFurtherOptionsTest()
|
||||
{
|
||||
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 200, height: 300, furtherOptions: "&filter=comic&roundedcorners=radius-26|bgcolor-fff");
|
||||
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=200&height=300&filter=comic&roundedcorners=radius-26|bgcolor-fff", urlString);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+113
-113
@@ -1,114 +1,114 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Tests.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests for the base classes of ValueEditors and PreValueEditors that are used for Property Editors that edit
|
||||
/// multiple values such as the drop down list, check box list, color picker, etc....
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class MultiValuePropertyEditorTests
|
||||
{
|
||||
//TODO: Test the other formatting methods for the drop down classes
|
||||
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_With_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(true, dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234,4567,8910");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("1234,4567,8910", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_No_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(4567, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(8910, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(false, dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234,4567,8910");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("Value 1,Value 2,Value 3", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownValueEditor_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(10, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(11, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValueValueEditor(dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("Value 2", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownPreValueEditor_Format_Data_For_Editor()
|
||||
{
|
||||
|
||||
var defaultVals = new Dictionary<string, object>();
|
||||
var persisted = new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"item1", new PreValue(1, "Item 1")},
|
||||
{"item2", new PreValue(2, "Item 2")},
|
||||
{"item3", new PreValue(3, "Item 3")}
|
||||
});
|
||||
|
||||
var editor = new ValueListPreValueEditor();
|
||||
|
||||
var result = editor.ConvertDbToEditor(defaultVals, persisted);
|
||||
|
||||
Assert.AreEqual(1, result.Count);
|
||||
Assert.IsTrue(result.ContainsKey("items"));
|
||||
var items = result["items"] as IDictionary<int, string>;
|
||||
Assert.IsNotNull(items);
|
||||
Assert.AreEqual("Item 1", items[1]);
|
||||
Assert.AreEqual("Item 2", items[2]);
|
||||
Assert.AreEqual("Item 3", items[3]);
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Moq;
|
||||
using NUnit.Framework;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.PropertyEditors;
|
||||
using Umbraco.Core.Services;
|
||||
using Umbraco.Web.PropertyEditors;
|
||||
|
||||
namespace Umbraco.Tests.PropertyEditors
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests for the base classes of ValueEditors and PreValueEditors that are used for Property Editors that edit
|
||||
/// multiple values such as the drop down list, check box list, color picker, etc....
|
||||
/// </summary>
|
||||
[TestFixture]
|
||||
public class MultiValuePropertyEditorTests
|
||||
{
|
||||
//TODO: Test the other formatting methods for the drop down classes
|
||||
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_With_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(true, dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234,4567,8910");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("1234,4567,8910", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownMultipleValueEditor_No_Keys_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(4567, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(8910, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValuesMultipleValueEditor(false, dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234,4567,8910");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("Value 1,Value 2,Value 3", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownValueEditor_Format_Data_For_Cache()
|
||||
{
|
||||
var dataTypeServiceMock = new Mock<IDataTypeService>();
|
||||
dataTypeServiceMock
|
||||
.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>()))
|
||||
.Returns(new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"key0", new PreValue(10, "Value 1")},
|
||||
{"key1", new PreValue(1234, "Value 2")},
|
||||
{"key2", new PreValue(11, "Value 3")}
|
||||
}));
|
||||
|
||||
var dataTypeService = dataTypeServiceMock.Object;
|
||||
var editor = new PublishValueValueEditor(dataTypeService, new PropertyValueEditor());
|
||||
|
||||
var prop = new Property(1, Guid.NewGuid(),
|
||||
new PropertyType(new DataTypeDefinition(1, "Test.TestEditor")),
|
||||
"1234");
|
||||
|
||||
var result = editor.ConvertDbToString(prop, prop.PropertyType, new Mock<IDataTypeService>().Object);
|
||||
|
||||
Assert.AreEqual("Value 2", result);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void DropDownPreValueEditor_Format_Data_For_Editor()
|
||||
{
|
||||
|
||||
var defaultVals = new Dictionary<string, object>();
|
||||
var persisted = new PreValueCollection(new Dictionary<string, PreValue>
|
||||
{
|
||||
{"item1", new PreValue(1, "Item 1")},
|
||||
{"item2", new PreValue(2, "Item 2")},
|
||||
{"item3", new PreValue(3, "Item 3")}
|
||||
});
|
||||
|
||||
var editor = new ValueListPreValueEditor();
|
||||
|
||||
var result = editor.ConvertDbToEditor(defaultVals, persisted);
|
||||
|
||||
Assert.AreEqual(1, result.Count);
|
||||
Assert.IsTrue(result.ContainsKey("items"));
|
||||
var items = result["items"] as IDictionary<int, IDictionary<string, object>>;
|
||||
Assert.IsNotNull(items);
|
||||
Assert.AreEqual("Item 1", items[1]["value"]);
|
||||
Assert.AreEqual("Item 2", items[2]["value"]);
|
||||
Assert.AreEqual("Item 3", items[3]["value"]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,16 @@ namespace Umbraco.Tests.PublishedContent
|
||||
Assert.IsTrue(ddoc.HasProperty(Constants.Conventions.Content.UrlAlias));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
[Test]
|
||||
public void U4_4559()
|
||||
{
|
||||
var doc = GetDynamicNode(1174);
|
||||
var result = doc.AncestorOrSelf(1);
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(1046, result.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test class to mimic UmbracoHelper when returning docs
|
||||
/// </summary>
|
||||
public class TestHelper
|
||||
|
||||
@@ -508,6 +508,15 @@ namespace Umbraco.Tests.PublishedContent
|
||||
Assert.AreEqual(1173, result.Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void U4_4559()
|
||||
{
|
||||
var doc = GetNode(1174);
|
||||
var result = doc.AncestorOrSelf(1);
|
||||
Assert.IsNotNull(result);
|
||||
Assert.AreEqual(1046, result.Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Ancestors_Or_Self()
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Umbraco.Tests.Routing
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This checks that when we retreive a NiceUrl for multiple items that there are no issues with cache overlap
|
||||
/// This checks that when we retrieve a NiceUrl for multiple items that there are no issues with cache overlap
|
||||
/// and that they are all cached correctly.
|
||||
/// </summary>
|
||||
[Test]
|
||||
@@ -182,4 +182,4 @@ namespace Umbraco.Tests.Routing
|
||||
Assert.AreEqual("#", routingContext.UrlProvider.GetUrl(999999));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@
|
||||
<Reference Include="Moq">
|
||||
<HintPath>..\packages\Moq.4.1.1309.0919\lib\net40\Moq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
@@ -283,7 +283,7 @@
|
||||
<Compile Include="PropertyEditors\ImageCropperTest.cs" />
|
||||
<Compile Include="PublishedContent\PublishedContentExtensionTests.cs" />
|
||||
<Compile Include="PropertyEditors\ColorListValidatorTest.cs" />
|
||||
<Compile Include="PropertyEditors\DropDownPropertyPreValueEditorTests.cs" />
|
||||
<Compile Include="PropertyEditors\MultiValuePropertyEditorTests.cs" />
|
||||
<Compile Include="PropertyEditors\EnsureUniqueValuesValidatorTest.cs" />
|
||||
<Compile Include="PropertyEditors\LegacyPropertyEditorIdToAliasConverterTests.cs" />
|
||||
<Compile Include="PropertyEditors\PropertyEditorValueEditorTests.cs" />
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net40" />
|
||||
<package id="Moq" version="4.1.1309.0919" 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.2" targetFramework="net40" />
|
||||
<package id="Selenium.WebDriver" version="2.32.0" targetFramework="net40" />
|
||||
<package id="SharpZipLib" version="0.86.0" targetFramework="net40" />
|
||||
|
||||
@@ -125,7 +125,7 @@ loadMenu: function (node) {
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(getTreeMenuUrl(node)),
|
||||
"Failed to retreive data for a node's menu " + node.id);
|
||||
"Failed to retrieve data for a node's menu " + node.id);
|
||||
}</code></pre>
|
||||
<p>HTTP error handling is performed automatically inside of the <code>umbRequestHelper.resourcePromise</code> and inside of Umbraco's response interceptors.</p>
|
||||
<h2>Consuming Umbraco resources</h2>
|
||||
|
||||
@@ -23,7 +23,7 @@ Here's an example of the usage in an Umbraco resource. This example is the metho
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(getTreeMenuUrl(node)),
|
||||
"Failed to retreive data for a node's menu " + node.id);
|
||||
"Failed to retrieve data for a node's menu " + node.id);
|
||||
}
|
||||
|
||||
HTTP error handling is performed automatically inside of the `umbRequestHelper.resourcePromise` and inside of Umbraco's response interceptors.
|
||||
@@ -105,4 +105,4 @@ The good news is, this is very simple to do, example:
|
||||
});
|
||||
}
|
||||
|
||||
The next thing that is important to note is that **you don't have to do anything** if you don't want to do anything with the error but still want the error bubbled up to your promises handlers. So for example, if you are expecting the handler of this promise to handle the error and display something in the UI, just leave out the function(err) callback which would look exactly the same as the example for 'Transforming result data'
|
||||
The next thing that is important to note is that **you don't have to do anything** if you don't want to do anything with the error but still want the error bubbled up to your promises handlers. So for example, if you are expecting the handler of this promise to handle the error and display something in the UI, just leave out the function(err) callback which would look exactly the same as the example for 'Transforming result data'
|
||||
|
||||
@@ -92,4 +92,7 @@ td.mce-item-selected, th.mce-item-selected {
|
||||
-webkit-background-size: 18px;
|
||||
background-size: 18px;
|
||||
background-position-x: 99%;
|
||||
}
|
||||
}
|
||||
|
||||
/* TINYMCE IMAGE RESIZING LIMITS */
|
||||
#mceResizeHandlen, #mceResizeHandles, #mceResizeHandlee, #mceResizeHandlew{display: none !important; visibility: hidden !important;}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 165 B |
@@ -14,6 +14,8 @@ angular.module("umbraco.directives.html")
|
||||
templateUrl: 'views/directives/html/umb-photo-folder.html',
|
||||
link: function(scope, element, attrs, ngModel) {
|
||||
|
||||
var lastWatch = null;
|
||||
|
||||
ngModel.$render = function() {
|
||||
if (ngModel.$modelValue) {
|
||||
|
||||
@@ -22,9 +24,10 @@ angular.module("umbraco.directives.html")
|
||||
|
||||
scope.clickHandler = scope.$eval(element.attr('on-click'));
|
||||
|
||||
//todo: this doesn't do anything
|
||||
var imagesOnly = element.attr('imagesOnly');
|
||||
|
||||
|
||||
var imagesOnly = element.attr('images-only') === "true";
|
||||
|
||||
|
||||
var margin = element.attr('border') ? parseInt(element.attr('border'), 10) : 5;
|
||||
var startingIndex = element.attr('baseline') ? parseInt(element.attr('baseline'), 10) : 0;
|
||||
var minWidth = element.attr('min-width') ? parseInt(element.attr('min-width'), 10) : 420;
|
||||
@@ -34,14 +37,22 @@ angular.module("umbraco.directives.html")
|
||||
var fixedRowWidth = Math.max(element.width(), minWidth);
|
||||
|
||||
scope.containerStyle = { width: fixedRowWidth + "px" };
|
||||
scope.rows = umbPhotoFolderHelper.buildGrid(photos, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin);
|
||||
scope.rows = umbPhotoFolderHelper.buildGrid(photos, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin, imagesOnly);
|
||||
|
||||
if (attrs.filterBy) {
|
||||
scope.$watch(attrs.filterBy, function(newVal, oldVal) {
|
||||
|
||||
//we track the watches that we create, we don't want to create multiple, so clear it
|
||||
// if it already exists before creating another.
|
||||
if (lastWatch) {
|
||||
lastWatch();
|
||||
}
|
||||
|
||||
//TODO: Need to debounce this so it doesn't filter too often!
|
||||
lastWatch = scope.$watch(attrs.filterBy, function (newVal, oldVal) {
|
||||
if (newVal && newVal !== oldVal) {
|
||||
var p = $filter('filter')(photos, newVal, false);
|
||||
scope.baseline = 0;
|
||||
var m = umbPhotoFolderHelper.buildGrid(p, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin);
|
||||
var m = umbPhotoFolderHelper.buildGrid(p, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin, imagesOnly);
|
||||
scope.rows = m;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -106,7 +106,6 @@ angular.module("umbraco.directives")
|
||||
|
||||
//when loading an image without any crop info, we center and fit it
|
||||
var resizeImageToEditor = function(){
|
||||
|
||||
//returns size fitting the cropper
|
||||
var size = cropperHelper.calculateAspectRatioFit(
|
||||
scope.dimensions.image.width,
|
||||
@@ -185,15 +184,22 @@ angular.module("umbraco.directives")
|
||||
top = constraints.top.min;
|
||||
}
|
||||
|
||||
scope.dimensions.image.left = left;
|
||||
scope.dimensions.image.top = top;
|
||||
if(scope.dimensions.image.left !== left){
|
||||
scope.dimensions.image.left = left;
|
||||
}
|
||||
|
||||
if(scope.dimensions.image.top !== top){
|
||||
scope.dimensions.image.top = top;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
//sets scope.crop to the recalculated % based crop
|
||||
var calculateCropBox = function(){
|
||||
scope.crop = cropperHelper.pixelsToCoordinates(scope.dimensions.image, scope.dimensions.cropper.width, scope.dimensions.cropper.height, scope.dimensions.margin);
|
||||
};
|
||||
|
||||
|
||||
//Drag and drop positioning, using jquery ui draggable
|
||||
var onStartDragPosition, top, left;
|
||||
$overlay.draggable({
|
||||
@@ -204,6 +210,9 @@ angular.module("umbraco.directives")
|
||||
},
|
||||
stop: function(event, ui){
|
||||
scope.$apply(function(){
|
||||
//make sure that every validates one more time...
|
||||
validatePosition(ui.position.left, ui.position.top);
|
||||
|
||||
calculateCropBox();
|
||||
scope.dimensions.image.rnd = Math.random();
|
||||
});
|
||||
@@ -227,8 +236,6 @@ angular.module("umbraco.directives")
|
||||
|
||||
//sets constaints for the cropper
|
||||
setConstraints();
|
||||
|
||||
|
||||
scope.loaded = true;
|
||||
};
|
||||
|
||||
@@ -243,11 +250,16 @@ angular.module("umbraco.directives")
|
||||
}
|
||||
});
|
||||
|
||||
var throttledResizing = _.throttle(function(){
|
||||
resizeImageToScale(scope.dimensions.scale.current);
|
||||
calculateCropBox();
|
||||
}, 100);
|
||||
|
||||
|
||||
//happens when we change the scale
|
||||
scope.$watch("dimensions.scale.current", function(){
|
||||
if(scope.loaded){
|
||||
resizeImageToScale(scope.dimensions.scale.current);
|
||||
calculateCropBox();
|
||||
throttledResizing();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ angular.module("umbraco.directives")
|
||||
|
||||
keyboardService.bind(keyCombo, function() {
|
||||
var element = $(el);
|
||||
if(element.is("a,button,input[type='button'],input[type='submit']")){
|
||||
|
||||
if(element.is("a,button,input[type='button'],input[type='submit']") && !element.is(':disabled') ){
|
||||
element.click();
|
||||
}else{
|
||||
element.focus();
|
||||
|
||||
+1
-1
@@ -27,4 +27,4 @@ angular.module("umbraco.directives")
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
angular.module("umbraco.directives")
|
||||
.directive('selectOnFocus', function () {
|
||||
return function (scope, el, attrs) {
|
||||
$(el).bind("click", function(){
|
||||
this.select();
|
||||
});
|
||||
};
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
angular.module("umbraco.directives")
|
||||
.directive('selectOnFocus', function () {
|
||||
return function (scope, el, attrs) {
|
||||
$(el).bind("click", function () {
|
||||
var editmode = $(el).data("editmode");
|
||||
//If editmode is true a click is handled like a normal click
|
||||
if (!editmode) {
|
||||
//Initial click, select entire text
|
||||
this.select();
|
||||
//Set the edit mode so subsequent clicks work normally
|
||||
$(el).data("editmode", true);
|
||||
}
|
||||
}).
|
||||
bind("blur", function () {
|
||||
//Reset on focus lost
|
||||
$(el).data("editmode", false);
|
||||
});
|
||||
};
|
||||
});
|
||||
+13
-9
@@ -59,21 +59,25 @@ function valFormManager(serverValidationManager, $rootScope, $log, $timeout, not
|
||||
|
||||
//if we wish to turn of the unsaved changes confirmation msg
|
||||
//this is the place to do it
|
||||
var locationEvent = $rootScope.$on('$locationChangeStart', function(event, url){
|
||||
var locationEvent = $rootScope.$on('$locationChangeStart', function (event, nextLocation, currentLocation) {
|
||||
if (!formCtrl.$dirty) {
|
||||
return;
|
||||
}
|
||||
|
||||
var path = url.split("#")[1];
|
||||
if(path.indexOf("%253") || path.indexOf("%252")){
|
||||
path = decodeURIComponent(path);
|
||||
var path = nextLocation.split("#")[1];
|
||||
if (path) {
|
||||
if (path.indexOf("%253") || path.indexOf("%252")) {
|
||||
path = decodeURIComponent(path);
|
||||
}
|
||||
|
||||
if(!notificationsService.hasView()){
|
||||
var msg = { view: "confirmroutechange", args: { path: path, listener: locationEvent } };
|
||||
notificationsService.add(msg);
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
var msg = {view: "confirmroutechange", args: {path: path, listener: locationEvent}};
|
||||
notificationsService.add(msg);
|
||||
|
||||
event.preventDefault();
|
||||
return;
|
||||
});
|
||||
|
||||
scope.$on('$destroy', function() {
|
||||
|
||||
@@ -288,7 +288,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"contentApiBaseUrl",
|
||||
"GetById",
|
||||
[{ id: id }])),
|
||||
'Failed to retreive data for content id ' + id);
|
||||
'Failed to retrieve data for content id ' + id);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -325,7 +325,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"contentApiBaseUrl",
|
||||
"GetByIds",
|
||||
idQuery)),
|
||||
'Failed to retreive data for content with multiple ids');
|
||||
'Failed to retrieve data for content with multiple ids');
|
||||
},
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"contentApiBaseUrl",
|
||||
"GetEmpty",
|
||||
[{ contentTypeAlias: alias }, { parentId: parentId }])),
|
||||
'Failed to retreive data for empty content item type ' + alias);
|
||||
'Failed to retrieve data for empty content item type ' + alias);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -465,7 +465,7 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
{ orderDirection: options.orderDirection },
|
||||
{ filter: options.filter }
|
||||
])),
|
||||
'Failed to retreive children for content item ' + parentId);
|
||||
'Failed to retrieve children for content item ' + parentId);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,9 +67,9 @@ function contentTypeResource($q, $http, umbRequestHelper) {
|
||||
"contentTypeApiBaseUrl",
|
||||
"GetAllowedChildren",
|
||||
[{ contentId: contentId }])),
|
||||
'Failed to retreive data for content id ' + contentId);
|
||||
'Failed to retrieve data for content id ' + contentId);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
angular.module('umbraco.resources').factory('contentTypeResource', contentTypeResource);
|
||||
angular.module('umbraco.resources').factory('contentTypeResource', contentTypeResource);
|
||||
|
||||
@@ -45,7 +45,7 @@ function currentUserResource($q, $http, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"currentUserApiBaseUrl",
|
||||
"GetMembershipProviderConfig")),
|
||||
'Failed to retreive membership provider config');
|
||||
'Failed to retrieve membership provider config');
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"dataTypeApiBaseUrl",
|
||||
"GetPreValues",
|
||||
[{ editorAlias: editorAlias }, { dataTypeId: dataTypeId }])),
|
||||
'Failed to retreive pre values for editor alias ' + editorAlias);
|
||||
'Failed to retrieve pre values for editor alias ' + editorAlias);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ function dataTypeResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"dataTypeApiBaseUrl",
|
||||
"GetById",
|
||||
[{ id: id }])),
|
||||
'Failed to retreive data for data type id ' + id);
|
||||
'Failed to retrieve data for data type id ' + id);
|
||||
},
|
||||
|
||||
getAll: function () {
|
||||
|
||||
@@ -96,7 +96,7 @@ function entityResource($q, $http, umbRequestHelper) {
|
||||
"entityApiBaseUrl",
|
||||
"GetById",
|
||||
[{ id: id}, {type: type }])),
|
||||
'Failed to retreive entity data for id ' + id);
|
||||
'Failed to retrieve entity data for id ' + id);
|
||||
},
|
||||
|
||||
getByQuery: function (query, nodeContextId, type) {
|
||||
@@ -106,7 +106,7 @@ function entityResource($q, $http, umbRequestHelper) {
|
||||
"entityApiBaseUrl",
|
||||
"GetByQuery",
|
||||
[{query: query},{ nodeContextId: nodeContextId}, {type: type }])),
|
||||
'Failed to retreive entity data for query ' + query);
|
||||
'Failed to retrieve entity data for query ' + query);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,7 +37,7 @@ function logResource($q, $http, umbRequestHelper) {
|
||||
"logApiBaseUrl",
|
||||
"GetEntityLog",
|
||||
[{ id: id }])),
|
||||
'Failed to retreive user data for id ' + id);
|
||||
'Failed to retrieve user data for id ' + id);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -68,7 +68,7 @@ function logResource($q, $http, umbRequestHelper) {
|
||||
"logApiBaseUrl",
|
||||
"GetCurrentUserLog",
|
||||
[{ logtype: type, sinceDate: since }])),
|
||||
'Failed to retreive user data for id ' + id);
|
||||
'Failed to retrieve user data for id ' + id);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ function macroResource($q, $http, umbRequestHelper) {
|
||||
"macroApiBaseUrl",
|
||||
"GetMacroParameters",
|
||||
[{ macroId: macroId }])),
|
||||
'Failed to retreive macro parameters for macro with id ' + macroId);
|
||||
'Failed to retrieve macro parameters for macro with id ' + macroId);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -75,7 +75,7 @@ function macroResource($q, $http, umbRequestHelper) {
|
||||
"macroApiBaseUrl",
|
||||
"GetMacroResultAsHtmlForEditor",
|
||||
query)),
|
||||
'Failed to retreive macro result for macro with alias ' + macroAlias);
|
||||
'Failed to retrieve macro result for macro with alias ' + macroAlias);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -137,7 +137,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"mediaApiBaseUrl",
|
||||
"GetById",
|
||||
[{ id: id }])),
|
||||
'Failed to retreive data for media id ' + id);
|
||||
'Failed to retrieve data for media id ' + id);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -204,7 +204,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"mediaApiBaseUrl",
|
||||
"GetByIds",
|
||||
idQuery)),
|
||||
'Failed to retreive data for media ids ' + ids);
|
||||
'Failed to retrieve data for media ids ' + ids);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -247,7 +247,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"mediaApiBaseUrl",
|
||||
"GetEmpty",
|
||||
[{ contentTypeAlias: alias }, { parentId: parentId }])),
|
||||
'Failed to retreive data for empty media item type ' + alias);
|
||||
'Failed to retrieve data for empty media item type ' + alias);
|
||||
|
||||
},
|
||||
|
||||
@@ -258,7 +258,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"mediaApiBaseUrl",
|
||||
"GetRootMedia")),
|
||||
'Failed to retreive data for root media');
|
||||
'Failed to retrieve data for root media');
|
||||
|
||||
},
|
||||
|
||||
@@ -326,7 +326,7 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
{ orderDirection: options.orderDirection },
|
||||
{ filter: options.filter }
|
||||
])),
|
||||
'Failed to retreive children for media item ' + parentId);
|
||||
'Failed to retrieve children for media item ' + parentId);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,9 +34,9 @@ function mediaTypeResource($q, $http, umbRequestHelper) {
|
||||
"mediaTypeApiBaseUrl",
|
||||
"GetAllowedChildren",
|
||||
[{ contentId: mediaId }])),
|
||||
'Failed to retreive data for media id ' + mediaId);
|
||||
'Failed to retrieve data for media id ' + mediaId);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
angular.module('umbraco.resources').factory('mediaTypeResource', mediaTypeResource);
|
||||
angular.module('umbraco.resources').factory('mediaTypeResource', mediaTypeResource);
|
||||
|
||||
@@ -53,7 +53,7 @@ function memberResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"memberApiBaseUrl",
|
||||
"GetByKey",
|
||||
[{ key: key }])),
|
||||
'Failed to retreive data for member id ' + key);
|
||||
'Failed to retrieve data for member id ' + key);
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -125,7 +125,7 @@ function memberResource($q, $http, umbDataFormatter, umbRequestHelper) {
|
||||
"memberApiBaseUrl",
|
||||
"GetEmpty",
|
||||
[{ contentTypeAlias: alias }])),
|
||||
'Failed to retreive data for empty member item type ' + alias);
|
||||
'Failed to retrieve data for empty member item type ' + alias);
|
||||
}
|
||||
else {
|
||||
return umbRequestHelper.resourcePromise(
|
||||
|
||||
@@ -15,9 +15,9 @@ function memberTypeResource($q, $http, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"memberTypeApiBaseUrl",
|
||||
"GetAllTypes")),
|
||||
'Failed to retreive data for member types id');
|
||||
'Failed to retrieve data for member types id');
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
angular.module('umbraco.resources').factory('memberTypeResource', memberTypeResource);
|
||||
angular.module('umbraco.resources').factory('memberTypeResource', memberTypeResource);
|
||||
|
||||
@@ -20,7 +20,7 @@ function sectionResource($q, $http, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"sectionApiBaseUrl",
|
||||
"GetSections")),
|
||||
'Failed to retreive data for sections');
|
||||
'Failed to retrieve data for sections');
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -35,7 +35,7 @@ function stylesheetResource($q, $http, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"stylesheetApiBaseUrl",
|
||||
"GetAll")),
|
||||
'Failed to retreive stylesheets ');
|
||||
'Failed to retrieve stylesheets ');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -64,7 +64,7 @@ function stylesheetResource($q, $http, umbRequestHelper) {
|
||||
"stylesheetApiBaseUrl",
|
||||
"GetRules",
|
||||
[{ id: id }])),
|
||||
'Failed to retreive stylesheets ');
|
||||
'Failed to retrieve stylesheets ');
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,7 @@ function treeResource($q, $http, umbRequestHelper) {
|
||||
|
||||
return umbRequestHelper.resourcePromise(
|
||||
$http.get(getTreeMenuUrl(node)),
|
||||
"Failed to retreive data for a node's menu " + node.id);
|
||||
"Failed to retrieve data for a node's menu " + node.id);
|
||||
},
|
||||
|
||||
/** Loads in the data to display the nodes for an application */
|
||||
@@ -60,7 +60,7 @@ function treeResource($q, $http, umbRequestHelper) {
|
||||
"treeApplicationApiBaseUrl",
|
||||
"GetApplicationTrees",
|
||||
query)),
|
||||
'Failed to retreive data for application tree ' + options.section);
|
||||
'Failed to retrieve data for application tree ' + options.section);
|
||||
},
|
||||
|
||||
/** Loads in the data to display the child nodes for a given node */
|
||||
@@ -77,4 +77,4 @@ function treeResource($q, $http, umbRequestHelper) {
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('umbraco.resources').factory('treeResource', treeResource);
|
||||
angular.module('umbraco.resources').factory('treeResource', treeResource);
|
||||
|
||||
@@ -22,7 +22,7 @@ function cropperHelper(umbRequestHelper, $http) {
|
||||
"imageCropperApiBaseUrl",
|
||||
"GetConfiguration",
|
||||
[{ mediaTypeAlias: mediaTypeAlias}])),
|
||||
'Failed to retreive tinymce configuration');
|
||||
'Failed to retrieve tinymce configuration');
|
||||
},
|
||||
|
||||
|
||||
@@ -85,9 +85,7 @@ function cropperHelper(umbRequestHelper, $http) {
|
||||
return style;
|
||||
},
|
||||
|
||||
//returns a ng-style object with top,left,width,height pixel measurements
|
||||
//expects {left,right,top,bottom} - {width,height}, {width,height}, int
|
||||
//offset is just to push the image position a number of pixels from top,left
|
||||
|
||||
coordinatesToPixels : function(coordinates, originalSize, offset){
|
||||
|
||||
var coordinates_px = {
|
||||
@@ -116,6 +114,12 @@ function cropperHelper(umbRequestHelper, $http) {
|
||||
crop.x2 = x2_px / image.width;
|
||||
crop.y2 = y2_px / image.height;
|
||||
|
||||
_.forEach(crop, function(coord){
|
||||
if(coord < 0){
|
||||
coord = 0;
|
||||
}
|
||||
});
|
||||
|
||||
return crop;
|
||||
},
|
||||
|
||||
@@ -164,4 +168,4 @@ function cropperHelper(umbRequestHelper, $http) {
|
||||
return service;
|
||||
}
|
||||
|
||||
angular.module('umbraco.services').factory('cropperHelper', cropperHelper);
|
||||
angular.module('umbraco.services').factory('cropperHelper', cropperHelper);
|
||||
|
||||
@@ -28,10 +28,10 @@ function macroService() {
|
||||
var paramMatch;
|
||||
var returnVal = {
|
||||
macroAlias: alias,
|
||||
marcoParamsDictionary: {}
|
||||
macroParamsDictionary: {}
|
||||
};
|
||||
while (paramMatch = paramExpression.exec(paramsChunk)) {
|
||||
returnVal.marcoParamsDictionary[paramMatch[1]] = paramMatch[2];
|
||||
returnVal.macroParamsDictionary[paramMatch[1]] = paramMatch[2];
|
||||
}
|
||||
return returnVal;
|
||||
},
|
||||
@@ -53,9 +53,9 @@ function macroService() {
|
||||
|
||||
var macroString = '<?UMBRACO_MACRO macroAlias=\"' + args.macroAlias + "\" ";
|
||||
|
||||
if (args.marcoParamsDictionary) {
|
||||
if (args.macroParamsDictionary) {
|
||||
|
||||
_.each(args.marcoParamsDictionary, function (val, key) {
|
||||
_.each(args.macroParamsDictionary, function (val, key) {
|
||||
//check for null
|
||||
val = val ? val : "";
|
||||
//need to detect if the val is a string or an object
|
||||
@@ -96,9 +96,9 @@ function macroService() {
|
||||
|
||||
var macroString = '<umbraco:Macro ';
|
||||
|
||||
if (args.marcoParamsDictionary) {
|
||||
if (args.macroParamsDictionary) {
|
||||
|
||||
_.each(args.marcoParamsDictionary, function (val, key) {
|
||||
_.each(args.macroParamsDictionary, function (val, key) {
|
||||
var keyVal = key + "=\"" + (val ? val : "") + "\" ";
|
||||
macroString += keyVal;
|
||||
});
|
||||
@@ -127,11 +127,11 @@ function macroService() {
|
||||
|
||||
var hasParams = false;
|
||||
var paramString;
|
||||
if (args.marcoParamsDictionary) {
|
||||
if (args.macroParamsDictionary) {
|
||||
|
||||
paramString = ", new {";
|
||||
|
||||
_.each(args.marcoParamsDictionary, function(val, key) {
|
||||
_.each(args.macroParamsDictionary, function(val, key) {
|
||||
|
||||
hasParams = true;
|
||||
|
||||
|
||||
@@ -162,6 +162,36 @@ function mediaHelper(umbRequestHelper) {
|
||||
return result;
|
||||
},
|
||||
|
||||
/*jshint loopfunc: true */
|
||||
hasFilePropertyType : function(mediaItem){
|
||||
function _iterateProps(props){
|
||||
var result = false;
|
||||
for(var resolver in _mediaFileResolvers) {
|
||||
var property = _.find(props, function(property){ return property.editor === resolver; });
|
||||
if(property){
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//we either have properties raw on the object, or spread out on tabs
|
||||
var result = false;
|
||||
if(mediaItem.properties){
|
||||
result = _iterateProps(mediaItem.properties);
|
||||
}else if(mediaItem.tabs){
|
||||
for(var tab in mediaItem.tabs) {
|
||||
if(mediaItem.tabs[tab].properties){
|
||||
result = _iterateProps(mediaItem.tabs[tab].properties);
|
||||
if(result){
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
/**
|
||||
* @ngdoc function
|
||||
@@ -219,6 +249,11 @@ function mediaHelper(umbRequestHelper) {
|
||||
*/
|
||||
getThumbnailFromPath: function (imagePath) {
|
||||
|
||||
//If the path is not an image we cannot get a thumb
|
||||
if (!this.detectIfImageByExtension(imagePath)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
//get the proxy url for big thumbnails (this ensures one is always generated)
|
||||
var thumbnailUrl = umbRequestHelper.getApiUrl(
|
||||
"imagesApiBaseUrl",
|
||||
|
||||
@@ -25,6 +25,18 @@ angular.module('umbraco.services')
|
||||
.factory('notificationsService', function ($rootScope, $timeout, angularHelper) {
|
||||
|
||||
var nArray = [];
|
||||
function setViewPath(view){
|
||||
if(view.indexOf('/') < 0)
|
||||
{
|
||||
view = "views/common/notifications/" + view;
|
||||
}
|
||||
|
||||
if(view.indexOf('.html') < 0)
|
||||
{
|
||||
view = view + ".html";
|
||||
}
|
||||
return view;
|
||||
}
|
||||
|
||||
var service = {
|
||||
|
||||
@@ -50,16 +62,7 @@ angular.module('umbraco.services')
|
||||
angularHelper.safeApply($rootScope, function () {
|
||||
|
||||
if(item.view){
|
||||
if(item.view.indexOf('/') < 0)
|
||||
{
|
||||
item.view = "views/common/notifications/" + item.view;
|
||||
}
|
||||
|
||||
if(item.view.indexOf('.html') < 0)
|
||||
{
|
||||
item.view = item.view + ".html";
|
||||
}
|
||||
|
||||
item.view = setViewPath(item.view);
|
||||
item.sticky = true;
|
||||
item.type = "form";
|
||||
item.headline = null;
|
||||
@@ -100,6 +103,14 @@ angular.module('umbraco.services')
|
||||
|
||||
},
|
||||
|
||||
hasView : function(view){
|
||||
if(!view){
|
||||
return _.find(nArray, function(notification){ return notification.view;});
|
||||
}else{
|
||||
view = setViewPath(view).toLowerCase();
|
||||
return _.find(nArray, function(notification){ return notification.view.toLowerCase() === view;});
|
||||
}
|
||||
},
|
||||
addView: function(view, args){
|
||||
var item = {
|
||||
args: args,
|
||||
|
||||
@@ -24,7 +24,7 @@ function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macro
|
||||
umbRequestHelper.getApiUrl(
|
||||
"rteApiBaseUrl",
|
||||
"GetConfiguration")),
|
||||
'Failed to retreive tinymce configuration');
|
||||
'Failed to retrieve tinymce configuration');
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -102,10 +102,11 @@ function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macro
|
||||
dialogService.mediaPicker({
|
||||
currentTarget: currentTarget,
|
||||
onlyImages: true,
|
||||
showDetails: true,
|
||||
scope: $scope, callback: function (img) {
|
||||
|
||||
if (img) {
|
||||
var imagePropVal = imageHelper.getImagePropertyValue({ imageModel: img, scope: $scope });
|
||||
|
||||
var data = {
|
||||
alt: img.name,
|
||||
src: (img.url) ? img.url : "nothing.jpg",
|
||||
@@ -120,11 +121,16 @@ function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macro
|
||||
var size = editor.dom.getSize(imgElm);
|
||||
|
||||
var newSize = imageHelper.scaleToMaxSize(500, size.w, size.h);
|
||||
|
||||
var s = "width: " + newSize.width + "px; height:" + newSize.height + "px;";
|
||||
editor.dom.setAttrib(imgElm, 'style', s);
|
||||
editor.dom.setAttrib(imgElm, 'rel', newSize.width + "," + newSize.height);
|
||||
editor.dom.setAttrib(imgElm, 'id', null);
|
||||
|
||||
if(img.url){
|
||||
var src = img.url + "?width=" + newSize.width + "&height=" + newSize.height;
|
||||
editor.dom.setAttrib(imgElm, 'data-mce-src', src);
|
||||
}
|
||||
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
@@ -250,7 +256,7 @@ function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macro
|
||||
|
||||
//need to wrap in safe apply since this might be occuring outside of angular
|
||||
angularHelper.safeApply($scope, function() {
|
||||
macroResource.getMacroResultAsHtmlForEditor(macroData.macroAlias, contentId, macroData.marcoParamsDictionary)
|
||||
macroResource.getMacroResultAsHtmlForEditor(macroData.macroAlias, contentId, macroData.macroParamsDictionary)
|
||||
.then(function (htmlResult) {
|
||||
|
||||
$macroDiv.removeClass("loading");
|
||||
@@ -520,4 +526,4 @@ function tinyMceService(dialogService, $log, imageHelper, $http, $timeout, macro
|
||||
};
|
||||
}
|
||||
|
||||
angular.module('umbraco.services').factory('tinyMceService', tinyMceService);
|
||||
angular.module('umbraco.services').factory('tinyMceService', tinyMceService);
|
||||
|
||||
@@ -61,7 +61,9 @@ angular.module('umbraco.services')
|
||||
there are no more seconds remaining.
|
||||
*/
|
||||
function countdownUserTimeout() {
|
||||
$timeout(function() {
|
||||
|
||||
$timeout(function () {
|
||||
|
||||
if (currentUser) {
|
||||
//countdown by 2 seconds since that is how long our timer is for.
|
||||
currentUser.remainingAuthSeconds -= 2;
|
||||
@@ -70,18 +72,24 @@ angular.module('umbraco.services')
|
||||
if (currentUser.remainingAuthSeconds > 30) {
|
||||
|
||||
//we need to check when the last time the timeout was set from the server, if
|
||||
// it has been more than 30 seconds then we'll manually go and retreive it from the
|
||||
// it has been more than 30 seconds then we'll manually go and retrieve it from the
|
||||
// server - this helps to keep our local countdown in check with the true timeout.
|
||||
if (lastServerTimeoutSet != null) {
|
||||
var now = new Date();
|
||||
var seconds = (now.getTime() - lastServerTimeoutSet.getTime()) / 1000;
|
||||
|
||||
if (seconds > 30) {
|
||||
|
||||
//first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we
|
||||
// wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait.
|
||||
lastServerTimeoutSet = null;
|
||||
|
||||
//now go get it from the server
|
||||
authResource.getRemainingTimeoutSeconds().then(function(result) {
|
||||
setUserTimeoutInternal(result);
|
||||
//NOTE: the safeApply because our timeout is set to not run digests (performance reasons)
|
||||
angularHelper.safeApply($rootScope, function() {
|
||||
authResource.getRemainingTimeoutSeconds().then(function (result) {
|
||||
setUserTimeoutInternal(result);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -91,10 +99,10 @@ angular.module('umbraco.services')
|
||||
}
|
||||
else {
|
||||
|
||||
//we are either timed out or very close to timing out so we need to show the login dialog.
|
||||
//NOTE: the safeApply because our timeout is set to not run digests (performance reasons)
|
||||
//we are either timed out or very close to timing out so we need to show the login dialog.
|
||||
if (Umbraco.Sys.ServerVariables.umbracoSettings.keepUserLoggedIn !== true) {
|
||||
angularHelper.safeApply($rootScope, function() {
|
||||
//NOTE: the safeApply because our timeout is set to not run digests (performance reasons)
|
||||
angularHelper.safeApply($rootScope, function () {
|
||||
userAuthExpired();
|
||||
});
|
||||
}
|
||||
@@ -105,9 +113,13 @@ angular.module('umbraco.services')
|
||||
//first we'll set the lastServerTimeoutSet to null - this is so we don't get back in to this loop while we
|
||||
// wait for a response from the server otherwise we'll be making double/triple/etc... calls while we wait.
|
||||
lastServerTimeoutSet = null;
|
||||
|
||||
//now go get it from the server
|
||||
authResource.getRemainingTimeoutSeconds().then(function (result) {
|
||||
setUserTimeoutInternal(result);
|
||||
//NOTE: the safeApply because our timeout is set to not run digests (performance reasons)
|
||||
angularHelper.safeApply($rootScope, function() {
|
||||
authResource.getRemainingTimeoutSeconds().then(function (result) {
|
||||
setUserTimeoutInternal(result);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -23,14 +23,14 @@ angular.module('umbraco.services').factory('packageHelper', packageHelper);
|
||||
|
||||
function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, mediaHelper, umbRequestHelper) {
|
||||
return {
|
||||
/** sets the image's url - will check if it is a folder or a real image */
|
||||
setImageUrl: function(img) {
|
||||
//get the image property (if one exists)
|
||||
img.thumbnail = mediaHelper.resolveFile(img, true);
|
||||
img.image = mediaHelper.resolveFile(img, false);
|
||||
/** sets the image's url, thumbnail and if its a folder */
|
||||
setImageData: function(img) {
|
||||
|
||||
img.isFolder = !mediaHelper.hasFilePropertyType(img);
|
||||
|
||||
if (!img.thumbnail){
|
||||
img.thumbnail = "none";
|
||||
if(!img.isFolder){
|
||||
img.thumbnail = mediaHelper.resolveFile(img, true);
|
||||
img.image = mediaHelper.resolveFile(img, false);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -198,7 +198,7 @@ function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, me
|
||||
|
||||
//in this case, a single image will not fit into the row so we need to crop/center
|
||||
// width the full width and the min display height
|
||||
if (imgs.length > 1 && imageRowHeight.imgCount === 1) {
|
||||
if (imageRowHeight.imgCount === 1) {
|
||||
sizes.push({
|
||||
width: targetWidth,
|
||||
//ensure that the height is rounded
|
||||
@@ -252,15 +252,22 @@ function umbPhotoFolderHelper($compile, $log, $timeout, $filter, imageHelper, me
|
||||
},
|
||||
|
||||
/** Creates the image grid with calculated widths/heights for images to fill the grid nicely */
|
||||
buildGrid: function(images, maxRowWidth, maxRowHeight, startingIndex, minDisplayHeight, idealImgPerRow, margin) {
|
||||
buildGrid: function(images, maxRowWidth, maxRowHeight, startingIndex, minDisplayHeight, idealImgPerRow, margin,imagesOnly) {
|
||||
|
||||
var rows = [];
|
||||
var imagesProcessed = 0;
|
||||
|
||||
//first fill in all of the original image sizes and URLs
|
||||
for (var i = startingIndex; i < images.length; i++) {
|
||||
this.setImageUrl(images[i]);
|
||||
this.setOriginalSize(images[i], maxRowHeight);
|
||||
var item = images[i];
|
||||
|
||||
this.setImageData(item);
|
||||
this.setOriginalSize(item, maxRowHeight);
|
||||
|
||||
if(imagesOnly && !item.isFolder && !item.thumbnail){
|
||||
images.splice(i, 1);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
|
||||
while ((imagesProcessed + startingIndex) < images.length) {
|
||||
@@ -390,7 +397,7 @@ function updateChecker($http, umbRequestHelper) {
|
||||
umbRequestHelper.getApiUrl(
|
||||
"updateCheckApiBaseUrl",
|
||||
"GetCheck")),
|
||||
'Failed to retreive update status');
|
||||
'Failed to retrieve update status');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<label class="checkbox" for="integratedAuth">
|
||||
<input type="checkbox" name="integratedAuth"
|
||||
placeholder="umbraco-cms"
|
||||
ng-model="installer.current.model.integratedAuth" /> Use intergrated authentication</label>
|
||||
ng-model="installer.current.model.integratedAuth" /> Use integrated authentication</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
angular.module("umbraco.install").controller("Umbraco.Install.UserController", function($scope, installerService) {
|
||||
|
||||
$scope.passwordPattern = /.*/;
|
||||
$scope.installer.current.model.subscribeToNewsLetter = true;
|
||||
|
||||
if ($scope.installer.current.model.minNonAlphaNumericLength > 0) {
|
||||
var exp = "";
|
||||
for (var i = 0; i < $scope.installer.current.model.minNonAlphaNumericLength; i++) {
|
||||
|
||||
@@ -27,18 +27,31 @@
|
||||
<div class="control-group">
|
||||
<label class="control-label" for="password">Password</label>
|
||||
<div class="controls">
|
||||
<input type="password" name="installer.current.model.password"
|
||||
<!-- why isn't this masked: http://www.nngroup.com/articles/stop-password-masking/ -->
|
||||
<input type="text" name="installer.current.model.password"
|
||||
ng-minlength="{{installer.current.model.minCharLength}}"
|
||||
ng-pattern="passwordPattern"
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
required
|
||||
ng-model="installer.current.model.password" />
|
||||
<small class="inline-help">At least {{installer.current.model.minCharLength}} characters long</small>
|
||||
|
||||
<small ng-if="installer.current.model.minNonAlphaNumericLength > 0" class="inline-help">
|
||||
At least {{installer.current.model.minNonAlphaNumericLength}} symbol{{installer.current.model.minNonAlphaNumericLength > 1 ? 's' : ''}}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="checkbox" for="subscribeToNewsLetter">
|
||||
<input type="checkbox" name="subscribeToNewsLetter"
|
||||
ng-model="installer.current.model.subscribeToNewsLetter" /> Keep me updated on Umbraco Versions, Security Bulletins and Community News</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group" ng-class="{disabled:myForm.$invalid}">
|
||||
<div class="controls">
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ body {
|
||||
#speechbubble {
|
||||
z-index: 1000;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
bottom: 40px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
border-bottom: none;
|
||||
|
||||
@@ -87,7 +87,8 @@
|
||||
}
|
||||
|
||||
.umb-listview .selected i.icon, .umb-listview tr:hover i.icon{display: none}
|
||||
.umb-listview .selected input[type="checkbox"], .umb-listview tr:hover input[type="checkbox"]{display: inline-block;}
|
||||
.umb-listview .selected input[type="checkbox"],
|
||||
.umb-listview tr:hover input[type="checkbox"]{display: inline-block !important;}
|
||||
.umb-listview .inactive{color: @grayLight;}
|
||||
|
||||
.umb-listview .selected td{font-weight: bold;}
|
||||
@@ -120,7 +121,7 @@
|
||||
font-weight: 400
|
||||
}
|
||||
|
||||
.table-striped tbody > tr:nth-child(even) > td, .table-striped tbody > tr:nth-child(even) > th {
|
||||
.umb-listview .table-striped tbody > tr:nth-child(even) > td, .umb-listview .table-striped tbody > tr:nth-child(even) > th {
|
||||
background-color: @grayLighter
|
||||
}
|
||||
|
||||
@@ -167,18 +168,22 @@
|
||||
|
||||
/* TEMP */
|
||||
|
||||
.table-striped tbody td {
|
||||
.umb-listview .table-striped tbody td {
|
||||
position: relative
|
||||
}
|
||||
|
||||
.table-striped tbody input[type="checkbox"] {
|
||||
|
||||
.umb-listview .table-striped thead input[type="checkbox"] {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.umb-listview .table-striped tbody input[type="checkbox"] {
|
||||
display: none;
|
||||
top: 10px;
|
||||
left:10px;
|
||||
margin-left: 7px;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.table-striped tbody i {
|
||||
.umb-listview .table-striped tbody i {
|
||||
display: block;
|
||||
top: 10px;
|
||||
left:6px;
|
||||
@@ -189,7 +194,7 @@
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.table-striped tbody > tr:nth-child(even) > td i, .table-striped tbody > tr:nth-child(even) > th i{
|
||||
.umb-listview .table-striped tbody > tr:nth-child(even) > td i, .umb-listview .table-striped tbody > tr:nth-child(even) > th i{
|
||||
background-color: @grayLighter
|
||||
}
|
||||
|
||||
|
||||
@@ -187,6 +187,7 @@ ul.color-picker li a {
|
||||
max-height:100%;
|
||||
margin:auto;
|
||||
display:block;
|
||||
background-image: url(../img/checkered-background.png);
|
||||
}
|
||||
|
||||
.umb-sortable-thumbnails li img.noScale{
|
||||
@@ -303,6 +304,10 @@ ul.color-picker li a {
|
||||
line-height: 120px
|
||||
}
|
||||
|
||||
.umb-folderbrowser .selector-overlay{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.umb-upload-drop-zone .info, .umb-upload-button-big{
|
||||
display: block;
|
||||
padding: 20px;
|
||||
@@ -342,6 +347,8 @@ ul.color-picker li a {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.umb-photo-folder .picrow div, .umb-photo-preview{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
@@ -391,11 +398,11 @@ ul.color-picker li a {
|
||||
|
||||
.umb-photo-folder .umb-non-thumbnail i{
|
||||
color: @grayLight;
|
||||
font-size: 70px;
|
||||
line-height: 80px;
|
||||
font-size: 50px;
|
||||
line-height: 60px;
|
||||
display: block;
|
||||
margin: auto;
|
||||
padding-top: 25%;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.umb-photo-folder .selected{
|
||||
|
||||
@@ -25,13 +25,14 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi
|
||||
$scope.macroParams = data;
|
||||
|
||||
//fill in the data if we are editing this macro
|
||||
if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.marcoParamsDictionary) {
|
||||
_.each($scope.dialogData.macroData.marcoParamsDictionary, function (val, key) {
|
||||
if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroParamsDictionary) {
|
||||
_.each($scope.dialogData.macroData.macroParamsDictionary, function (val, key) {
|
||||
var prop = _.find($scope.macroParams, function (item) {
|
||||
return item.alias == key;
|
||||
});
|
||||
if (prop) {
|
||||
prop.value = val;
|
||||
//we need to unescape values as they have most likely been escaped while inserted
|
||||
prop.value = _.unescape(val);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -58,16 +59,16 @@ function InsertMacroController($scope, entityResource, macroResource, umbPropEdi
|
||||
//get the syntax based on the rendering engine
|
||||
var syntax;
|
||||
if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "WebForms") {
|
||||
syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary });
|
||||
syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
else if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "Mvc") {
|
||||
syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary });
|
||||
syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
else {
|
||||
syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, marcoParamsDictionary: paramDictionary });
|
||||
syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
|
||||
$scope.submit({ syntax: syntax, macroAlias: macroAlias, marcoParamsDictionary: paramDictionary });
|
||||
$scope.submit({ syntax: syntax, macroAlias: macroAlias, macroParamsDictionary: paramDictionary });
|
||||
}
|
||||
|
||||
$scope.macros = [];
|
||||
|
||||
@@ -9,7 +9,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
|
||||
if(dialogOptions.currentTarget){
|
||||
$scope.target = dialogOptions.currentTarget;
|
||||
|
||||
//if we a node ID, we fetch the current node to build the form data
|
||||
//if we have a node ID, we fetch the current node to build the form data
|
||||
if($scope.target.id){
|
||||
|
||||
if(!$scope.target.path) {
|
||||
@@ -30,7 +30,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController",
|
||||
dialogService.mediaPicker({callback: function(media){
|
||||
$scope.target.id = undefined;
|
||||
$scope.target.name = media.name;
|
||||
$scope.target.url = mediaHelper.getMediaPropertyValue({mediaModel: media});
|
||||
$scope.target.url = mediaHelper.resolveFile(media);
|
||||
}});
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ angular.module("umbraco")
|
||||
function ($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, eventsService, treeService, $cookies) {
|
||||
|
||||
var dialogOptions = $scope.$parent.dialogOptions;
|
||||
|
||||
$scope.onlyImages = dialogOptions.onlyImages;
|
||||
$scope.showDetails = dialogOptions.showDetails;
|
||||
$scope.multiPicker = (dialogOptions.multiPicker && dialogOptions.multiPicker !== "0") ? true : false;
|
||||
$scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1;
|
||||
|
||||
@@ -65,19 +67,8 @@ angular.module("umbraco")
|
||||
//mediaResource.rootMedia()
|
||||
mediaResource.getChildren(folder.id)
|
||||
.then(function(data) {
|
||||
|
||||
$scope.images = [];
|
||||
|
||||
$scope.searchTerm = "";
|
||||
if(data.items){
|
||||
$scope.images = data.items;
|
||||
}
|
||||
|
||||
if($scope.onlyImages){
|
||||
$scope.images = _.reject($scope.images, function(item) {
|
||||
return item.contentTypeAlias.toLowerCase() !== "folder" && item.thumbnail === "";
|
||||
});
|
||||
}
|
||||
$scope.images = data.items ? data.items : [];
|
||||
});
|
||||
|
||||
$scope.options.formData.currentFolder = folder.id;
|
||||
@@ -91,17 +82,20 @@ angular.module("umbraco")
|
||||
$scope.clickHandler = function(image, ev, select) {
|
||||
ev.preventDefault();
|
||||
|
||||
if (image.contentTypeAlias.toLowerCase() == 'folder' && !select) {
|
||||
if (image.isFolder && !select) {
|
||||
$scope.gotoFolder(image);
|
||||
}else{
|
||||
eventsService.emit("dialogs.mediaPicker.select", image);
|
||||
|
||||
//we have 3 options add to collection (if multi) show details, or submit it right back to the callback
|
||||
if ($scope.multiPicker) {
|
||||
$scope.select(image);
|
||||
image.cssclass = ($scope.dialogData.selection.indexOf(image) > -1) ? "selected" : "";
|
||||
}else {
|
||||
}else if($scope.showDetails) {
|
||||
$scope.target= image;
|
||||
$scope.target.url = mediaHelper.resolveFile(image); // getMediaPropertyValue({mediaModel: image});
|
||||
$scope.target.url = mediaHelper.resolveFile(image);
|
||||
}else{
|
||||
$scope.submit(image);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -114,29 +108,7 @@ angular.module("umbraco")
|
||||
$scope.target = undefined;
|
||||
};
|
||||
|
||||
$scope.selectFolder= function(folder) {
|
||||
if ($scope.multiPicker) {
|
||||
$scope.select(folder);
|
||||
}
|
||||
else {
|
||||
$scope.submit(folder);
|
||||
}
|
||||
};
|
||||
|
||||
$scope.selectMediaItem = function(image) {
|
||||
if (image.contentTypeAlias.toLowerCase() == 'folder') {
|
||||
$scope.gotoFolder(image);
|
||||
}else{
|
||||
eventsService.emit("dialogs.mediaPicker.select", image);
|
||||
|
||||
if ($scope.multiPicker) {
|
||||
$scope.select(image);
|
||||
}
|
||||
else {
|
||||
$scope.submit(image);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//default root item
|
||||
if(!$scope.target){
|
||||
|
||||
@@ -100,14 +100,14 @@ data-file-upload="options" data-file-upload-progress="" data-ng-class="{'fileupl
|
||||
<div class="umb-panel-body with-footer">
|
||||
<div style="height: 10px; margin: 10px 0px 10px 0px" class="umb-loader"
|
||||
ng-hide="active() == 0"></div>
|
||||
|
||||
<umb-photo-folder
|
||||
min-height="75"
|
||||
min-height="105"
|
||||
min-width="150"
|
||||
max-height="250"
|
||||
ideal-items-per-row="3"
|
||||
on-click="clickHandler"
|
||||
ng-model="images"
|
||||
images-only="{{onlyImages}}"
|
||||
filter-by="searchTerm"/>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@ function ContentEditController($scope, $routeParams, $q, $timeout, $window, appS
|
||||
// from the server so that we can load in the actions menu.
|
||||
umbRequestHelper.resourcePromise(
|
||||
$http.get(content.treeNodeUrl),
|
||||
'Failed to retreive data for child node ' + content.id).then(function(node) {
|
||||
'Failed to retrieve data for child node ' + content.id).then(function(node) {
|
||||
$scope.currentNode = node;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
<!-- sub buttons -->
|
||||
<ul class="dropdown-menu bottom-up" role="menu" aria-labelledby="dLabel" ng-if="subButtons.length > 0">
|
||||
<li ng-repeat="btn in subButtons">
|
||||
<a href="#" ng-click="performAction(btn)" ng-disabled="true" prevent-default>
|
||||
<a href="#" ng-click="performAction(btn)" prevent-default>
|
||||
<localize key="{{btn.labelKey}}">{{btn.labelKey}}</localize>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
@@ -13,7 +13,7 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
|
||||
$scope.currentSection = appState.getSectionState("currentSection");
|
||||
$scope.currentNode = null; //the editors affiliated node
|
||||
|
||||
//method used to configure the pre-values when we retreive them from the server
|
||||
//method used to configure the pre-values when we retrieve them from the server
|
||||
function createPreValueProps(preVals) {
|
||||
$scope.preValues = [];
|
||||
for (var i = 0; i < preVals.length; i++) {
|
||||
@@ -141,4 +141,4 @@ function DataTypeEditController($scope, $routeParams, $location, appState, navig
|
||||
|
||||
}
|
||||
|
||||
angular.module("umbraco").controller("Umbraco.Editors.DataType.EditController", DataTypeEditController);
|
||||
angular.module("umbraco").controller("Umbraco.Editors.DataType.EditController", DataTypeEditController);
|
||||
|
||||
@@ -15,18 +15,16 @@
|
||||
|
||||
<div class="span5">
|
||||
<div class="btn-toolbar pull-right umb-btn-toolbar">
|
||||
|
||||
<umb-options-menu ng-show="currentNode"
|
||||
current-node="currentNode"
|
||||
current-section="{{currentSection}}">
|
||||
</umb-options-menu>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</umb-header>
|
||||
|
||||
<div class="umb-panel-body umb-scrollable row-fluid">
|
||||
<div class="tab-content form-horizontal">
|
||||
<div class="tab-content form-horizontal" style="padding-bottom: 90px">
|
||||
<div class="umb-pane">
|
||||
|
||||
<umb-property property="properties.selectedEditor">
|
||||
|
||||
@@ -7,21 +7,20 @@
|
||||
|
||||
<a href="#media/media/edit/{{img.id}}"
|
||||
ng-click="clickHandler(img, $event, false)"
|
||||
ng-switch="img.thumbnail"
|
||||
title="{{img.name}}">
|
||||
|
||||
<div ng-style="img.style" class="umb-non-thumbnail" ng-switch-when="none">
|
||||
<div ng-style="img.style" class="umb-non-thumbnail" ng-if="!img.thumbnail">
|
||||
<i class="icon large {{img.icon}}"></i>
|
||||
{{img.name}}
|
||||
</div>
|
||||
|
||||
<div ng-switch-default class="umb-photo" ng-style="img.thumbStyle" alt="{{img.name}}"></div>
|
||||
<div ng-if="img.thumbnail" class="umb-photo" ng-style="img.thumbStyle" alt="{{img.name}}"></div>
|
||||
</a>
|
||||
|
||||
<a href ng-click="clickHandler(img, $event, true)" ng-show="img.contentTypeAlias === 'Folder'" class="selector-overlay">
|
||||
<a href ng-click="clickHandler(img, $event, true)"
|
||||
ng-if="img.isFolder" class="selector-overlay">
|
||||
<localize key="buttons_select">Select</localize>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
type="range"
|
||||
min="{{dimensions.scale.min}}"
|
||||
max="{{dimensions.scale.max}}"
|
||||
step="0.01"
|
||||
step="0.001"
|
||||
ng-model="dimensions.scale.current" />
|
||||
<i class="icon-picture" style="font-size: 22px"></i>
|
||||
</div>
|
||||
|
||||
@@ -27,7 +27,7 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
// from the server so that we can load in the actions menu.
|
||||
umbRequestHelper.resourcePromise(
|
||||
$http.get(content.treeNodeUrl),
|
||||
'Failed to retreive data for child node ' + content.id).then(function (node) {
|
||||
'Failed to retrieve data for child node ' + content.id).then(function (node) {
|
||||
$scope.currentNode = node;
|
||||
});
|
||||
}
|
||||
@@ -110,4 +110,4 @@ function mediaEditController($scope, $routeParams, appState, mediaResource, enti
|
||||
}
|
||||
|
||||
angular.module("umbraco")
|
||||
.controller("Umbraco.Editors.Media.EditController", mediaEditController);
|
||||
.controller("Umbraco.Editors.Media.EditController", mediaEditController);
|
||||
|
||||
@@ -7,20 +7,25 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiValuesControl
|
||||
$scope.hasError = false;
|
||||
|
||||
if (!angular.isArray($scope.model.value)) {
|
||||
|
||||
//make an array from the dictionary
|
||||
var items = [];
|
||||
for (var i in $scope.model.value) {
|
||||
items.push({
|
||||
value: $scope.model.value[i],
|
||||
items.push({
|
||||
value: $scope.model.value[i].value,
|
||||
sortOrder: $scope.model.value[i].sortOrder,
|
||||
id: i
|
||||
});
|
||||
}
|
||||
|
||||
//ensure the items are sorted by the provided sort order
|
||||
items.sort(function (a, b) { return (a.sortOrder > b.sortOrder) ? 1 : ((b.sortOrder > a.sortOrder) ? -1 : 0); });
|
||||
|
||||
//now make the editor model the array
|
||||
$scope.model.value = items;
|
||||
}
|
||||
|
||||
$scope.remove = function(item, evt) {
|
||||
|
||||
evt.preventDefault();
|
||||
|
||||
$scope.model.value = _.reject($scope.model.value, function (x) {
|
||||
@@ -30,7 +35,6 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiValuesControl
|
||||
};
|
||||
|
||||
$scope.add = function (evt) {
|
||||
|
||||
evt.preventDefault();
|
||||
|
||||
|
||||
@@ -47,4 +51,36 @@ angular.module("umbraco").controller("Umbraco.PrevalueEditors.MultiValuesControl
|
||||
$scope.hasError = true;
|
||||
};
|
||||
|
||||
$scope.sortableOptions = {
|
||||
axis: 'y',
|
||||
containment: 'parent',
|
||||
cursor: 'move',
|
||||
items: '> div.control-group',
|
||||
tolerance: 'pointer',
|
||||
update: function (e, ui) {
|
||||
// Get the new and old index for the moved element (using the text as the identifier, so
|
||||
// we'd have a problem if two prevalues were the same, but that would be unlikely)
|
||||
var newIndex = ui.item.index();
|
||||
var movedPrevalueText = $('input[type="text"]', ui.item).val();
|
||||
var originalIndex = getElementIndexByPrevalueText(movedPrevalueText);
|
||||
|
||||
// Move the element in the model
|
||||
if (originalIndex > -1) {
|
||||
var movedElement = $scope.model.value[originalIndex];
|
||||
$scope.model.value.splice(originalIndex, 1);
|
||||
$scope.model.value.splice(newIndex, 0, movedElement);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function getElementIndexByPrevalueText(value) {
|
||||
for (var i = 0; i < $scope.model.value.length; i++) {
|
||||
if ($scope.model.value[i].value === value) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -3,10 +3,11 @@
|
||||
<input name="newItem" type="text" ng-model="newItem" val-highlight="hasError" />
|
||||
<button class="btn btn-small" ng-click="add($event)">Add</button>
|
||||
</div>
|
||||
<div class="control-group" ng-repeat="item in model.value">
|
||||
<input type="text" ng-model="item.value" val-server="item_{{$index}}" required />
|
||||
<button class="btn btn-small btn-danger" ng-click="remove(item, $event)">Remove</button>
|
||||
<div ui-sortable="sortableOptions">
|
||||
<div class="control-group" ng-repeat="item in model.value">
|
||||
<i class="icon icon-navigation handle"></i>
|
||||
<input type="text" ng-model="item.value" val-server="item_{{$index}}" required />
|
||||
<button class="btn btn-small btn-danger" ng-click="remove(item, $event)">Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
+2
-2
@@ -18,7 +18,7 @@
|
||||
<span class="help-inline" val-msg-for="resetPassword" val-toggle-msg="valServer"></span>
|
||||
</umb-control-group>
|
||||
|
||||
<!-- we need to show the old pass field when the provider cannot retreive the password -->
|
||||
<!-- we need to show the old pass field when the provider cannot retrieve the password -->
|
||||
<umb-control-group alias="oldPassword" label="Old password" ng-show="$parent.showOldPass()">
|
||||
<input type="text" name="oldPassword" ng-model="$parent.model.value.oldPassword"
|
||||
class="input-large umb-textstring textstring"
|
||||
@@ -50,4 +50,4 @@
|
||||
<a href="" ng-click="cancelChange()" ng-show="showCancelBtn()" class="btn btn-small">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user