Compare commits

..

1 Commits

Author SHA1 Message Date
Kenn Jacobsen 44a558ee6e Reload the node when publishing all unpublished children 2018-10-11 14:28:22 +02:00
256 changed files with 7711 additions and 10192 deletions
+1 -2
View File
@@ -13,5 +13,4 @@ indent_size = 4
# Trim trailing whitespace, limited support.
# https://github.com/editorconfig/editorconfig/wiki/Property-research:-Trim-trailing-spaces
trim_trailing_whitespace = true
csharp_prefer_braces = false : none
trim_trailing_whitespace = true
+6 -4
View File
@@ -1,4 +1,4 @@
_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/temp8/.github/V8_GETTING_STARTED.md) to go to the v8 branch_
_Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-CMS/blob/temp8/docs/CONTRIBUTING.md) to go to the v8 branch_
# Contributing to Umbraco CMS
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
@@ -16,9 +16,9 @@ This document gives you a quick overview on how to get started, we will link to
## Guidelines for contributions we welcome
Not all changes are wanted, so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valuable time.
Not all changes are wanted so on occassion we might close a PR without merging it. We will give you feedback why we can't accept your changes and we'll be nice about it, thanking you for spending your valueable time.
We have [documented what we consider small and large changes](CONTRIBUTION_GUIDELINES.md). Make sure to talk to us before making large changes.
We have [documented what we consider small and large changes](CONTRIBUTION_GUIDELINES.md), make sure to talk to us before making large changes.
Remember, if an issue is in the `Up for grabs` list or you've asked for some feedback before you sent us a PR, your PR will not be closed as unwanted.
@@ -36,7 +36,7 @@ Great question! The short version goes like this:
* **Build** - build your fork of Umbraco locally as described in [building Umbraco from source code](BUILD.md)
* **Change** - make your changes, experiment, have fun, explore and learn, and don't be afraid. We welcome all contributions and will [happily give feedback](#questions)
* **Commit** - done? Yay! 🎉 It is recommended to create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-12345`. This means it's a temporary branch for the particular issue you're working on, in this case `12345`
* **Commit** - done? Yay! 🎉 It is recommended to create a new branch now and name it after the issue you're fixing, we usually follow the format: `temp-U4-12345`. This means it's a temporary branch for the particular issue you're working on, in this case `U4-12345`
* **Push** - great, now you can push the changes up to your fork on GitHub
* **Create pull request** - exciting! You're ready to show us your changes (or not quite ready, you just need some feedback to progress). GitHub has picked up on the new branch you've pushed and will offer to create a Pull Request. Click that green button and away you go.
@@ -72,6 +72,7 @@ The pull request team consists of a member of Umbraco HQ, [Sebastiaan](https://g
- [Anders Bjerner](https://github.com/abjerner)
- [Dave Woestenborghs](https://github.com/dawoe)
- [Emma Burstow](https://github.com/emmaburstow)
- [Kyle Weems](https://github.com/cssquirrel)
- [Poornima Nayar](https://github.com/poornimanayar)
These wonderful volunteers will provide you with a first reply to your PR, review and test out your changes and might ask more questions. After that they'll let Umbraco HQ know if everything seems okay.
@@ -82,6 +83,7 @@ You can get in touch with [the PR team](#the-pr-team) in multiple ways, we love
- If there's an existing issue on the issue tracker then that's a good place to leave questions and discuss how to start or move forward
- Unsure where to start? Did something not work as expected? Try leaving a note in the ["Contributing to Umbraco"](https://our.umbraco.com/forum/contributing-to-umbraco-cms/) forum, the team monitors that one closely
- We're also [active in the Gitter chatroom](https://gitter.im/umbraco/Umbraco-CMS)
## Code of Conduct
+8 -12
View File
@@ -19,13 +19,13 @@ When contributing code to Umbraco there's plenty of things you'll want to know,
* [What branch should I target for my contributions?](#what-branch-should-i-target-for-my-contributions)
* [Building Umbraco from source code](#building-umbraco-from-source-code)
* [Keeping your Umbraco fork in sync with the main repository](#keeping-your-umbraco-fork-in-sync-with-the-main-repository)
## How Can I Contribute?
### Reporting Bugs
This section guides you through submitting a bug report for Umbraco CMS. Following these guidelines helps maintainers and the community understand your report 📝, reproduce the behavior 💻 💻, and find related reports 🔎.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](https://github.com/umbraco/Umbraco-CMS/issues/new/choose), the information it asks for helps us resolve issues faster.
Before creating bug reports, please check [this list](#before-submitting-a-bug-report) as you might find out that you don't need to create one. When you are creating a bug report, please [include as many details as possible](#how-do-i-submit-a-good-bug-report). Fill out [the required template](http://issues.umbraco.org/issues#newissue=61-30118), the information it asks for helps us resolve issues faster.
> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
@@ -52,7 +52,7 @@ Provide more context by answering these questions:
Include details about your configuration and environment:
* **Which version of Umbraco are you using?**
* **Which version of Umbraco are you using?**
* **What is the environment you're using Umbraco in?** Is this a problem on your local machine or on a server. Tell us about your configuration: Windows version, IIS/IISExpress, database type, etc.
* **Which packages do you have installed?**
@@ -69,7 +69,9 @@ Some additional hints that may be helpful:
### Your First Code Contribution
Unsure where to begin contributing to Umbraco? You can start by looking through [these `Up for grabs` and issues](https://issues.umbraco.org/issues?q=&project=U4&tagValue=upforgrabs&release=&issueType=&search=search) or on the [new issue tracker](https://github.com/umbraco/Umbraco-CMS/issues?q=is%3Aopen+is%3Aissue+label%3Acommunity%2Fup-for-grabs).
Unsure where to begin contributing to Umbraco? You can start by looking through [these `Up for grabs` and issues](http://issues.umbraco.org/issues/U4?q=%28project%3A+%7BU4%7D+Difficulty%3A+%7BVery+Easy%7D+%23Easy+%23Unresolved+Priority%3A+Normal+%23Major+%23Show-stopper+State%3A+-%7BIn+Progress%7D+sort+by%3A+votes+Affected+versions%3A+-6.*+Affected+versions%3A+-4.*%29+OR+%28tag%3A+%7BUp+For+Grabs%7D+%23Unresolved+%29).
The issue list is sorted by total number of upvotes. While not perfect, number of upvotes is a reasonable proxy for impact a given change will have.
### Pull Requests
@@ -80,7 +82,7 @@ The most successful pull requests usually look a like this:
* Unit tests, while optional are awesome, thank you!
* New code is commented with documentation from which [the reference documentation](https://our.umbraco.com/documentation/Reference/) is generated
Again, these are guidelines, not strict requirements.
Again, these are guidelines, not strict requirements.
## Making changes after the PR was opened
@@ -90,7 +92,7 @@ If you make the corrections we ask for in the same branch and push them to your
To be honest, we don't like rules very much. We trust you have the best of intentions and we encourage you to create working code. If it doesn't look perfect then we'll happily help clean it up.
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
That said, the Umbraco development team likes to follow the hints that ReSharper gives us (no problem if you don't have this installed) and we've added a `.editorconfig` file so that Visual Studio knows what to do with whitespace, line endings, etc.
## What should I know before I get started?
@@ -125,12 +127,6 @@ We like to use [Gitflow as much as possible](https://jeffkreeftmeijer.com/git-fl
### Building Umbraco from source code
In order to build the Umbraco source code locally, first make sure you have the following installed.
* Visual Studio 2017 v15.3+
* Node v10+ (Installed via `build.bat` script. If you already have it installed, make sure you're running at least v10)
* npm v6.4.1+ (Installed via `build.bat` script. If you already have it installed, make sure you're running at least v6.4.1)
The easiest way to get started is to run `build.bat` which will build both the backoffice (also known as "Belle") and the Umbraco core. You can then easily start debugging from Visual Studio, or if you need to debug Belle you can run `gulp dev` in `src\Umbraco.Web.UI.Client`. See [this page](BUILD.md) for more details.
Alternatively, you can open `src\umbraco.sln` in Visual Studio 2017 (version 15.3 or higher, [the community edition is free](https://www.visualstudio.com/thank-you-downloading-visual-studio/?sku=Community&rel=15) for you to use to contribute to Open Source projects). In Visual Studio, find the Task Runner Explorer (in the View menu under Other Windows) and run the build task under the gulpfile.
+3 -4
View File
@@ -1,12 +1,11 @@
### Prerequisites
- [ ] I have [created an issue](https://github.com/umbraco/Umbraco-CMS/issues) for the proposed changes in this PR, the link is:
- [ ] I have added steps to test this contribution in the description below
If there's an existing issue for this PR then this fixes: <!-- link to the issue here! -->
### Description
<!-- A description of the changes proposed in the pull-request and how to test these changes -->
<!-- A description of the changes proposed in the pull-request -->
<!-- Make sure to link to the related issue number so we can easily find it in the issue tracker -->
<!-- Thanks for contributing to Umbraco CMS! -->
+11 -11
View File
@@ -4,7 +4,7 @@ _Looking for Umbraco version 8? [Click here](https://github.com/umbraco/Umbraco-
Umbraco CMS
===========
The friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 443,000 websites worldwide: [https://umbraco.com](https://umbraco.com)
The friendliest, most flexible and fastest growing ASP.NET CMS used by more than 443,000 websites worldwide: [https://umbraco.com](https://umbraco.com)
[![ScreenShot](img/vimeo.png)](https://vimeo.com/172382998/)
@@ -17,34 +17,34 @@ Umbraco is a free open source Content Management System built on the ASP.NET pla
## Umbraco - The Friendly CMS
For the first time on the Microsoft platform, there is a free user- and developer-friendly CMS that makes it quick and easy to create websites - and a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, right out of the box.
For the first time on the Microsoft platform, there is a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box.
Umbraco is not only loved by developers, but is a content editor's dream. Enjoy intuitive editing tools, media management, responsive views, and approval workflows to send your content live.
Umbraco is not only loved by developers, but is a content editors dream. Enjoy intuitive editing tools, media management, responsive views and approval workflows to send your content live.
Used by more than 443,000 active websites including Carlsberg, Segway, Amazon and Heinz and **The Official ASP.NET and IIS.NET website from Microsoft** ([https://asp.net](https://asp.net) / [https://iis.net](https://iis.net)), you can be sure that the technology is proven, stable and scalable. Backed by the team at Umbraco HQ, and supported by a dedicated community of over 220,000 craftspeople globally, you can trust that Umbraco is a safe choice and is here to stay.
Used by more than 443,000 active websites including Carlsberg, Segway, Amazon and Heinz and **The Official ASP.NET and IIS.NET website from Microsoft** ([https://asp.net](https://asp.net) / [https://iis.net](https://iis.net)), you can be sure that the technology is proven, stable and scales. Backed by the team at Umbraco HQ, and supported by a dedicated community of over 220,000 craftspeople globally, you can trust that Umbraco is a safe choice and is here to stay.
To view more examples, please visit [https://umbraco.com/case-studies-testimonials/](https://umbraco.com/case-studies-testimonials/)
## Why Open Source?
As an Open Source platform, Umbraco is more than just a CMS. We are transparent with our roadmap for future versions, our incremental sprint planning notes are publicly accessible, and community contributions and packages are available for all to use.
As an Open Source platform, Umbraco is more than just a CMS. We are transparent with our roadmap for future versions, our incremental sprint planning notes are publicly accessible and community contributions and packages are available for all to use.
## Trying out Umbraco CMS
[Umbraco Cloud](https://umbraco.com/cloud) is the easiest and fastest way to use Umbraco yet, with full support for all your custom .NET code and integrations. You're up and running in less than a minute, and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14-day trial, no credit card needed.
[Umbraco Cloud](https://umbraco.com/cloud) is the easiest and fastest way to use Umbraco yet with full support for all your custom .NET code and intergrations. You're up and running in less than a minute and your life will be made easier with automated upgrades and a built-in deployment engine. We offer a free 14 day trial, no credit card needed.
If you want to DIY, you can [download Umbraco](https://our.umbraco.com/download) either as a ZIP file or via NuGet. It's the same version of Umbraco CMS that powers Umbraco Cloud, but you'll need to find a place to host it yourself, and handling deployments and upgrades will be all up to you.
If you want to DIY you can [download Umbraco](https://our.umbraco.com/download) either as a ZIP file or via NuGet. It's the same version of Umbraco CMS that powers Umbraco Cloud, but you'll need to find a place to host yourself and handling deployments and upgrades is all down to you.
## Community
Our friendly community is available 24/7 at the community hub we call ["Our Umbraco"](https://our.umbraco.com). Our Umbraco features forums for questions and answers, documentation, downloadable plugins for Umbraco, and a rich collection of community resources.
Our friendly community is available 24/7 at the community hub we call ["Our Umbraco"](https://our.umbraco.com). Our Umbraco feature forums for questions and answers, documentation, downloadable plugins for Umbraco and a rich collection of community resources.
## Contribute to Umbraco
Umbraco is contribution-focused and community-driven. If you want to contribute back to Umbraco, please check out our [guide to contributing](CONTRIBUTING.md).
Umbraco is contribution focused and community driven. If you want to contribute back to Umbraco please check out our [guide to contributing](CONTRIBUTING.md).
## Found a bug?
Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report, refer to our [online guide for reporting issues](https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/.github/CONTRIBUTING.md).
Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report refer to our [online guide for reporting issues](https://github.com/umbraco/Umbraco-CMS/blob/dev-v7/.github/CONTRIBUTING.md).
You can comment and report issues on the [github issue tracker](https://github.com/umbraco/Umbraco-CMS/issues).
Since [September 2018](https://umbraco.com/blog/a-second-take-on-umbraco-issue-tracker-hello-github-issues/), the old issue tracker is in read-only mode, but can still be found at [http://issues.umbraco.org](http://issues.umbraco.org).
Since [September 2018](https://umbraco.com/blog/a-second-take-on-umbraco-issue-tracker-hello-github-issues/) the old issue tracker is in read only mode, but can still be found at [http://issues.umbraco.org](http://issues.umbraco.org).
-1
View File
@@ -90,7 +90,6 @@ src/Umbraco.Web.UI.Client/[Bb]uild/*
src/Umbraco.Web.UI.Client/[Bb]uild/[Bb]elle/
src/Umbraco.Web.UI/[Uu]ser[Cc]ontrols/
src/Umbraco.Web.UI.Client/src/[Ll]ess/*.css
src/Umbraco.Web.UI.Client/vwd.webinfo
tools/NDepend/
src/Umbraco.Web.UI/App_Plugins/*
@@ -7,7 +7,7 @@
<span class="pull-right">
<a href="#top">Back to top</a>
</span>
<span>Copyright © 2016-present Umbraco<br>Generated by <strong>DocFX</strong></span>
<span>Copyright © 2016 Umbraco<br>Generated by <strong>DocFX</strong></span>
</div>
</div>
</footer>
+1 -1
View File
@@ -9,6 +9,6 @@ IF ERRORLEVEL 1 (
:error
ECHO.
ECHO Cannot run build\build.ps1.
ECHO Can not run build\build.ps1.
ECHO If this is due to a SecurityError then please refer to BUILD.md for help!
ECHO.
+20 -20
View File
@@ -3,57 +3,57 @@
[string]$Directory
)
$workingDirectory = $Directory
CD "$($workingDirectory)"
CD $workingDirectory
# Clone repo
$fullGitUrl = "https://$($env:GIT_URL)/$($env:GIT_REPOSITORYNAME).git"
git clone $($fullGitUrl) $($env:GIT_REPOSITORYNAME) 2>&1 | % { $_.ToString() }
$fullGitUrl = "https://$env:GIT_URL/$env:GIT_REPOSITORYNAME.git"
git clone $fullGitUrl 2>&1 | % { $_.ToString() }
# Remove everything so that unzipping the release later will update everything
# Don't remove the readme file nor the git directory
Write-Host "Cleaning up git directory before adding new version"
Remove-Item -Recurse "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)\*" -Exclude README.md,.git
Remove-Item -Recurse $workingDirectory\$env:GIT_REPOSITORYNAME\* -Exclude README.md,.git
# Find release zip
$zipsDir = "$($workingDirectory)\$($env:BUILD_DEFINITIONNAME)\zips"
$zipsDir = "$workingDirectory\$env:BUILD_DEFINITIONNAME\zips"
$pattern = "UmbracoCms.([0-9]{1,2}.[0-9]{1,3}.[0-9]{1,3}).zip"
Write-Host "Searching for Umbraco release files in $($zipsDir) for a file with pattern $($pattern)"
$file = (Get-ChildItem "$($zipsDir)" | Where-Object { $_.Name -match "$($pattern)" })
Write-Host "Searching for Umbraco release files in $workingDirectory\$zipsDir for a file with pattern $pattern"
$file = (Get-ChildItem $zipsDir | Where-Object { $_.Name -match "$pattern" })
if($file)
{
# Get release name
$version = [regex]::Match($($file.Name), $($pattern)).captures.groups[1].value
$releaseName = "Umbraco $($version)"
Write-Host "Found $($releaseName)"
$version = [regex]::Match($file.Name, $pattern).captures.groups[1].value
$releaseName = "Umbraco $version"
Write-Host "Found $releaseName"
# Unzip into repository to update release
Add-Type -AssemblyName System.IO.Compression.FileSystem
Write-Host "Unzipping $($file.FullName) to $($workingDirectory)\$($env:GIT_REPOSITORYNAME)"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$($file.FullName)", "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)")
Write-Host "Unzipping $($file.FullName) to $workingDirectory\$env:GIT_REPOSITORYNAME"
[System.IO.Compression.ZipFile]::ExtractToDirectory("$($file.FullName)", "$workingDirectory\$env:GIT_REPOSITORYNAME")
# Telling git who we are
git config --global user.email "coffee@umbraco.com" 2>&1 | % { $_.ToString() }
git config --global user.name "Umbraco HQ" 2>&1 | % { $_.ToString() }
# Commit
CD "$($workingDirectory)\$($env:GIT_REPOSITORYNAME)"
Write-Host "Committing Umbraco $($version) Release from Build Output"
CD $env:GIT_REPOSITORYNAME
Write-Host "Committing Umbraco $version Release from Build Output"
git add . 2>&1 | % { $_.ToString() }
git commit -m " Release $($releaseName) from Build Output" 2>&1 | % { $_.ToString() }
git commit -m " Release $releaseName from Build Output" 2>&1 | % { $_.ToString() }
# Tag the release
git tag -a "v$($version)" -m "v$($version)"
git tag -a "v$version" -m "v$version"
# Push release to master
$fullGitAuthUrl = "https://$($env:GIT_USERNAME):$($GitHubPersonalAccessToken)@$($env:GIT_URL)/$($env:GIT_REPOSITORYNAME).git"
git push $($fullGitAuthUrl) 2>&1 | % { $_.ToString() }
$fullGitAuthUrl = "https://$($env:GIT_USERNAME):$GitHubPersonalAccessToken@$env:GIT_URL/$env:GIT_REPOSITORYNAME.git"
git push $fullGitAuthUrl 2>&1 | % { $_.ToString() }
#Push tag to master
git push $($fullGitAuthUrl) --tags 2>&1 | % { $_.ToString() }
git push $fullGitAuthUrl --tags 2>&1 | % { $_.ToString() }
}
else
{
Write-Error "Umbraco release file not found, searched in $($workingDirectory)\$($zipsDir) for a file with pattern $($pattern) - canceling"
Write-Error "Umbraco release file not found, searched in $workingDirectory\$zipsDir for a file with pattern $pattern - cancelling"
}
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.13.2")]
[assembly: AssemblyInformationalVersion("7.13.2")]
[assembly: AssemblyFileVersion("7.13.0")]
[assembly: AssemblyInformationalVersion("7.13.0")]
@@ -70,8 +70,7 @@ namespace Umbraco.Core.Configuration
var config = WebConfigurationManager.OpenWebConfiguration(appPath);
var settings = (MailSettingsSectionGroup)config.GetSectionGroup("system.net/mailSettings");
// note: "noreply@example.com" is/was the sample SMTP from email - we'll regard that as "not configured"
if (settings == null || settings.Smtp == null || "noreply@example.com".Equals(settings.Smtp.From, StringComparison.OrdinalIgnoreCase)) return false;
if (settings == null || settings.Smtp == null) return false;
if (settings.Smtp.SpecifiedPickupDirectory != null && string.IsNullOrEmpty(settings.Smtp.SpecifiedPickupDirectory.PickupDirectoryLocation) == false)
return true;
if (settings.Smtp.Network != null && string.IsNullOrEmpty(settings.Smtp.Network.Host) == false)
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.13.2");
private static readonly Version Version = new Version("7.13.0");
/// <summary>
/// Gets the current version of Umbraco.
+2 -11
View File
@@ -1,6 +1,4 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
@@ -295,12 +293,6 @@ namespace Umbraco.Core.IO
{
var property = GetProperty(content, propertyTypeAlias);
var svalue = property.Value as string;
if (svalue != null && svalue.DetectIsJson())
{
// the property value is a JSON serialized image crop data set - grab the "src" property as the file source
var jObject = JsonConvert.DeserializeObject<JObject>(svalue);
svalue = jObject != null ? jObject.GetValueAsString("src") : svalue;
}
var oldpath = svalue == null ? null : GetRelativePath(svalue);
var filepath = StoreFile(content, property.PropertyType, filename, filestream, oldpath);
property.Value = GetUrl(filepath);
@@ -365,8 +357,7 @@ namespace Umbraco.Core.IO
{
var jpgInfo = ImageFile.FromStream(stream);
if (jpgInfo != null
&& jpgInfo.Format != ImageFileFormat.Unknown
if (jpgInfo.Format != ImageFileFormat.Unknown
&& jpgInfo.Properties.ContainsKey(ExifTag.PixelYDimension)
&& jpgInfo.Properties.ContainsKey(ExifTag.PixelXDimension))
{
+4 -5
View File
@@ -118,9 +118,9 @@ namespace Umbraco.Core.Media.Exif
/// <param name="encoding">The encoding to be used for text metadata when the source encoding is unknown.</param>
/// <returns>The <see cref="ImageFile"/> created from the file.</returns>
public static ImageFile FromStream(Stream stream, Encoding encoding)
{
{
// JPEG
if (JPEGDetector.IsOfType(stream))
if(JPEGDetector.IsOfType(stream))
{
return new JPEGFile(stream, encoding);
}
@@ -137,9 +137,8 @@ namespace Umbraco.Core.Media.Exif
return new SVGFile(stream);
}
// We don't know
return null;
}
throw new NotValidImageFileException ();
}
#endregion
}
}
@@ -7,7 +7,8 @@ namespace Umbraco.Core.Media.TypeDetector
public static bool IsOfType(Stream fileStream)
{
var header = GetFileHeader(fileStream);
return header != null && header[0] == 0xff && header[1] == 0xD8;
return header[0] == 0xff && header[1] == 0xD8;
}
}
}
@@ -7,13 +7,9 @@ namespace Umbraco.Core.Media.TypeDetector
public static byte[] GetFileHeader(Stream fileStream)
{
fileStream.Seek(0, SeekOrigin.Begin);
var header = new byte[8];
byte[] header = new byte[8];
fileStream.Seek(0, SeekOrigin.Begin);
// Invalid header
if (fileStream.Read(header, 0, header.Length) != header.Length)
return null;
return header;
}
}
@@ -7,17 +7,17 @@ namespace Umbraco.Core.Media.TypeDetector
{
public static bool IsOfType(Stream fileStream)
{
var tiffHeader = GetFileHeader(fileStream);
return tiffHeader != null && tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00";
string tiffHeader = GetFileHeader(fileStream);
return tiffHeader == "MM\x00\x2a" || tiffHeader == "II\x2a\x00";
}
public static string GetFileHeader(Stream fileStream)
{
var header = RasterizedTypeDetector.GetFileHeader(fileStream);
if (header == null)
return null;
var tiffHeader = Encoding.ASCII.GetString(header, 0, 4);
string tiffHeader = Encoding.ASCII.GetString(header, 0, 4);
return tiffHeader;
}
}
+2 -7
View File
@@ -21,12 +21,7 @@ namespace Umbraco.Core.Models
string Description { get; set; }
/// <summary>
/// Gets or sets the icon for the content type. The value is a CSS class name representing
/// the icon (eg. <c>icon-home</c>) along with an optional CSS class name representing the
/// color (eg. <c>icon-blue</c>). Put together, the value for this scenario would be
/// <c>icon-home color-blue</c>.
///
/// If a class name for the color isn't specified, the icon color will default to black.
/// Gets or Sets the Icon for the ContentType
/// </summary>
string Icon { get; set; }
@@ -124,4 +119,4 @@ namespace Umbraco.Core.Models
/// <returns></returns>
bool MovePropertyType(string propertyTypeAlias, string propertyGroupName);
}
}
}
+3 -7
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Net;
using System.Security.Cryptography;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
@@ -36,12 +35,9 @@ namespace Umbraco.Core.Models
/// A list of 5 different sized avatar URLs
/// </returns>
internal static string[] GetUserAvatarUrls(this IUser user, ICacheProvider staticCache)
{
// If FIPS is required, never check the Gravatar service as it only supports MD5 hashing.
// Unfortunately, if the FIPS setting is enabled on Windows, using MD5 will throw an exception
// and the website will not run.
// Also, check if the user has explicitly removed all avatars including a gravatar, this will be possible and the value will be "none"
if (user.Avatar == "none" || CryptoConfig.AllowOnlyFipsAlgorithms)
{
//check if the user has explicitly removed all avatars including a gravatar, this will be possible and the value will be "none"
if (user.Avatar == "none")
{
return new string[0];
}
@@ -158,7 +158,9 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
Name = indexName,
IndexType = attribute.IndexType,
ColumnName = columnName,
TableName = tableName,
TableName = tableName,
IsClustered = attribute.IndexType == IndexTypes.Clustered,
IsUnique = attribute.IndexType == IndexTypes.UniqueNonClustered
};
if (string.IsNullOrEmpty(attribute.ForColumns) == false)
@@ -172,4 +174,4 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
return definition;
}
}
}
}
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using Umbraco.Core.Persistence.DatabaseAnnotations;
@@ -15,13 +14,9 @@ namespace Umbraco.Core.Persistence.DatabaseModelDefinitions
public virtual string SchemaName { get; set; }
public virtual string TableName { get; set; }
public virtual string ColumnName { get; set; }
[Obsolete("Use the IndexType property instead and set it to IndexTypes.UniqueNonClustered")]
public virtual bool IsUnique { get; set; }
[Obsolete("Use the IndexType property instead and set it to IndexTypes.Clustered")]
public bool IsClustered { get; set; }
public virtual ICollection<IndexColumnDefinition> Columns { get; set; }
public IndexTypes IndexType { get; set; }
}
}
}
@@ -140,9 +140,6 @@ namespace Umbraco.Core.Persistence.Factories
/// <returns></returns>
internal static bool TryMatch(string text, out string mediaPath)
{
//TODO: In v8 we should allow exposing this via the property editor in a much nicer way so that the property editor
// can tell us directly what any URL is for a given property if it contains an asset
mediaPath = null;
if (string.IsNullOrWhiteSpace(text))
@@ -158,4 +155,4 @@ namespace Umbraco.Core.Persistence.Factories
return true;
}
}
}
}
@@ -256,10 +256,10 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 7, DataTypeId = -92, PropertyEditorAlias = Constants.PropertyEditors.NoEditAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 8, DataTypeId = -36, PropertyEditorAlias = Constants.PropertyEditors.DateTimeAlias, DbType = "Date" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 9, DataTypeId = -37, PropertyEditorAlias = Constants.PropertyEditors.ColorPickerAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 11, DataTypeId = -39, PropertyEditorAlias = Constants.PropertyEditors.DropDownListFlexibleAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 11, DataTypeId = -39, PropertyEditorAlias = Constants.PropertyEditors.DropDownListMultipleAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 12, DataTypeId = -40, PropertyEditorAlias = Constants.PropertyEditors.RadioButtonListAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 13, DataTypeId = -41, PropertyEditorAlias = Constants.PropertyEditors.DateAlias, DbType = "Date" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 14, DataTypeId = -42, PropertyEditorAlias = Constants.PropertyEditors.DropDownListFlexibleAlias, DbType = "Integer" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 14, DataTypeId = -42, PropertyEditorAlias = Constants.PropertyEditors.DropDownListAlias, DbType = "Integer" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 15, DataTypeId = -43, PropertyEditorAlias = Constants.PropertyEditors.CheckBoxListAlias, DbType = "Nvarchar" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 22, DataTypeId = 1041, PropertyEditorAlias = Constants.PropertyEditors.TagsAlias, DbType = "Ntext" });
_database.Insert("cmsDataType", "pk", false, new DataTypeDto { PrimaryKey = 24, DataTypeId = 1043, PropertyEditorAlias = Constants.PropertyEditors.ImageCropperAlias, DbType = "Ntext" });
@@ -300,12 +300,6 @@ namespace Umbraco.Core.Persistence.Migrations.Initial
//default's for MultipleMediaPickerAlias picker
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 6, Alias = "multiPicker", SortOrder = 0, DataTypeNodeId = 1049, Value = "1" });
// Defaults for single item dropdown
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 7, Alias = "multiple", SortOrder = 0, DataTypeNodeId = -42, Value = "0" });
// Defaults for multiple item dropdown
_database.Insert("cmsDataTypePreValues", "id", false, new DataTypePreValueDto { Id = 8, Alias = "multiple", SortOrder = 0, DataTypeNodeId = -39, Value = "1" });
}
private void CreateUmbracoRelationTypeData()
@@ -1,5 +1,4 @@
using System.Data;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions;
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
@@ -140,12 +139,10 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column
{
Name = indexName,
SchemaName = Expression.SchemaName,
TableName = Expression.TableName,
IndexType = IndexTypes.UniqueNonClustered
TableName = Expression.TableName,
IsUnique = true
});
index.Index.Columns.Add(new IndexColumnDefinition
{
Name = Expression.Column.Name
@@ -245,4 +242,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Column
return this;
}
}
}
}
@@ -1,5 +1,4 @@
using System.Data;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Syntax.Alter.Expressions;
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
@@ -125,8 +124,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table
{
Name = indexName,
SchemaName = Expression.SchemaName,
TableName = Expression.TableName,
IndexType = IndexTypes.UniqueNonClustered
TableName = Expression.TableName,
IsUnique = true
});
index.Index.Columns.Add(new IndexColumnDefinition
@@ -260,4 +259,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Alter.Table
return this;
}
}
}
}
@@ -1,5 +1,4 @@
using System.Data;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
using Umbraco.Core.Persistence.SqlSyntax;
@@ -115,8 +114,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Column
{
Name = indexName,
SchemaName = Expression.SchemaName,
TableName = Expression.TableName,
IndexType = IndexTypes.UniqueNonClustered
TableName = Expression.TableName,
IsUnique = true
});
index.Index.Columns.Add(new IndexColumnDefinition
@@ -218,4 +217,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Column
return this;
}
}
}
}
@@ -47,27 +47,39 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Index
}
ICreateIndexOnColumnSyntax ICreateIndexColumnOptionsSyntax.Unique()
{
Expression.Index.IndexType = IndexTypes.UniqueNonClustered;
{
Expression.Index.IsUnique = true;
//if it is Unique then it must be unique nonclustered and set the other flags
Expression.Index.IndexType = IndexTypes.UniqueNonClustered;
Expression.Index.IsClustered = false;
return this;
}
public ICreateIndexOnColumnSyntax NonClustered()
{
Expression.Index.IndexType = IndexTypes.NonClustered;
Expression.Index.IndexType = IndexTypes.NonClustered;
Expression.Index.IsClustered = false;
Expression.Index.IndexType = IndexTypes.NonClustered;
Expression.Index.IsUnique = false;
return this;
}
public ICreateIndexOnColumnSyntax Clustered()
{
Expression.Index.IndexType = IndexTypes.Clustered;
return this;
{
Expression.Index.IndexType = IndexTypes.Clustered;
Expression.Index.IsClustered = true;
//if it is clustered then we have to change the index type set the other flags
Expression.Index.IndexType = IndexTypes.Clustered;
Expression.Index.IsClustered = true;
Expression.Index.IsUnique = false;
return this;
}
ICreateIndexOnColumnSyntax ICreateIndexOptionsSyntax.Unique()
{
Expression.Index.IndexType = IndexTypes.UniqueNonClustered;
Expression.Index.IndexType = IndexTypes.UniqueNonClustered;
Expression.Index.IsUnique = true;
return this;
}
}
}
}
@@ -1,5 +1,4 @@
using System.Data;
using Umbraco.Core.Persistence.DatabaseAnnotations;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Syntax.Create.Expressions;
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
@@ -165,8 +164,8 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table
{
Name = indexName,
SchemaName = Expression.SchemaName,
TableName = Expression.TableName,
IndexType = IndexTypes.UniqueNonClustered
TableName = Expression.TableName,
IsUnique = true
});
index.Index.Columns.Add(new IndexColumnDefinition
@@ -268,4 +267,4 @@ namespace Umbraco.Core.Persistence.Migrations.Syntax.Create.Table
return this;
}
}
}
}
@@ -1,36 +0,0 @@
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence.SqlSyntax;
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourteenZero
{
/// <summary>
/// Migrates member group picker properties from NVarchar to NText. See https://github.com/umbraco/Umbraco-CMS/issues/3268.
/// </summary>
[Migration("7.14.0", 1, Constants.System.UmbracoMigrationName)]
public class UpdateMemberGroupPickerData : MigrationBase
{
public UpdateMemberGroupPickerData(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
{
}
public override void Up()
{
// move the data for all member group properties from the NVarchar to the NText column and clear the NVarchar column
Execute.Sql(@"UPDATE cmsPropertyData SET dataNtext = dataNvarchar, dataNvarchar = NULL
WHERE dataNtext IS NULL AND id IN (
SELECT id FROM cmsPropertyData WHERE propertyTypeId in (
SELECT id from cmsPropertyType where dataTypeID IN (
SELECT nodeId FROM cmsDataType WHERE propertyEditorAlias = 'Umbraco.MemberGroupPicker'
)
)
)");
// ensure that all exising member group properties are defined as NText
Execute.Sql("UPDATE cmsDataType SET dbType = 'Ntext' WHERE propertyEditorAlias = 'Umbraco.MemberGroupPicker'");
}
public override void Down()
{
}
}
}
@@ -48,7 +48,7 @@ namespace Umbraco.Core.Persistence.Repositories
var sql = GetBaseQuery(false);
if (query == null) query = new Query<IAuditItem>();
var queryHasWhereClause = query.GetWhereClauses().Any();
var translatorIds = new SqlTranslator<IAuditItem>(sql, query);
var translatedQuery = translatorIds.Translate();
@@ -59,7 +59,7 @@ namespace Umbraco.Core.Persistence.Repositories
{
var filterSql = new Sql();
foreach (var filterClause in customFilterWheres)
{
{
filterSql.Append($"AND ({filterClause.Item1})", filterClause.Item2);
}
@@ -70,7 +70,7 @@ namespace Umbraco.Core.Persistence.Repositories
{
var filterSql = new Sql();
foreach (var filterClause in auditTypeFilter)
{
{
filterSql.Append("AND (logHeader = @logHeader)", new { logHeader = filterClause.ToString() });
}
@@ -80,14 +80,14 @@ namespace Umbraco.Core.Persistence.Repositories
if (orderDirection == Direction.Descending)
translatedQuery.OrderByDescending("Datestamp");
else
translatedQuery.OrderBy("Datestamp");
translatedQuery.OrderBy("Datestamp");
// Get page of results and total count
var pagedResult = Database.Page<LogDto>(pageIndex + 1, pageSize, translatedQuery);
totalRecords = pagedResult.TotalItems;
var pages = pagedResult.Items.Select(
dto => new AuditItem(dto.NodeId, dto.Comment, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId)).ToArray();
dto => new AuditItem(dto.Id, dto.Comment, Enum<AuditType>.ParseOrNull(dto.Header) ?? AuditType.Custom, dto.UserId)).ToArray();
//Mapping the DateStamp
for (var i = 0; i < pages.Length; i++)
@@ -142,7 +142,7 @@ namespace Umbraco.Core.Persistence.Repositories
protected override IEnumerable<IAuditItem> PerformGetByQuery(IQuery<IAuditItem> query)
{
throw new NotImplementedException();
}
}
protected override string GetBaseWhereClause()
{
@@ -167,7 +167,7 @@ namespace Umbraco.Core.Persistence.Repositories
// Apply filter
if (filterSql != null)
{
//ensure we don't append a WHERE if there is already one
//ensure we don't append a WHERE if there is already one
var sqlFilter = hasWhereClause
? filterSql.SQL
: " WHERE " + filterSql.SQL.TrimStart("AND ");
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
@@ -64,8 +64,7 @@ namespace Umbraco.Core.Persistence.Repositories
}, objectTypeId);
var translator = new SqlTranslator<IUmbracoEntity>(sqlClause, query);
var entitySql = translator.Translate();
var pagedSql = entitySql.Append(GetGroupBy(isContent, isMedia, false));
pagedSql = (orderDirection == Direction.Descending) ? pagedSql.OrderByDescending("umbracoNode.id") : pagedSql.OrderBy("umbracoNode.id");
var pagedSql = entitySql.Append(GetGroupBy(isContent, isMedia, false)).OrderBy("umbracoNode.id");
IEnumerable<IUmbracoEntity> result;
@@ -81,8 +80,8 @@ namespace Umbraco.Core.Persistence.Repositories
foreach (var idGroup in ids)
{
var propSql = GetPropertySql(Constants.ObjectTypes.Media)
.Where("contentNodeId IN (@ids)", new { ids = idGroup });
propSql = (orderDirection == Direction.Descending) ? propSql.OrderByDescending("contentNodeId") : propSql.OrderBy("contentNodeId");
.Where("contentNodeId IN (@ids)", new {ids = idGroup})
.OrderBy("contentNodeId");
//This does NOT fetch all data into memory in a list, this will read
// over the records as a data reader, this is much better for performance and memory,
@@ -332,23 +331,14 @@ namespace Umbraco.Core.Persistence.Repositories
return list;
}
/// <summary>
/// Gets entities by query.
/// </summary>
/// <param name="query"></param>
/// <param name="objectTypeId"></param>
/// <returns></returns>
/// <remarks>
/// Note that this will also fetch all property data for media items, which can cause performance problems
/// when used without paging, in sites with large amounts of data in cmsPropertyData.
/// </remarks>
public virtual IEnumerable<IUmbracoEntity> GetByQuery(IQuery<IUmbracoEntity> query, Guid objectTypeId)
{
var isContent = objectTypeId == Constants.ObjectTypes.DocumentGuid || objectTypeId == Constants.ObjectTypes.DocumentBlueprintGuid;
var isMedia = objectTypeId == Constants.ObjectTypes.MediaGuid;
bool isContent = objectTypeId == Constants.ObjectTypes.DocumentGuid || objectTypeId == Constants.ObjectTypes.DocumentBlueprintGuid;
bool isMedia = objectTypeId == Constants.ObjectTypes.MediaGuid;
var sqlClause = GetBaseWhere(GetBase, isContent, isMedia, null, objectTypeId);
var translator = new SqlTranslator<IUmbracoEntity>(sqlClause, query);
var entitySql = translator.Translate();
@@ -374,49 +364,22 @@ namespace Umbraco.Core.Persistence.Repositories
}
else
{
return GetByQueryInternal(entitySql, isContent, isMedia);
//use dynamic so that we can get ALL properties from the SQL so we can chuck that data into our AdditionalData
var finalSql = entitySql.Append(GetGroupBy(isContent, false));
//query = read forward data reader, do not load everything into mem
var dtos = _work.Database.Query<dynamic>(finalSql);
var collection = new EntityDefinitionCollection();
foreach (var dto in dtos)
{
collection.AddOrUpdate(new EntityDefinition(factory, dto, isContent, false));
}
return collection.Select(x => x.BuildFromDynamic()).ToList();
}
}
/// <summary>
/// Gets entities by query without fetching property data.
/// </summary>
/// <param name="query"></param>
/// <param name="objectTypeId"></param>
/// <returns></returns>
/// <remarks>
/// This is supposed to be internal and can be used when getting all entities without paging, without causing
/// performance issues.
/// </remarks>
internal IEnumerable<IUmbracoEntity> GetMediaByQueryWithoutPropertyData(IQuery<IUmbracoEntity> query)
{
var sqlClause = GetBaseWhere(GetBase, false, true, null, UmbracoObjectTypes.Media.GetGuid());
var translator = new SqlTranslator<IUmbracoEntity>(sqlClause, query);
var entitySql = translator.Translate();
return GetByQueryInternal(entitySql, false, true);
}
internal IEnumerable<IUmbracoEntity> GetByQueryInternal(Sql entitySql, bool isContent, bool isMedia)
{
var factory = new UmbracoEntityFactory();
//use dynamic so that we can get ALL properties from the SQL so we can chuck that data into our AdditionalData
var finalSql = entitySql.Append(GetGroupBy(isContent, isMedia));
//query = read forward data reader, do not load everything into mem
var dtos = _work.Database.Query<dynamic>(finalSql);
var collection = new EntityDefinitionCollection();
foreach (var dto in dtos)
{
collection.AddOrUpdate(new EntityDefinition(factory, dto, isContent, isMedia));
}
return collection.Select(x => x.BuildFromDynamic()).ToList();
}
#endregion
#region Sql Statements
@@ -888,4 +851,4 @@ namespace Umbraco.Core.Persistence.Repositories
}
#endregion
}
}
}
@@ -258,20 +258,12 @@ namespace Umbraco.Core.Persistence.Repositories
//.Where(x => Equals(x, default(TId)) == false)
.ToArray();
// can't query more than 2000 ids at a time... but if someone is really querying 2000+ entities,
// the additional overhead of fetching them in groups is minimal compared to the lookup time of each group
const int maxParams = 2000;
if (ids.Length <= maxParams)
if (ids.Length > 2000)
{
return CachePolicy.GetAll(ids, PerformGetAll);
throw new InvalidOperationException("Cannot perform a query with more than 2000 parameters");
}
var entities = new List<TEntity>();
foreach (var groupOfIds in ids.InGroupsOf(maxParams))
{
entities.AddRange(CachePolicy.GetAll(groupOfIds.ToArray(), PerformGetAll));
}
return entities;
return CachePolicy.GetAll(ids, PerformGetAll);
}
protected abstract IEnumerable<TEntity> PerformGetByQuery(IQuery<TEntity> query);
@@ -152,7 +152,7 @@ namespace Umbraco.Core.Persistence.Repositories
public IProfile GetProfile(string username)
{
var sql = GetBaseQuery(false).Where<UserDto>(userDto => userDto.Login == username, SqlSyntax);
var sql = GetBaseQuery(false).Where<UserDto>(userDto => userDto.UserName == username, SqlSyntax);
var dto = Database.Fetch<UserDto>(sql)
.FirstOrDefault();
@@ -382,7 +382,6 @@ ORDER BY colName";
"DELETE FROM cmsTask WHERE parentUserId = @Id",
"DELETE FROM umbracoUser2UserGroup WHERE userId = @Id",
"DELETE FROM umbracoUser2NodeNotify WHERE userId = @Id",
"DELETE FROM umbracoUserStartNode WHERE userId = @Id",
"DELETE FROM umbracoUser WHERE id = @Id",
"DELETE FROM umbracoExternalLogin WHERE id = @Id"
};
@@ -385,16 +385,10 @@ namespace Umbraco.Core.Persistence.Repositories
if (orderDirection == Direction.Descending)
{
sortedSql.OrderByDescending("CustomPropData.CustomPropVal");
// need to ensure ordering unique by using id as CustomPropVal may not be unique
// see: https://github.com/umbraco/Umbraco-CMS/issues/3296
sortedSql.OrderByDescending("umbracoNode.id");
}
else
{
sortedSql.OrderBy("CustomPropData.CustomPropVal");
// need to ensure ordering unique by using id as CustomPropVal may not be unique
// see: https://github.com/umbraco/Umbraco-CMS/issues/3296
sortedSql.OrderBy("umbracoNode.id");
}
}
@@ -333,9 +333,14 @@ ORDER BY TABLE_NAME, INDEX_NAME",
switch (systemMethod)
{
case SystemMethods.NewGuid:
return null; // NOT SUPPORTED!
return null; // NOT SUPPORTED!
//return "NEWID()";
case SystemMethods.CurrentDateTime:
return "CURRENT_TIMESTAMP";
//case SystemMethods.NewSequentialId:
// return "NEWSEQUENTIALID()";
//case SystemMethods.CurrentUTCDateTime:
// return "GETUTCDATE()";
}
return null;
@@ -42,22 +42,16 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
var sourceAsString = source?.ToString();
if(sourceAsString.IsNullOrWhiteSpace())
{
return new string[0];
}
// if Json storage type deserialzie and return as string array
if (JsonStorageType(propertyType.DataTypeId))
{
var jArray = JsonConvert.DeserializeObject<JArray>(sourceAsString);
var jArray = JsonConvert.DeserializeObject<JArray>(source.ToString());
return jArray.ToObject<string[]>();
}
// Otherwise assume CSV storage type and return as string array
var csvTags =
sourceAsString
source.ToString()
.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries)
.ToArray();
return csvTags;
+1 -11
View File
@@ -2575,18 +2575,8 @@ namespace Umbraco.Core.Services
_publishingStrategy.PublishingFinalized(uow, descendants, false);
}
Audit(uow, AuditType.Publish, "Save and Publish performed by user", userId, content.Id);
uow.Commit();
if (publishStatus.StatusType == PublishStatusType.Success)
{
Audit(uow, AuditType.Publish, "Save and Publish performed by user", userId, content.Id);
}
else
{
Audit(uow, AuditType.Save, "Save performed by user", userId, content.Id);
}
uow.Commit();
return Attempt.If(publishStatus.StatusType == PublishStatusType.Success, publishStatus);
}
}
+7 -25
View File
@@ -2,6 +2,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using Umbraco.Core.Cache;
using Umbraco.Core.CodeAnnotations;
using Umbraco.Core.Events;
using Umbraco.Core.Logging;
@@ -11,7 +13,6 @@ using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Querying;
using Umbraco.Core.Persistence.Repositories;
using Umbraco.Core.Persistence.UnitOfWork;
namespace Umbraco.Core.Services
@@ -286,35 +287,16 @@ namespace Umbraco.Core.Services
public virtual IEnumerable<IUmbracoEntity> GetChildren(int parentId, UmbracoObjectTypes umbracoObjectType)
{
var objectTypeId = umbracoObjectType.GetGuid();
using (var uow = UowProvider.GetUnitOfWork(readOnly: true))
{
var repository = RepositoryFactory.CreateEntityRepository(uow);
var query = Query<IUmbracoEntity>.Builder.Where(x => x.ParentId == parentId);
return repository.GetByQuery(query, objectTypeId);
}
}
/// <summary>
/// Gets a collection of children by the parent's Id and UmbracoObjectType without adding property data
/// </summary>
/// <param name="parentId">Id of the parent to retrieve children for</param>
/// <returns>An enumerable list of <see cref="IUmbracoEntity"/> objects</returns>
internal IEnumerable<IUmbracoEntity> GetMediaChildrenWithoutPropertyData(int parentId)
{
var objectTypeId = UmbracoObjectTypes.Media.GetGuid();
using (var uow = UowProvider.GetUnitOfWork(readOnly: true))
using (var uow = UowProvider.GetUnitOfWork(readOnly:true))
{
var repository = RepositoryFactory.CreateEntityRepository(uow);
var query = Query<IUmbracoEntity>.Builder.Where(x => x.ParentId == parentId);
// Not pretty having to cast the repository, but it is the only way to get to use an internal method that we
// do not want to make public on the interface. Unfortunately also prevents this from being unit tested.
// See this issue for details on why we need this:
// https://github.com/umbraco/Umbraco-CMS/issues/3457
return ((EntityRepository)repository).GetMediaByQueryWithoutPropertyData(query);
var contents = repository.GetByQuery(query, objectTypeId);
return contents;
}
}
/// <summary>
/// Returns a paged collection of children
/// </summary>
@@ -799,4 +781,4 @@ namespace Umbraco.Core.Services
return node.NodeId;
}
}
}
}
@@ -26,15 +26,6 @@ namespace Umbraco.Core.Services
/// <param name="userId">Id of the User deleting the Media</param>
Attempt<OperationStatus> MoveToRecycleBin(IMedia media, int userId = 0);
/// <summary>
/// Moves an <see cref="IMedia"/> object to a new location
/// </summary>
/// <param name="media">The <see cref="IMedia"/> to move</param>
/// <param name="parentId">Id of the Media's new Parent</param>
/// <param name="userId">Id of the User moving the Media</param>
/// <returns>True if moving succeeded, otherwise False</returns>
Attempt<OperationStatus> Move(IMedia media, int parentId, int userId = 0);
/// <summary>
/// Permanently deletes an <see cref="IMedia"/> object
/// </summary>
@@ -278,7 +269,6 @@ namespace Umbraco.Core.Services
/// <param name="userId">Id of the User moving the Media</param>
void Move(IMedia media, int parentId, int userId = 0);
/// <summary>
/// Deletes an <see cref="IMedia"/> object by moving it to the Recycle Bin
/// </summary>
+8 -16
View File
@@ -465,7 +465,7 @@ namespace Umbraco.Core.Services
return repository.GetByQuery(query);
}
}
[Obsolete("Use the overload with 'long' parameter types instead")]
[EditorBrowsable(EditorBrowsableState.Never)]
public IEnumerable<IMedia> GetPagedChildren(int id, int pageIndex, int pageSize, out int totalChildren,
@@ -509,7 +509,7 @@ namespace Umbraco.Core.Services
public IEnumerable<IMedia> GetPagedChildren(int id, long pageIndex, int pageSize, out long totalChildren,
string orderBy, Direction orderDirection, bool orderBySystemField, string filter)
{
return GetPagedChildren(id, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filter, null);
return GetPagedChildren(id, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, true, filter, null);
}
/// <summary>
@@ -758,20 +758,19 @@ namespace Umbraco.Core.Services
/// <param name="media">The <see cref="IMedia"/> to move</param>
/// <param name="parentId">Id of the Media's new Parent</param>
/// <param name="userId">Id of the User moving the Media</param>
/// <returns>True if moving succeeded, otherwise False</returns>
public Attempt<OperationStatus> Move(IMedia media, int parentId, int userId = 0)
public void Move(IMedia media, int parentId, int userId = 0)
{
//TODO: This all needs to be on the repo layer in one transaction!
if (media == null) throw new ArgumentNullException("media");
var evtMsgs = EventMessagesFactory.Get();
using (new WriteLock(Locker))
{
//This ensures that the correct method is called if this method is used to Move to recycle bin.
if (parentId == Constants.System.RecycleBinMedia)
{
MoveToRecycleBin(media, userId);
return OperationStatus.Success(evtMsgs);
return;
}
using (var uow = UowProvider.GetUnitOfWork())
@@ -779,11 +778,11 @@ namespace Umbraco.Core.Services
var originalPath = media.Path;
var moveEventInfo = new MoveEventInfo<IMedia>(media, originalPath, parentId);
var moveEventArgs = new MoveEventArgs<IMedia>(true, evtMsgs, moveEventInfo);
var moveEventArgs = new MoveEventArgs<IMedia>(moveEventInfo);
if (uow.Events.DispatchCancelable(Moving, this, moveEventArgs, "Moving"))
{
uow.Commit();
return OperationStatus.Cancelled(evtMsgs); ;
return;
}
media.ParentId = parentId;
@@ -817,8 +816,6 @@ namespace Umbraco.Core.Services
Audit(uow, AuditType.Move, "Move Media performed by user", userId, media.Id);
uow.Commit();
}
return OperationStatus.Success(evtMsgs);
}
}
@@ -1104,7 +1101,7 @@ namespace Umbraco.Core.Services
media.EnsureValidPath(Logger, entity => GetById(entity.ParentId), QuickUpdate);
var originalPath = media.Path;
var moveEventInfo = new MoveEventInfo<IMedia>(media, originalPath, Constants.System.RecycleBinMedia);
var moveEventArgs = new MoveEventArgs<IMedia>(true, evtMsgs, moveEventInfo);
var moveEventArgs = new MoveEventArgs<IMedia>(moveEventInfo);
if (uow.Events.DispatchCancelable(Trashing, this, moveEventArgs, "Trashing"))
{
uow.Commit();
@@ -1471,11 +1468,6 @@ namespace Umbraco.Core.Services
}
}
void IMediaService.Move(IMedia media, int parentId, int userId)
{
Move(media, parentId, userId);
}
#region Event Handlers
@@ -58,7 +58,54 @@ namespace Umbraco.Core.Services
if (entity is IContent == false)
throw new NotSupportedException();
SendNotifications(operatingUser, new[] { (IContent)entity }, action, actionName, http, createSubject, createBody);
var content = (IContent) entity;
// lazily get previous version
IContentBase prevVersion = null;
// do not load *all* users in memory at once
// do not load notifications *per user* (N+1 select)
// cannot load users & notifications in 1 query (combination btw User2AppDto and User2NodeNotifyDto)
// => get batches of users, get all their notifications in 1 query
// re. users:
// users being (dis)approved = not an issue, filtered in memory not in SQL
// users being modified or created = not an issue, ordering by ID, as long as we don't *insert* low IDs
// users being deleted = not an issue for GetNextUsers
var id = 0;
var nodeIds = content.Path.Split(',').Select(int.Parse).ToArray();
const int pagesz = 400; // load batches of 400 users
do
{
// users are returned ordered by id, notifications are returned ordered by user id
var users = ((UserService) _userService).GetNextUsers(id, pagesz).Where(x => x.IsApproved).ToList();
var notifications = GetUsersNotifications(users.Select(x => x.Id), action, nodeIds, Constants.ObjectTypes.DocumentGuid).ToList();
if (notifications.Count == 0) break;
var i = 0;
foreach (var user in users)
{
// continue if there's no notification for this user
if (notifications[i].UserId != user.Id) continue; // next user
// lazy load prev version
if (prevVersion == null)
{
prevVersion = GetPreviousVersion(entity.Id);
}
// queue notification
var req = CreateNotificationRequest(operatingUser, user, content, prevVersion, actionName, http, createSubject, createBody);
Enqueue(req);
// skip other notifications for this user
while (i < notifications.Count && notifications[i++].UserId == user.Id) ;
if (i >= notifications.Count) break; // break if no more notifications
}
// load more users if any
id = users.Count == pagesz ? users.Last().Id + 1 : -1;
} while (id > 0);
}
/// <summary>
@@ -107,14 +154,7 @@ namespace Umbraco.Core.Services
// lazily get versions
var prevVersionDictionary = new Dictionary<int, IContentBase>();
// do not load *all* users in memory at once
// do not load notifications *per user* (N+1 select)
// cannot load users & notifications in 1 query (combination btw User2AppDto and User2NodeNotifyDto)
// => get batches of users, get all their notifications in 1 query
// re. users:
// users being (dis)approved = not an issue, filtered in memory not in SQL
// users being modified or created = not an issue, ordering by ID, as long as we don't *insert* low IDs
// users being deleted = not an issue for GetNextUsers
// see notes above
var id = 0;
const int pagesz = 400; // load batches of 400 users
do
@@ -616,4 +656,4 @@ namespace Umbraco.Core.Services
#endregion
}
}
}
+3 -2
View File
@@ -53,7 +53,7 @@ namespace Umbraco.Core
.Reverse()
.ToArray();
return nodeIds;
}
}
/// <summary>
/// Removes new lines and tabs
@@ -189,6 +189,7 @@ namespace Umbraco.Core
outputArray[i] = char.IsLetterOrDigit(inputArray[i]) ? inputArray[i] : replacement;
return new string(outputArray);
}
private static readonly char[] CleanForXssChars = "*?(){}[];:%<>/\\|&'\"".ToCharArray();
/// <summary>
@@ -541,7 +542,7 @@ namespace Umbraco.Core
public static string StripHtml(this string text)
{
const string pattern = @"<(.|\n)*?>";
return Regex.Replace(text, pattern, string.Empty);
return Regex.Replace(text, pattern, String.Empty);
}
/// <summary>
-1
View File
@@ -572,7 +572,6 @@
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddInstructionCountColumn.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddCmsMediaTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenEightZero\AddUserLoginTable.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenFourteenZero\UpdateMemberGroupPickerData.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\RenameTrueFalseField.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenTwelveZero\SetDefaultTagsStorageType.cs" />
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenNineZero\AddUmbracoAuditTable.cs" />
@@ -35,7 +35,7 @@ namespace Umbraco.Tests.Migrations.Upgrades
catch (Exception)
{
//if this doesn't work we have to make sure everything is reset! otherwise
// we'll run into issues because we've already set some things up
// well run into issues because we've already set some things up
TearDown();
throw;
}
@@ -83,4 +83,4 @@ namespace Umbraco.Tests.Migrations.Upgrades
return SqlScripts.SqlResources.SqlCeTotal_480;
}
}
}
}
@@ -89,7 +89,7 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine,
var sqlSyntax = new SqlServerSyntaxProvider();
var indexDefinition = CreateIndexDefinition();
indexDefinition.IndexType = IndexTypes.Clustered;
indexDefinition.IsClustered = false;
var actual = sqlSyntax.Format(indexDefinition);
Assert.AreEqual("CREATE CLUSTERED INDEX [IX_A] ON [TheTable] ([A])", actual);
@@ -159,4 +159,4 @@ WHERE (([umbracoNode].[nodeObjectType] = @0))) x)".Replace(Environment.NewLine,
}
}
}
}
@@ -61,17 +61,6 @@ namespace Umbraco.Tests.Strings
Assert.AreEqual(stripped, result);
}
[TestCase("'+alert(1234)+'", "+alert1234+")]
[TestCase("'+alert(56+78)+'", "+alert56+78+")]
[TestCase("{{file}}", "file")]
[TestCase("'+alert('hello')+'", "+alerthello+")]
[TestCase("Test", "Test")]
public void Clean_From_XSS(string input, string result)
{
var cleaned = input.CleanForXss();
Assert.AreEqual(cleaned, result);
}
[TestCase("This is a string to encrypt")]
[TestCase("This is a string to encrypt\nThis is a second line")]
[TestCase(" White space is preserved ")]
@@ -183,8 +183,8 @@ namespace Umbraco.Tests.TestHelpers
{
RemoveDatabaseFile(ex =>
{
//If this doesn't work we have to make sure everything is reset! otherwise
// we'll run into issues because we've already set some things up
//if this doesn't work we have to make sure everything is reset! otherwise
// well run into issues because we've already set some things up
TearDown();
throw ex;
});
@@ -435,4 +435,4 @@ namespace Umbraco.Tests.TestHelpers
</root>";
}
}
}
}
@@ -29,30 +29,5 @@ namespace Umbraco.Tests.Web.Mvc
var output = _htmlHelper.Wrap("div", "hello world", new {style = "color:red;", onclick = "void();"});
Assert.AreEqual("<div style=\"color:red;\" onclick=\"void();\">hello world</div>", output.ToHtmlString());
}
[Test]
public void GetRelatedLinkHtml_Simple()
{
var relatedLink = new Umbraco.Web.Models.RelatedLink {
Caption = "Link Caption",
NewWindow = true,
Link = "https://www.google.com/"
};
var output = _htmlHelper.GetRelatedLinkHtml(relatedLink);
Assert.AreEqual("<a href=\"https://www.google.com/\" target=\"_blank\">Link Caption</a>", output.ToHtmlString());
}
[Test]
public void GetRelatedLinkHtml_HtmlAttributes()
{
var relatedLink = new Umbraco.Web.Models.RelatedLink
{
Caption = "Link Caption",
NewWindow = true,
Link = "https://www.google.com/"
};
var output = _htmlHelper.GetRelatedLinkHtml(relatedLink, new { @class = "test-class"});
Assert.AreEqual("<a class=\"test-class\" href=\"https://www.google.com/\" target=\"_blank\">Link Caption</a>", output.ToHtmlString());
}
}
}
}
}
+6 -9
View File
@@ -31,10 +31,7 @@
"moment": "~2.10.3",
"ace-builds": "^1.2.3",
"clipboard": "1.7.1",
"font-awesome": "~4.7"
},
"resolutions": {
"font-awesome": "~4.7"
"font-awesome": "~4.2"
},
"install": {
"path": "lib-bower",
@@ -46,11 +43,11 @@
],
"sources": {
"moment": [
"bower_components/moment/min/moment.min.js",
"bower_components/moment/min/moment-with-locales.js",
"bower_components/moment/min/moment-with-locales.min.js",
"bower_components/moment/locale/*.js"
],
"bower_components/moment/min/moment.min.js",
"bower_components/moment/min/moment-with-locales.js",
"bower_components/moment/min/moment-with-locales.min.js",
"bower_components/moment/locale/*.js"
],
"underscore": [
"bower_components/underscore/underscore-min.js",
"bower_components/underscore/underscore-min.map"
+4552 -5610
View File
File diff suppressed because it is too large Load Diff
+5 -7
View File
@@ -11,10 +11,10 @@
"cssnano": "^3.7.6",
"gulp": "^3.9.1",
"gulp-concat": "^2.6.0",
"gulp-connect": "5.6.1",
"gulp-connect": "5.0.0",
"gulp-eslint": "^5.0.0",
"gulp-imagemin": "^4.1.0",
"gulp-less": "^4.0.1",
"gulp-less": "^3.5.0",
"gulp-ngdocs": "^0.3.0",
"gulp-open": "^2.1.0",
"gulp-postcss": "^6.2.0",
@@ -24,14 +24,12 @@
"gulp-wrap": "^0.13.0",
"gulp-wrap-js": "^0.4.1",
"jasmine-core": "2.5.2",
"karma": "^3.1.3",
"karma": "^1.7.0",
"karma-jasmine": "^1.1.1",
"karma-phantomjs-launcher": "^1.0.4",
"less": "^3.9.0",
"less": "^2.7.3",
"lodash": "^4.17.5",
"merge-stream": "^1.0.1",
"run-sequence": "^2.2.1",
"marked": "^0.5.2",
"event-stream": "3.3.4"
"run-sequence": "^2.2.1"
}
}
@@ -11,7 +11,8 @@ LazyLoad.js([
'../js/umbraco.security.js',
'../ServerVariables',
'../lib/spectrum/spectrum.js',
'../js/umbraco.canvasdesigner.js'
'../js/umbraco.canvasdesigner.js',
'../js/canvasdesigner.panel.js'
], function () {
jQuery(document).ready(function () {
angular.bootstrap(document, ['Umbraco.canvasdesigner']);
@@ -18,7 +18,6 @@
<umb-toggle
checked="vm.checked"
disabled="vm.disabled"
on-click="vm.toggle()"
show-labels="true"
label-on="Start"
@@ -39,7 +38,6 @@
var vm = this;
vm.checked = false;
vm.disabled = false;
vm.toggle = toggle;
@@ -54,7 +52,6 @@
</pre>
@param {boolean} checked Set to <code>true</code> or <code>false</code> to toggle the switch.
@param {boolean} disabled Set to <code>true</code> or <code>false</code> to disable/enable the switch.
@param {callback} onClick The function which should be called when the toggle is clicked.
@param {string=} showLabels Set to <code>true</code> or <code>false</code> to show a "On" or "Off" label next to the switch.
@param {string=} labelOn Set a custom label for when the switched is turned on. It will default to "On".
@@ -118,7 +115,6 @@
templateUrl: 'views/components/buttons/umb-toggle.html',
scope: {
checked: "=",
disabled: "=",
onClick: "&",
labelOn: "@?",
labelOff: "@?",
@@ -53,9 +53,6 @@
if (scope.documentType !== null) {
scope.previewOpenUrl = '#/settings/documenttypes/edit/' + scope.documentType.id;
}
// only allow configuring scheduled publishing if the user has publish ("U") and unpublish ("Z") permissions on this node
scope.allowScheduledPublishing = _.contains(scope.node.allowedActions, "U") && _.contains(scope.node.allowedActions, "Z");
}
scope.auditTrailPageChange = function (pageNumber) {
@@ -252,7 +252,7 @@ Use this directive to construct a header inside the main editor window.
icon: "=",
hideIcon: "@",
alias: "=",
hideAlias: "=",
hideAlias: "@",
description: "=",
hideDescription: "@",
descriptionLocked: "@",
@@ -1,5 +1,5 @@
angular.module("umbraco.directives")
.directive('gridRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout, eventsService) {
.directive('gridRte', function (tinyMceService, stylesheetResource, angularHelper, assetsService, $q, $timeout) {
return {
scope: {
uniqueId: '=',
@@ -362,23 +362,8 @@ angular.module("umbraco.directives")
// tinyMceEditor.fire('LoadContent', null);
//};
var tabShownListener = eventsService.on("app.tabChange", function (e, args) {
var tabId = args.id;
var myTabId = element.closest(".umb-tab-pane").attr("rel");
if (String(tabId) === myTabId) {
//the tab has been shown, trigger the mceAutoResize (as it could have timed out before the tab was shown)
if (tinyMceEditor !== undefined && tinyMceEditor != null) {
tinyMceEditor.execCommand('mceAutoResize', false, null, null);
}
}
});
//listen for formSubmitting event (the result is callback used to remove the event subscription)
var formSubmittingListener = scope.$on("formSubmitting", function () {
var unsubscribe = scope.$on("formSubmitting", function () {
//TODO: Here we should parse out the macro rendered content so we can save on a lot of bytes in data xfer
// we do parse it out on the server side but would be nice to do that on the client side before as well.
scope.value = tinyMceEditor ? tinyMceEditor.getContent() : null;
@@ -388,8 +373,7 @@ angular.module("umbraco.directives")
// NOTE: this is very important otherwise if this is part of a modal, the listener still exists because the dom
// element might still be there even after the modal has been hidden.
scope.$on('$destroy', function () {
formSubmittingListener();
eventsService.unsubscribe(tabShownListener);
unsubscribe();
if (tinyMceEditor !== undefined && tinyMceEditor != null) {
tinyMceEditor.destroy()
}
@@ -14,8 +14,7 @@ angular.module("umbraco.directives")
scope: {
src: '=',
center: "=",
onImageLoaded: "&",
onGravityChanged: "&"
onImageLoaded: "&"
},
link: function(scope, element, attrs) {
@@ -53,7 +52,7 @@ angular.module("umbraco.directives")
calculateGravity(offsetX, offsetY);
gravityChanged();
lazyEndEvent();
};
var setDimensions = function () {
@@ -78,11 +77,12 @@ angular.module("umbraco.directives")
scope.center.top = (scope.dimensions.top+10) / scope.dimensions.height;
};
var gravityChanged = function () {
if (angular.isFunction(scope.onGravityChanged)) {
scope.onGravityChanged();
}
};
var lazyEndEvent = _.debounce(function(){
scope.$apply(function(){
scope.$emit("imageFocalPointStop");
});
}, 2000);
//Drag and drop positioning, using jquery ui draggable
//TODO ensure that the point doesnt go outside the box
@@ -100,7 +100,7 @@ angular.module("umbraco.directives")
calculateGravity(offsetX, offsetY);
});
gravityChanged();
lazyEndEvent();
}
});
@@ -110,7 +110,7 @@ angular.module("umbraco.directives")
scope.isCroppable = true;
scope.hasDimensions = true;
if (scope.src) {
if (scope.src !== "undefined") {
if (scope.src.endsWith(".svg")) {
scope.isCroppable = false;
scope.hasDimensions = false;
@@ -135,19 +135,11 @@ angular.module("umbraco.directives")
}
//is this the current action node (this is not the same as the current selected node!)
var actionNode = appState.getMenuState("currentNode");
var actionNode = appState.getMenuState("currentNode");
if(actionNode) {
if(actionNode.id === node.id && actionNode.id !== "-1") {
if(actionNode.id === node.id) {
css.push("active");
}
// special handling of root nodes with id -1
// as there can be many nodes with id -1 in a tree we need to check the treeAlias instead
if(actionNode.id === "-1" && actionNode.metaData.treeAlias === node.metaData.treeAlias) {
css.push("active");
}
}
}
return css.join(" ");
@@ -48,7 +48,7 @@ the directive will use {@link umbraco.directives.directive:umbLockedField umbLoc
**/
angular.module("umbraco.directives")
.directive('umbGenerateAlias', function ($timeout, entityResource, localizationService) {
.directive('umbGenerateAlias', function ($timeout, entityResource) {
return {
restrict: 'E',
templateUrl: 'views/components/umb-generate-alias.html',
@@ -67,48 +67,34 @@ angular.module("umbraco.directives")
var updateAlias = false;
scope.locked = true;
scope.labels = {
idle: "Enter alias...",
busy: "Generating alias..."
};
scope.placeholderText = scope.labels.idle;
localizationService.localize('placeholders_enterAlias').then(function (value) {
scope.labels.idle = scope.placeholderText = value;
});
localizationService.localize('placeholders_generatingAlias').then(function (value) {
scope.labels.busy = value;
});
scope.placeholderText = "Enter alias...";
function generateAlias(value) {
if (generateAliasTimeout) {
$timeout.cancel(generateAliasTimeout);
$timeout.cancel(generateAliasTimeout);
}
if (value !== undefined && value !== "" && value !== null) {
if( value !== undefined && value !== "" && value !== null) {
scope.alias = "";
scope.placeholderText = scope.labels.busy;
scope.alias = "";
scope.placeholderText = "Generating Alias...";
generateAliasTimeout = $timeout(function () {
updateAlias = true;
entityResource.getSafeAlias(encodeURIComponent(value), true).then(function (safeAlias) {
if (updateAlias) {
scope.alias = safeAlias.alias;
}
scope.placeholderText = scope.labels.idle;
scope.alias = safeAlias.alias;
}
});
}, 500);
} else {
updateAlias = true;
scope.alias = "";
scope.placeholderText = scope.labels.idle;
scope.placeholderText = "Enter alias...";
}
}
// if alias gets unlocked - stop watching alias
@@ -119,17 +105,17 @@ angular.module("umbraco.directives")
}));
// validate custom entered alias
eventBindings.push(scope.$watch('alias', function (newValue, oldValue) {
if (scope.alias === "" || scope.alias === null || scope.alias === undefined) {
if (bindWatcher === true) {
// add watcher
eventBindings.push(scope.$watch('aliasFrom', function (newValue, oldValue) {
if (bindWatcher) {
generateAlias(newValue);
}
}));
}
}
eventBindings.push(scope.$watch('alias', function(newValue, oldValue){
if(scope.alias === "" && bindWatcher === true || scope.alias === null && bindWatcher === true) {
// add watcher
eventBindings.push(scope.$watch('aliasFrom', function(newValue, oldValue) {
if(bindWatcher) {
generateAlias(newValue);
}
}));
}
}));
// clean up
@@ -38,7 +38,7 @@ Use this directive to generate color swatches to pick from.
scope.selectedColor = color;
if (scope.onSelect) {
scope.onSelect({color: color });
scope.onSelect(color);
}
};
}
@@ -13,8 +13,8 @@ function valTab() {
link: function (scope, element, attr, ctrs) {
var valFormManager = ctrs[1];
var tabId = "tab" + scope.tab.id;
scope.tabHasError = false;
var tabId = "tab" + scope.tab.id;
scope.tabHasError = false;
//listen for form validation changes
valFormManager.onValidationStatusChanged(function (evt, args) {
@@ -31,7 +31,8 @@ function valTab() {
scope.tabHasError = false;
}
});
}
};
}
angular.module('umbraco.directives.validation').directive("valTab", valTab);
angular.module('umbraco.directives.validation').directive("valTab", valTab);
@@ -3,7 +3,7 @@
* @name umbraco.resources.codefileResource
* @description Loads in data for files that contain code such as js scripts, partial views and partial view macros
**/
function codefileResource($q, $http, umbDataFormatter, umbRequestHelper, localizationService) {
function codefileResource($q, $http, umbDataFormatter, umbRequestHelper) {
return {
@@ -106,16 +106,13 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper, localiz
*
*/
deleteByPath: function (type, virtualpath) {
var promise = localizationService.localize("codefile_deleteItemFailed", [virtualpath]);
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"codeFileApiBaseUrl",
"Delete",
[{ type: type }, { virtualPath: virtualpath}])),
promise);
"Failed to delete item: " + virtualpath);
},
/**
@@ -239,19 +236,13 @@ function codefileResource($q, $http, umbDataFormatter, umbRequestHelper, localiz
*
*/
createContainer: function (type, parentId, name) {
// Is the parent ID numeric?
var key = "codefile_createFolderFailedBy" + (isNaN(parseInt(parentId)) ? "Name" : "Id");
var promise = localizationService.localize(key, [parentId]);
createContainer: function(type, parentId, name) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl(
"codeFileApiBaseUrl",
"PostCreateContainer",
{ type: type, parentId: parentId, name: encodeURIComponent(name) })),
promise);
'Failed to create a folder under parent id ' + parentId);
}
};
@@ -116,20 +116,9 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
{
error: function(data){
var errorMsg = 'Failed to move media';
if (data.id !== undefined && data.parentId !== undefined) {
if (data.id === data.parentId) {
errorMsg = 'Media can\'t be moved into itself';
}
}
else if (data.notifications !== undefined) {
if (data.notifications.length > 0) {
if (data.notifications[0].header.length > 0) {
errorMsg = data.notifications[0].header;
}
if (data.notifications[0].message.length > 0) {
errorMsg = errorMsg + ": " + data.notifications[0].message;
}
}
if(data.parentId === data.id){
errorMsg = 'Media can\'t be moved into itself';
}
return {
@@ -1,272 +1,264 @@
/**
* @ngdoc service
* @name umbraco.resources.mediaTypeResource
* @description Loads in data for media types
**/
function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter, localizationService) {
return {
getCount: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetCount")),
'Failed to retrieve count');
},
getAvailableCompositeContentTypes: function (contentTypeId, filterContentTypes, filterPropertyTypes) {
if (!filterContentTypes) {
filterContentTypes = [];
}
if (!filterPropertyTypes) {
filterPropertyTypes = [];
}
var query = {
contentTypeId: contentTypeId,
filterContentTypes: filterContentTypes,
filterPropertyTypes: filterPropertyTypes
};
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAvailableCompositeMediaTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#getWhereCompositionIsUsedInContentTypes
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Returns a list of media types which use a specific composition with a given id
*
* ##usage
* <pre>
* mediaTypeResource.getWhereCompositionIsUsedInContentTypes(1234)
* .then(function(mediaTypeList) {
* console.log(mediaTypeList);
* });
* </pre>
* @param {Int} contentTypeId id of the composition content type to retrieve the list of the media types where it has been used
* @returns {Promise} resourcePromise object.
*
*/
getWhereCompositionIsUsedInContentTypes: function (contentTypeId) {
var query = {
contentTypeId: contentTypeId
};
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetWhereCompositionIsUsedInContentTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#getAllowedTypes
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Returns a list of allowed media types underneath a media item with a given ID
*
* ##usage
* <pre>
* mediaTypeResource.getAllowedTypes(1234)
* .then(function(array) {
* $scope.type = type;
* });
* </pre>
* @param {Int} mediaId id of the media item to retrive allowed child types for
* @returns {Promise} resourcePromise object.
*
*/
getAllowedTypes: function (mediaId) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAllowedChildren",
[{ contentId: mediaId }])),
'Failed to retrieve allowed types for media id ' + mediaId);
},
getById: function (id) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetById",
[{ id: id }])),
'Failed to retrieve content type');
},
getAll: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAll")),
'Failed to retrieve all content types');
},
getScaffold: function (parentId) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetEmpty", { parentId: parentId })),
'Failed to retrieve content type scaffold');
},
deleteById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"DeleteById",
[{ id: id }])),
'Failed to retrieve content type');
},
deleteContainerById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"DeleteContainer",
[{ id: id }])),
'Failed to delete content type contaier');
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#save
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Saves or update a media type
*
* @param {Object} content data type object to create/update
* @returns {Promise} resourcePromise object.
*
*/
save: function (contentType) {
var saveModel = umbDataFormatter.formatContentTypePostData(contentType);
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostSave"), saveModel),
'Failed to save data for content type id ' + contentType.id);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#move
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Moves a node underneath a new parentId
*
* ##usage
* <pre>
* mediaTypeResource.move({ parentId: 1244, id: 123 })
* .then(function() {
* alert("node was moved");
* }, function(err){
* alert("node didnt move:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.idd the ID of the node to move
* @param {Int} args.parentId the ID of the parent node to move to
* @returns {Promise} resourcePromise object.
*
*/
move: function (args) {
if (!args) {
throw "args cannot be null";
}
if (!args.parentId) {
throw "args.parentId cannot be null";
}
if (!args.id) {
throw "args.id cannot be null";
}
var promise = localizationService.localize("media_moveFailed");
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostMove"),
{
parentId: args.parentId,
id: args.id
}),
promise);
},
copy: function (args) {
if (!args) {
throw "args cannot be null";
}
if (!args.parentId) {
throw "args.parentId cannot be null";
}
if (!args.id) {
throw "args.id cannot be null";
}
var promise = localizationService.localize("media_copyFailed");
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostCopy"),
{
parentId: args.parentId,
id: args.id
}),
promise);
},
createContainer: function(parentId, name) {
var promise = localizationService.localize("media_createFolderFailed", [parentId]);
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"PostCreateContainer",
{ parentId: parentId, name: encodeURIComponent(name) })),
promise);
},
renameContainer: function (id, name) {
var promise = localizationService.localize("media_renameFolderFailed", [id]);
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl",
"PostRenameContainer",
{ id: id, name: name })),
promise
);
}
};
}
angular.module('umbraco.resources').factory('mediaTypeResource', mediaTypeResource);
/**
* @ngdoc service
* @name umbraco.resources.mediaTypeResource
* @description Loads in data for media types
**/
function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
return {
getCount: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetCount")),
'Failed to retrieve count');
},
getAvailableCompositeContentTypes: function (contentTypeId, filterContentTypes, filterPropertyTypes) {
if (!filterContentTypes) {
filterContentTypes = [];
}
if (!filterPropertyTypes) {
filterPropertyTypes = [];
}
var query = {
contentTypeId: contentTypeId,
filterContentTypes: filterContentTypes,
filterPropertyTypes: filterPropertyTypes
};
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAvailableCompositeMediaTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#getWhereCompositionIsUsedInContentTypes
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Returns a list of media types which use a specific composition with a given id
*
* ##usage
* <pre>
* mediaTypeResource.getWhereCompositionIsUsedInContentTypes(1234)
* .then(function(mediaTypeList) {
* console.log(mediaTypeList);
* });
* </pre>
* @param {Int} contentTypeId id of the composition content type to retrieve the list of the media types where it has been used
* @returns {Promise} resourcePromise object.
*
*/
getWhereCompositionIsUsedInContentTypes: function (contentTypeId) {
var query = {
contentTypeId: contentTypeId
};
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetWhereCompositionIsUsedInContentTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#getAllowedTypes
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Returns a list of allowed media types underneath a media item with a given ID
*
* ##usage
* <pre>
* mediaTypeResource.getAllowedTypes(1234)
* .then(function(array) {
* $scope.type = type;
* });
* </pre>
* @param {Int} mediaId id of the media item to retrive allowed child types for
* @returns {Promise} resourcePromise object.
*
*/
getAllowedTypes: function (mediaId) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAllowedChildren",
[{ contentId: mediaId }])),
'Failed to retrieve allowed types for media id ' + mediaId);
},
getById: function (id) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetById",
[{ id: id }])),
'Failed to retrieve content type');
},
getAll: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAll")),
'Failed to retrieve all content types');
},
getScaffold: function (parentId) {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetEmpty", { parentId: parentId })),
'Failed to retrieve content type scaffold');
},
deleteById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"DeleteById",
[{ id: id }])),
'Failed to retrieve content type');
},
deleteContainerById: function (id) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"DeleteContainer",
[{ id: id }])),
'Failed to delete content type contaier');
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#save
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Saves or update a media type
*
* @param {Object} content data type object to create/update
* @returns {Promise} resourcePromise object.
*
*/
save: function (contentType) {
var saveModel = umbDataFormatter.formatContentTypePostData(contentType);
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostSave"), saveModel),
'Failed to save data for content type id ' + contentType.id);
},
/**
* @ngdoc method
* @name umbraco.resources.mediaTypeResource#move
* @methodOf umbraco.resources.mediaTypeResource
*
* @description
* Moves a node underneath a new parentId
*
* ##usage
* <pre>
* mediaTypeResource.move({ parentId: 1244, id: 123 })
* .then(function() {
* alert("node was moved");
* }, function(err){
* alert("node didnt move:" + err.data.Message);
* });
* </pre>
* @param {Object} args arguments object
* @param {Int} args.idd the ID of the node to move
* @param {Int} args.parentId the ID of the parent node to move to
* @returns {Promise} resourcePromise object.
*
*/
move: function (args) {
if (!args) {
throw "args cannot be null";
}
if (!args.parentId) {
throw "args.parentId cannot be null";
}
if (!args.id) {
throw "args.id cannot be null";
}
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostMove"),
{
parentId: args.parentId,
id: args.id
}),
'Failed to move content');
},
copy: function (args) {
if (!args) {
throw "args cannot be null";
}
if (!args.parentId) {
throw "args.parentId cannot be null";
}
if (!args.id) {
throw "args.id cannot be null";
}
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl", "PostCopy"),
{
parentId: args.parentId,
id: args.id
}),
'Failed to copy content');
},
createContainer: function(parentId, name) {
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"PostCreateContainer",
{ parentId: parentId, name: encodeURIComponent(name) })),
'Failed to create a folder under parent id ' + parentId);
},
renameContainer: function (id, name) {
return umbRequestHelper.resourcePromise(
$http.post(umbRequestHelper.getApiUrl("mediaTypeApiBaseUrl",
"PostRenameContainer",
{ id: id, name: name })),
"Failed to rename the folder with id " + id
);
}
};
}
angular.module('umbraco.resources').factory('mediaTypeResource', mediaTypeResource);
@@ -3,7 +3,7 @@
* @name umbraco.resources.templateResource
* @description Loads in data for templates
**/
function templateResource($q, $http, umbDataFormatter, umbRequestHelper, localizationService) {
function templateResource($q, $http, umbDataFormatter, umbRequestHelper) {
return {
@@ -152,16 +152,13 @@ function templateResource($q, $http, umbDataFormatter, umbRequestHelper, localiz
*
*/
deleteById: function(id) {
var promise = localizationService.localize("template_deleteByIdFailed", [id]);
return umbRequestHelper.resourcePromise(
$http.post(
umbRequestHelper.getApiUrl(
"templateApiBaseUrl",
"DeleteById",
[{ id: id }])),
promise);
"Failed to delete item " + id);
},
/**
@@ -253,9 +253,9 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
}
}
// If we have a scheduled publish date change the default button to
// If we have a scheduled publish or unpublish date change the default button to
// "save" and update the label to "save and schedule
if(args.content.releaseDate) {
if(args.content.releaseDate || args.content.removeDate) {
// if save button is alread the default don't change it just update the label
if (buttons.defaultButton && buttons.defaultButton.letter === "A") {
@@ -25,7 +25,6 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
var mainTreeEventHandler = null;
//tracks the user profile dialog
var userDialog = null;
var syncTreePromise;
function setMode(mode) {
switch (mode) {
@@ -177,11 +176,6 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
//when a tree is loaded into a section, we need to put it into appState
mainTreeEventHandler.bind("treeLoaded", function(ev, args) {
appState.setTreeState("currentRootNode", args.tree);
if (syncTreePromise) {
mainTreeEventHandler.syncTree(syncTreePromise.args).then(function(syncArgs) {
syncTreePromise.resolve(syncArgs);
});
}
});
//when a tree node is synced this event will fire, this allows us to set the currentNode
@@ -303,10 +297,8 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
}
}
//create a promise and resolve it later
syncTreePromise = $q.defer();
syncTreePromise.args = args;
return syncTreePromise.promise;
//couldn't sync
return angularHelper.rejectedPromise();
},
/**
@@ -471,7 +463,7 @@ function navigationService($rootScope, $routeParams, $log, $location, $q, $timeo
//if it is not two parts long then this most likely means that it's a legacy action
var js = action.metaData["jsAction"].replace("javascript:", "");
//there's not really a different way to achieve this except for eval
//there's not really a different way to acheive this except for eval
eval(js);
}
else {
@@ -1,464 +1,455 @@
/**
* @ngdoc service
* @name umbraco.services.umbRequestHelper
* @description A helper object used for sending requests to the server
**/
function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogService, notificationsService, eventsService) {
return {
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#convertVirtualToAbsolutePath
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will convert a virtual path (i.e. ~/App_Plugins/Blah/Test.html ) to an absolute path
*
* @param {string} a virtual path, if this is already an absolute path it will just be returned, if this is a relative path an exception will be thrown
*/
convertVirtualToAbsolutePath: function(virtualPath) {
if (virtualPath.startsWith("/")) {
return virtualPath;
}
if (!virtualPath.startsWith("~/")) {
throw "The path " + virtualPath + " is not a virtual path";
}
if (!Umbraco.Sys.ServerVariables.application.applicationPath) {
throw "No applicationPath defined in Umbraco.ServerVariables.application.applicationPath";
}
return Umbraco.Sys.ServerVariables.application.applicationPath + virtualPath.trimStart("~/");
},
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#dictionaryToQueryString
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will turn an array of key/value pairs or a standard dictionary into a query string
*
* @param {Array} queryStrings An array of key/value pairs
*/
dictionaryToQueryString: function (queryStrings) {
if (angular.isArray(queryStrings)) {
return _.map(queryStrings, function (item) {
var key = null;
var val = null;
for (var k in item) {
key = k;
val = item[k];
break;
}
if (key === null || val === null) {
throw "The object in the array was not formatted as a key/value pair";
}
return encodeURIComponent(key) + "=" + encodeURIComponent(val);
}).join("&");
}
else if (angular.isObject(queryStrings)) {
//this allows for a normal object to be passed in (ie. a dictionary)
return decodeURIComponent($.param(queryStrings));
}
throw "The queryString parameter is not an array or object of key value pairs";
},
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#getApiUrl
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will return the webapi Url for the requested key based on the servervariables collection
*
* @param {string} apiName The webapi name that is found in the servervariables["umbracoUrls"] dictionary
* @param {string} actionName The webapi action name
* @param {object} queryStrings Can be either a string or an array containing key/value pairs
*/
getApiUrl: function (apiName, actionName, queryStrings) {
if (!Umbraco || !Umbraco.Sys || !Umbraco.Sys.ServerVariables || !Umbraco.Sys.ServerVariables["umbracoUrls"]) {
throw "No server variables defined!";
}
if (!Umbraco.Sys.ServerVariables["umbracoUrls"][apiName]) {
throw "No url found for api name " + apiName;
}
return Umbraco.Sys.ServerVariables["umbracoUrls"][apiName] + actionName +
(!queryStrings ? "" : "?" + (angular.isString(queryStrings) ? queryStrings : this.dictionaryToQueryString(queryStrings)));
},
/**
* @ngdoc function
* @name umbraco.services.umbRequestHelper#resourcePromise
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This returns a promise with an underlying http call, it is a helper method to reduce
* the amount of duplicate code needed to query http resources and automatically handle any
* Http errors. See /docs/source/using-promises-resources.md
*
* @param {object} opts A mixed object which can either be a string representing the error message to be
* returned OR an object containing either:
* { success: successCallback, errorMsg: errorMessage }
* OR
* { success: successCallback, error: errorCallback }
* In both of the above, the successCallback must accept these parameters: data, status, headers, config
* If using the errorCallback it must accept these parameters: data, status, headers, config
* The success callback must return the data which will be resolved by the deferred object.
* The error callback must return an object containing: {errorMsg: errorMessage, data: originalData, status: status }
*/
resourcePromise: function (httpPromise, opts) {
var deferred = $q.defer();
/** The default success callback used if one is not supplied in the opts */
function defaultSuccess(data, status, headers, config) {
//when it's successful, just return the data
return data;
}
/** The default error callback used if one is not supplied in the opts */
function defaultError(data, status, headers, config) {
var err = {
//NOTE: the default error message here should never be used based on the above docs!
errorMsg: (angular.isString(opts) ? opts : 'An error occurred!'),
data: data,
status: status
};
// if "opts" is a promise, we set "err.errorMsg" to be that promise
if (typeof(opts) == "object" && typeof(opts.then) == "function") {
err.errorMsg = opts;
}
return err;
}
//create the callbacs based on whats been passed in.
var callbacks = {
success: ((!opts || !opts.success) ? defaultSuccess : opts.success),
error: ((!opts || !opts.error) ? defaultError : opts.error)
};
httpPromise.success(function (data, status, headers, config) {
//invoke the callback
var result = callbacks.success.apply(this, [data, status, headers, config]);
//when it's successful, just return the data
deferred.resolve(result);
}).error(function (data, status, headers, config) {
//invoke the callback
var result = callbacks.error.apply(this, [data, status, headers, config]);
//when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled.
if (status >= 500 && status < 600) {
//show a ysod dialog
if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
eventsService.emit('app.ysod',
{
errorMsg: 'An error occured',
data: data
});
}
else {
//show a simple error notification
notificationsService.error("Server error", "Contact administrator, see log for full details.<br/><i>" + result.errorMsg + "</i>");
}
}
//return an error object including the error message for UI
deferred.reject({
errorMsg: result.errorMsg,
data: result.data,
status: result.status
});
});
return deferred.promise;
},
/** Used for saving media/content specifically */
postSaveContent: function (args) {
if (!args.restApiUrl) {
throw "args.restApiUrl is a required argument";
}
if (!args.content) {
throw "args.content is a required argument";
}
if (!args.action) {
throw "args.action is a required argument";
}
if (!args.files) {
throw "args.files is a required argument";
}
if (!args.dataFormatter) {
throw "args.dataFormatter is a required argument";
}
var deferred = $q.defer();
//save the active tab id so we can set it when the data is returned.
var activeTab = _.find(args.content.tabs, function (item) {
return item.active;
});
var activeTabIndex = (activeTab === undefined ? 0 : _.indexOf(args.content.tabs, activeTab));
//save the data
this.postMultiPartRequest(
args.restApiUrl,
{ key: "contentItem", value: args.dataFormatter(args.content, args.action) },
function (data, formData) {
//now add all of the assigned files
for (var f in args.files) {
//each item has a property alias and the file object, we'll ensure that the alias is suffixed to the key
// so we know which property it belongs to on the server side
formData.append("file_" + args.files[f].alias, args.files[f].file);
}
},
function (data, status, headers, config) {
//success callback
//reset the tabs and set the active one
if(data.tabs && data.tabs.length > 0) {
_.each(data.tabs, function (item) {
item.active = false;
});
data.tabs[activeTabIndex].active = true;
}
//the data returned is the up-to-date data so the UI will refresh
deferred.resolve(data);
},
function (data, status, headers, config) {
//failure callback
//when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled.
if (status >= 500 && status < 600) {
//This is a bit of a hack to check if the error is due to a file being uploaded that is too large,
// we have to just check for the existence of a string value but currently that is the best way to
// do this since it's very hacky/difficult to catch this on the server
if (typeof data !== "undefined" && typeof data.indexOf === "function" && data.indexOf("Maximum request length exceeded") >= 0) {
notificationsService.error("Server error", "The uploaded file was too large, check with your site administrator to adjust the maximum size allowed");
}
else if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
//show a ysod dialog
eventsService.emit('app.ysod',
{
errorMsg: 'An error occured',
data: data
});
}
else {
//show a simple error notification
notificationsService.error("Server error", "Contact administrator, see log for full details.<br/><i>" + data.ExceptionMessage + "</i>");
}
}
//return an error object including the error message for UI
deferred.reject({
errorMsg: 'An error occurred',
data: data,
status: status
});
});
return deferred.promise;
},
/** Posts a multi-part mime request to the server */
postMultiPartRequest: function (url, jsonData, transformCallback, successCallback, failureCallback) {
//validate input, jsonData can be an array of key/value pairs or just one key/value pair.
if (!jsonData) { throw "jsonData cannot be null"; }
if (angular.isArray(jsonData)) {
_.each(jsonData, function (item) {
if (!item.key || !item.value) { throw "jsonData array item must have both a key and a value property"; }
});
}
else if (!jsonData.key || !jsonData.value) { throw "jsonData object must have both a key and a value property"; }
$http({
method: 'POST',
url: url,
//IMPORTANT!!! You might think this should be set to 'multipart/form-data' but this is not true because when we are sending up files
// the request needs to include a 'boundary' parameter which identifies the boundary name between parts in this multi-part request
// and setting the Content-type manually will not set this boundary parameter. For whatever reason, setting the Content-type to 'false'
// will force the request to automatically populate the headers properly including the boundary parameter.
headers: { 'Content-Type': false },
transformRequest: function (data) {
var formData = new FormData();
//add the json data
if (angular.isArray(data)) {
_.each(data, function (item) {
formData.append(item.key, !angular.isString(item.value) ? angular.toJson(item.value) : item.value);
});
}
else {
formData.append(data.key, !angular.isString(data.value) ? angular.toJson(data.value) : data.value);
}
//call the callback
if (transformCallback) {
transformCallback.apply(this, [data, formData]);
}
return formData;
},
data: jsonData
}).
success(function (data, status, headers, config) {
if (successCallback) {
successCallback.apply(this, [data, status, headers, config]);
}
}).
error(function (data, status, headers, config) {
if (failureCallback) {
failureCallback.apply(this, [data, status, headers, config]);
}
});
},
/**
* Downloads a file to the client using AJAX/XHR
* Based on an implementation here: web.student.tuwien.ac.at/~e0427417/jsdownload.html
* See https://stackoverflow.com/a/24129082/694494
*/
downloadFile : function (httpPath) {
var deferred = $q.defer();
// Use an arraybuffer
$http.get(httpPath, { responseType: 'arraybuffer' })
.success(function (data, status, headers) {
var octetStreamMime = 'application/octet-stream';
var success = false;
// Get the headers
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = headers['x-filename'] || 'download.bin';
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
try {
// Try using msSaveBlob if supported
console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: contentType });
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
console.log("saveBlob succeeded");
success = true;
} catch (ex) {
console.log("saveBlob method failed with the following exception:");
console.log(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
console.log("Trying download link method with simulated click ...");
var blob = new Blob([data], { type: contentType });
var url = urlCreator.createObjectURL(blob);
link.setAttribute('href', url);
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
link.setAttribute("download", filename);
// Simulate clicking the download link
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
console.log("Download link method with simulated click succeeded");
success = true;
} catch (ex) {
console.log("Download link method with simulated click failed with the following exception:");
console.log(ex);
}
}
if (!success) {
// Fallback to window.location method
try {
// Prepare a blob URL
// Use application/octet-stream when using window.location to force download
console.log("Trying download link method with window.location ...");
var blob = new Blob([data], { type: octetStreamMime });
var url = urlCreator.createObjectURL(blob);
window.location = url;
console.log("Download link method with window.location succeeded");
success = true;
} catch (ex) {
console.log("Download link method with window.location failed with the following exception:");
console.log(ex);
}
}
}
}
if (!success) {
// Fallback to window.open method
console.log("No methods worked for saving the arraybuffer, using last resort window.open");
window.open(httpPath, '_blank', '');
}
deferred.resolve();
})
.error(function (data, status) {
console.log("Request failed with status: " + status);
deferred.reject({
errorMsg: "An error occurred downloading the file",
data: data,
status: status
});
});
return deferred.promise;
}
};
}
angular.module('umbraco.services').factory('umbRequestHelper', umbRequestHelper);
/**
* @ngdoc service
* @name umbraco.services.umbRequestHelper
* @description A helper object used for sending requests to the server
**/
function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogService, notificationsService, eventsService) {
return {
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#convertVirtualToAbsolutePath
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will convert a virtual path (i.e. ~/App_Plugins/Blah/Test.html ) to an absolute path
*
* @param {string} a virtual path, if this is already an absolute path it will just be returned, if this is a relative path an exception will be thrown
*/
convertVirtualToAbsolutePath: function(virtualPath) {
if (virtualPath.startsWith("/")) {
return virtualPath;
}
if (!virtualPath.startsWith("~/")) {
throw "The path " + virtualPath + " is not a virtual path";
}
if (!Umbraco.Sys.ServerVariables.application.applicationPath) {
throw "No applicationPath defined in Umbraco.ServerVariables.application.applicationPath";
}
return Umbraco.Sys.ServerVariables.application.applicationPath + virtualPath.trimStart("~/");
},
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#dictionaryToQueryString
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will turn an array of key/value pairs or a standard dictionary into a query string
*
* @param {Array} queryStrings An array of key/value pairs
*/
dictionaryToQueryString: function (queryStrings) {
if (angular.isArray(queryStrings)) {
return _.map(queryStrings, function (item) {
var key = null;
var val = null;
for (var k in item) {
key = k;
val = item[k];
break;
}
if (key === null || val === null) {
throw "The object in the array was not formatted as a key/value pair";
}
return encodeURIComponent(key) + "=" + encodeURIComponent(val);
}).join("&");
}
else if (angular.isObject(queryStrings)) {
//this allows for a normal object to be passed in (ie. a dictionary)
return decodeURIComponent($.param(queryStrings));
}
throw "The queryString parameter is not an array or object of key value pairs";
},
/**
* @ngdoc method
* @name umbraco.services.umbRequestHelper#getApiUrl
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This will return the webapi Url for the requested key based on the servervariables collection
*
* @param {string} apiName The webapi name that is found in the servervariables["umbracoUrls"] dictionary
* @param {string} actionName The webapi action name
* @param {object} queryStrings Can be either a string or an array containing key/value pairs
*/
getApiUrl: function (apiName, actionName, queryStrings) {
if (!Umbraco || !Umbraco.Sys || !Umbraco.Sys.ServerVariables || !Umbraco.Sys.ServerVariables["umbracoUrls"]) {
throw "No server variables defined!";
}
if (!Umbraco.Sys.ServerVariables["umbracoUrls"][apiName]) {
throw "No url found for api name " + apiName;
}
return Umbraco.Sys.ServerVariables["umbracoUrls"][apiName] + actionName +
(!queryStrings ? "" : "?" + (angular.isString(queryStrings) ? queryStrings : this.dictionaryToQueryString(queryStrings)));
},
/**
* @ngdoc function
* @name umbraco.services.umbRequestHelper#resourcePromise
* @methodOf umbraco.services.umbRequestHelper
* @function
*
* @description
* This returns a promise with an underlying http call, it is a helper method to reduce
* the amount of duplicate code needed to query http resources and automatically handle any
* Http errors. See /docs/source/using-promises-resources.md
*
* @param {object} opts A mixed object which can either be a string representing the error message to be
* returned OR an object containing either:
* { success: successCallback, errorMsg: errorMessage }
* OR
* { success: successCallback, error: errorCallback }
* In both of the above, the successCallback must accept these parameters: data, status, headers, config
* If using the errorCallback it must accept these parameters: data, status, headers, config
* The success callback must return the data which will be resolved by the deferred object.
* The error callback must return an object containing: {errorMsg: errorMessage, data: originalData, status: status }
*/
resourcePromise: function (httpPromise, opts) {
var deferred = $q.defer();
/** The default success callback used if one is not supplied in the opts */
function defaultSuccess(data, status, headers, config) {
//when it's successful, just return the data
return data;
}
/** The default error callback used if one is not supplied in the opts */
function defaultError(data, status, headers, config) {
return {
//NOTE: the default error message here should never be used based on the above docs!
errorMsg: (angular.isString(opts) ? opts : 'An error occurred!'),
data: data,
status: status
};
}
//create the callbacs based on whats been passed in.
var callbacks = {
success: ((!opts || !opts.success) ? defaultSuccess : opts.success),
error: ((!opts || !opts.error) ? defaultError : opts.error)
};
httpPromise.success(function (data, status, headers, config) {
//invoke the callback
var result = callbacks.success.apply(this, [data, status, headers, config]);
//when it's successful, just return the data
deferred.resolve(result);
}).error(function (data, status, headers, config) {
//invoke the callback
var result = callbacks.error.apply(this, [data, status, headers, config]);
//when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled.
if (status >= 500 && status < 600) {
//show a ysod dialog
if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
eventsService.emit('app.ysod',
{
errorMsg: 'An error occured',
data: data
});
}
else {
//show a simple error notification
notificationsService.error("Server error", "Contact administrator, see log for full details.<br/><i>" + result.errorMsg + "</i>");
}
}
//return an error object including the error message for UI
deferred.reject({
errorMsg: result.errorMsg,
data: result.data,
status: result.status
});
});
return deferred.promise;
},
/** Used for saving media/content specifically */
postSaveContent: function (args) {
if (!args.restApiUrl) {
throw "args.restApiUrl is a required argument";
}
if (!args.content) {
throw "args.content is a required argument";
}
if (!args.action) {
throw "args.action is a required argument";
}
if (!args.files) {
throw "args.files is a required argument";
}
if (!args.dataFormatter) {
throw "args.dataFormatter is a required argument";
}
var deferred = $q.defer();
//save the active tab id so we can set it when the data is returned.
var activeTab = _.find(args.content.tabs, function (item) {
return item.active;
});
var activeTabIndex = (activeTab === undefined ? 0 : _.indexOf(args.content.tabs, activeTab));
//save the data
this.postMultiPartRequest(
args.restApiUrl,
{ key: "contentItem", value: args.dataFormatter(args.content, args.action) },
function (data, formData) {
//now add all of the assigned files
for (var f in args.files) {
//each item has a property alias and the file object, we'll ensure that the alias is suffixed to the key
// so we know which property it belongs to on the server side
formData.append("file_" + args.files[f].alias, args.files[f].file);
}
},
function (data, status, headers, config) {
//success callback
//reset the tabs and set the active one
if(data.tabs && data.tabs.length > 0) {
_.each(data.tabs, function (item) {
item.active = false;
});
data.tabs[activeTabIndex].active = true;
}
//the data returned is the up-to-date data so the UI will refresh
deferred.resolve(data);
},
function (data, status, headers, config) {
//failure callback
//when there's a 500 (unhandled) error show a YSOD overlay if debugging is enabled.
if (status >= 500 && status < 600) {
//This is a bit of a hack to check if the error is due to a file being uploaded that is too large,
// we have to just check for the existence of a string value but currently that is the best way to
// do this since it's very hacky/difficult to catch this on the server
if (typeof data !== "undefined" && typeof data.indexOf === "function" && data.indexOf("Maximum request length exceeded") >= 0) {
notificationsService.error("Server error", "The uploaded file was too large, check with your site administrator to adjust the maximum size allowed");
}
else if (Umbraco.Sys.ServerVariables["isDebuggingEnabled"] === true) {
//show a ysod dialog
eventsService.emit('app.ysod',
{
errorMsg: 'An error occured',
data: data
});
}
else {
//show a simple error notification
notificationsService.error("Server error", "Contact administrator, see log for full details.<br/><i>" + data.ExceptionMessage + "</i>");
}
}
//return an error object including the error message for UI
deferred.reject({
errorMsg: 'An error occurred',
data: data,
status: status
});
});
return deferred.promise;
},
/** Posts a multi-part mime request to the server */
postMultiPartRequest: function (url, jsonData, transformCallback, successCallback, failureCallback) {
//validate input, jsonData can be an array of key/value pairs or just one key/value pair.
if (!jsonData) { throw "jsonData cannot be null"; }
if (angular.isArray(jsonData)) {
_.each(jsonData, function (item) {
if (!item.key || !item.value) { throw "jsonData array item must have both a key and a value property"; }
});
}
else if (!jsonData.key || !jsonData.value) { throw "jsonData object must have both a key and a value property"; }
$http({
method: 'POST',
url: url,
//IMPORTANT!!! You might think this should be set to 'multipart/form-data' but this is not true because when we are sending up files
// the request needs to include a 'boundary' parameter which identifies the boundary name between parts in this multi-part request
// and setting the Content-type manually will not set this boundary parameter. For whatever reason, setting the Content-type to 'false'
// will force the request to automatically populate the headers properly including the boundary parameter.
headers: { 'Content-Type': false },
transformRequest: function (data) {
var formData = new FormData();
//add the json data
if (angular.isArray(data)) {
_.each(data, function (item) {
formData.append(item.key, !angular.isString(item.value) ? angular.toJson(item.value) : item.value);
});
}
else {
formData.append(data.key, !angular.isString(data.value) ? angular.toJson(data.value) : data.value);
}
//call the callback
if (transformCallback) {
transformCallback.apply(this, [data, formData]);
}
return formData;
},
data: jsonData
}).
success(function (data, status, headers, config) {
if (successCallback) {
successCallback.apply(this, [data, status, headers, config]);
}
}).
error(function (data, status, headers, config) {
if (failureCallback) {
failureCallback.apply(this, [data, status, headers, config]);
}
});
},
/**
* Downloads a file to the client using AJAX/XHR
* Based on an implementation here: web.student.tuwien.ac.at/~e0427417/jsdownload.html
* See https://stackoverflow.com/a/24129082/694494
*/
downloadFile : function (httpPath) {
var deferred = $q.defer();
// Use an arraybuffer
$http.get(httpPath, { responseType: 'arraybuffer' })
.success(function (data, status, headers) {
var octetStreamMime = 'application/octet-stream';
var success = false;
// Get the headers
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = headers['x-filename'] || 'download.bin';
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
try {
// Try using msSaveBlob if supported
console.log("Trying saveBlob method ...");
var blob = new Blob([data], { type: contentType });
if (navigator.msSaveBlob)
navigator.msSaveBlob(blob, filename);
else {
// Try using other saveBlob implementations, if available
var saveBlob = navigator.webkitSaveBlob || navigator.mozSaveBlob || navigator.saveBlob;
if (saveBlob === undefined) throw "Not supported";
saveBlob(blob, filename);
}
console.log("saveBlob succeeded");
success = true;
} catch (ex) {
console.log("saveBlob method failed with the following exception:");
console.log(ex);
}
if (!success) {
// Get the blob url creator
var urlCreator = window.URL || window.webkitURL || window.mozURL || window.msURL;
if (urlCreator) {
// Try to use a download link
var link = document.createElement('a');
if ('download' in link) {
// Try to simulate a click
try {
// Prepare a blob URL
console.log("Trying download link method with simulated click ...");
var blob = new Blob([data], { type: contentType });
var url = urlCreator.createObjectURL(blob);
link.setAttribute('href', url);
// Set the download attribute (Supported in Chrome 14+ / Firefox 20+)
link.setAttribute("download", filename);
// Simulate clicking the download link
var event = document.createEvent('MouseEvents');
event.initMouseEvent('click', true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
link.dispatchEvent(event);
console.log("Download link method with simulated click succeeded");
success = true;
} catch (ex) {
console.log("Download link method with simulated click failed with the following exception:");
console.log(ex);
}
}
if (!success) {
// Fallback to window.location method
try {
// Prepare a blob URL
// Use application/octet-stream when using window.location to force download
console.log("Trying download link method with window.location ...");
var blob = new Blob([data], { type: octetStreamMime });
var url = urlCreator.createObjectURL(blob);
window.location = url;
console.log("Download link method with window.location succeeded");
success = true;
} catch (ex) {
console.log("Download link method with window.location failed with the following exception:");
console.log(ex);
}
}
}
}
if (!success) {
// Fallback to window.open method
console.log("No methods worked for saving the arraybuffer, using last resort window.open");
window.open(httpPath, '_blank', '');
}
deferred.resolve();
})
.error(function (data, status) {
console.log("Request failed with status: " + status);
deferred.reject({
errorMsg: "An error occurred downloading the file",
data: data,
status: status
});
});
return deferred.promise;
}
};
}
angular.module('umbraco.services').factory('umbRequestHelper', umbRequestHelper);
@@ -11,7 +11,7 @@
*/
function NavigationController($scope, $rootScope, $location, $log, $routeParams, $timeout, appState, navigationService, keyboardService, dialogService, historyService, eventsService, sectionResource, angularHelper) {
//TODO: Need to think about this and an nicer way to achieve what this is doing.
//TODO: Need to think about this and an nicer way to acheive what this is doing.
//the tree event handler i used to subscribe to the main tree click events
$scope.treeEventHandler = $({});
navigationService.setupTreeEvents($scope.treeEventHandler);
@@ -40,7 +40,7 @@ function NavigationController($scope, $rootScope, $location, $log, $routeParams,
navigationService.showSearch();
});
//trigger dialogs with a hotkey:
//trigger dialods with a hotkey:
keyboardService.bind("esc", function () {
eventsService.emit("app.closeDialogs");
});
@@ -112,7 +112,7 @@ function NavigationController($scope, $rootScope, $location, $log, $routeParams,
$scope.authenticated = false;
}));
//when the application is ready and the user is authorized, setup the data
//when the application is ready and the user is authorized setup the data
evts.push(eventsService.on("app.ready", function(evt, data) {
$scope.authenticated = true;
}));
@@ -32,7 +32,6 @@
ng-pattern="passwordPattern"
autocorrect="off"
autocapitalize="off"
autocomplete="off"
required
ng-model="installer.current.model.password" id="password" />
<small class="inline-help">At least {{installer.current.model.minCharLength}} characters long</small>
+186 -187
View File
@@ -1,187 +1,186 @@
// Core variables and mixins
@import "fonts.less"; // Loading fonts
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
// CSS Reset
@import "../../lib/bootstrap/less/reset.less";
// Grid system and page structure
@import "../../lib/bootstrap/less/scaffolding.less";
@import "../../lib/bootstrap/less/grid.less";
@import "../../lib/bootstrap/less/layouts.less";
// Base CSS
@import "../../lib/bootstrap/less/type.less";
@import "../../lib/bootstrap/less/code.less";
@import "tables.less";
// Components: common
@import "../../lib/bootstrap/less/dropdowns.less";
@import "../../lib/bootstrap/less/wells.less";
@import "../../lib/bootstrap/less/component-animations.less";
@import "../../lib/bootstrap/less/close.less";
// Components: Buttons & Alerts
@import "../../lib/bootstrap/less/button-groups.less";
@import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
// Components: Nav
@import "navs.less";
@import "../../lib/bootstrap/less/navbar.less";
@import "../../lib/bootstrap/less/breadcrumbs.less";
@import "../../lib/bootstrap/less/pagination.less";
@import "../../lib/bootstrap/less/pager.less";
// Components: Popovers
@import "../../lib/bootstrap/less/modals.less";
@import "../../lib/bootstrap/less/tooltip.less";
@import "../../lib/bootstrap/less/popovers.less";
@import "tipmenu.less";
// Components: Misc
@import "../../lib/bootstrap/less/thumbnails.less";
@import "../../lib/bootstrap/less/media.less";
@import "../../lib/bootstrap/less/labels-badges.less";
@import "../../lib/bootstrap/less/progress-bars.less";
@import "../../lib/bootstrap/less/accordion.less";
@import "../../lib/bootstrap/less/carousel.less";
@import "../../lib/bootstrap/less/hero-unit.less";
// Utility classes
@import "../../lib/bootstrap/less/utilities.less"; // Has to be last to override when necessary
// Application wide styles (refactor is WIP)
@import "application/grid.less";
@import "application/shadows.less";
@import "application/animations.less";
// Utilities
@import "utilities/_font-weight.less";
// Belle styles
@import "buttons.less";
@import "forms.less";
@import "legacydialog.less";
@import "modals.less";
@import "panel.less";
@import "sections.less";
@import "helveticons.less";
@import "main.less";
@import "tree.less";
@import "listview.less";
@import "gridview.less";
@import "footer.less";
@import "dragdrop.less";
@import "dashboards.less";
@import "forms/umb-validation-label.less";
// Umbraco Components
@import "components/application/umb-tour.less";
@import "components/application/umb-backdrop.less";
@import "components/application/umb-drawer.less";
@import "components/editor.less";
@import "components/overlays.less";
@import "components/card.less";
@import "components/umb-sub-views.less";
@import "components/umb-editor-navigation.less";
@import "components/umb-editor-sub-views.less";
@import "components/editor/subheader/umb-editor-sub-header.less";
@import "components/umb-grid-selector.less";
@import "components/umb-child-selector.less";
@import "components/umb-group-builder.less";
@import "components/umb-list-view-settings.less";
@import "components/umb-table.less";
@import "components/umb-confirm-action.less";
@import "components/umb-keyboard-shortcuts-overview.less";
@import "components/umb-checkbox-list.less";
@import "components/umb-locked-field.less";
@import "components/umb-tabs.less";
@import "components/umb-load-indicator.less";
@import "components/umb-breadcrumbs.less";
@import "components/umb-media-grid.less";
@import "components/umb-folder-grid.less";
@import "components/umb-content-grid.less";
@import "components/umb-layout-selector.less";
@import "components/tooltip/umb-tooltip.less";
@import "components/tooltip/umb-tooltip-list.less";
@import "components/overlays/umb-overlay-backdrop.less";
@import "components/umb-grid.less";
@import "components/umb-empty-state.less";
@import "components/umb-property-editor.less";
@import "components/umb-color-swatches.less";
@import "components/check-circle.less";
@import "components/umb-iconpicker.less";
@import "components/umb-insert-code-box.less";
@import "components/umb-packages.less";
@import "components/umb-package-local-install.less";
@import "components/umb-lightbox.less";
@import "components/umb-avatar.less";
@import "components/umb-progress-bar.less";
@import "components/umb-querybuilder.less";
@import "components/umb-pagination.less";
@import "components/umb-mini-list-view.less";
@import "components/umb-multiple-textbox.less";
@import "components/umb-badge.less";
@import "components/umb-nested-content.less";
@import "components/umb-checkmark.less";
@import "components/umb-list.less";
@import "components/umb-box.less";
@import "components/umb-number-badge.less";
@import "components/umb-progress-circle.less";
@import "components/buttons/umb-button.less";
@import "components/buttons/umb-button-group.less";
@import "components/buttons/umb-era-button.less";
@import "components/buttons/umb-toggle.less";
@import "components/notifications/umb-notifications.less";
@import "components/umb-file-dropzone.less";
@import "components/umb-node-preview.less";
@import "components/umb-mini-editor.less";
@import "components/users/umb-user-cards.less";
@import "components/users/umb-user-details.less";
@import "components/users/umb-user-group-picker-list.less";
@import "components/users/umb-user-group-preview.less";
@import "components/users/umb-user-preview.less";
@import "components/users/umb-user-picker-list.less";
@import "components/users/umb-permission.less";
// Utilities
@import "utilities/layout/_display.less";
@import "utilities/typography/_text-decoration.less";
@import "utilities/typography/_white-space.less";
@import "utilities/_flexbox.less";
@import "utilities/_spacing.less";
@import "utilities/_text-align.less";
@import "utilities/_width.less";
//page specific styles
@import "pages/document-type-editor.less";
@import "pages/login.less";
@import "pages/welcome-dashboard.less";
//used for property editors
@import "property-editors.less";
//used for prevalue editors
@import "components/prevalues/multivalues.less";
@import "typeahead.less";
@import "hacks.less";
@import "healthcheck.less";
@import "getstarted.less";
// cleanup properties.less when it is done
@import "properties.less";
// Core variables and mixins
@import "fonts.less"; // Loading fonts
@import "variables.less"; // Modify this for custom colors, font-sizes, etc
@import "mixins.less";
// CSS Reset
@import "../../lib/bootstrap/less/reset.less";
// Grid system and page structure
@import "../../lib/bootstrap/less/scaffolding.less";
@import "../../lib/bootstrap/less/grid.less";
@import "../../lib/bootstrap/less/layouts.less";
// Base CSS
@import "../../lib/bootstrap/less/type.less";
@import "../../lib/bootstrap/less/code.less";
@import "tables.less";
// Components: common
@import "../../lib/bootstrap/less/dropdowns.less";
@import "../../lib/bootstrap/less/wells.less";
@import "../../lib/bootstrap/less/component-animations.less";
@import "../../lib/bootstrap/less/close.less";
// Components: Buttons & Alerts
@import "../../lib/bootstrap/less/button-groups.less";
@import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
// Components: Nav
@import "navs.less";
@import "../../lib/bootstrap/less/navbar.less";
@import "../../lib/bootstrap/less/breadcrumbs.less";
@import "../../lib/bootstrap/less/pagination.less";
@import "../../lib/bootstrap/less/pager.less";
// Components: Popovers
@import "../../lib/bootstrap/less/modals.less";
@import "../../lib/bootstrap/less/tooltip.less";
@import "../../lib/bootstrap/less/popovers.less";
@import "tipmenu.less";
// Components: Misc
@import "../../lib/bootstrap/less/thumbnails.less";
@import "../../lib/bootstrap/less/media.less";
@import "../../lib/bootstrap/less/labels-badges.less";
@import "../../lib/bootstrap/less/progress-bars.less";
@import "../../lib/bootstrap/less/accordion.less";
@import "../../lib/bootstrap/less/carousel.less";
@import "../../lib/bootstrap/less/hero-unit.less";
// Utility classes
@import "../../lib/bootstrap/less/utilities.less"; // Has to be last to override when necessary
// Application wide styles (refactor is WIP)
@import "application/grid.less";
@import "application/shadows.less";
@import "application/animations.less";
// Utilities
@import "utilities/_font-weight.less";
// Belle styles
@import "buttons.less";
@import "forms.less";
@import "modals.less";
@import "panel.less";
@import "sections.less";
@import "helveticons.less";
@import "main.less";
@import "tree.less";
@import "listview.less";
@import "gridview.less";
@import "footer.less";
@import "dragdrop.less";
@import "dashboards.less";
@import "forms/umb-validation-label.less";
// Umbraco Components
@import "components/application/umb-tour.less";
@import "components/application/umb-backdrop.less";
@import "components/application/umb-drawer.less";
@import "components/editor.less";
@import "components/overlays.less";
@import "components/card.less";
@import "components/umb-sub-views.less";
@import "components/umb-editor-navigation.less";
@import "components/umb-editor-sub-views.less";
@import "components/editor/subheader/umb-editor-sub-header.less";
@import "components/umb-grid-selector.less";
@import "components/umb-child-selector.less";
@import "components/umb-group-builder.less";
@import "components/umb-list-view-settings.less";
@import "components/umb-table.less";
@import "components/umb-confirm-action.less";
@import "components/umb-keyboard-shortcuts-overview.less";
@import "components/umb-checkbox-list.less";
@import "components/umb-locked-field.less";
@import "components/umb-tabs.less";
@import "components/umb-load-indicator.less";
@import "components/umb-breadcrumbs.less";
@import "components/umb-media-grid.less";
@import "components/umb-folder-grid.less";
@import "components/umb-content-grid.less";
@import "components/umb-layout-selector.less";
@import "components/tooltip/umb-tooltip.less";
@import "components/tooltip/umb-tooltip-list.less";
@import "components/overlays/umb-overlay-backdrop.less";
@import "components/umb-grid.less";
@import "components/umb-empty-state.less";
@import "components/umb-property-editor.less";
@import "components/umb-color-swatches.less";
@import "components/check-circle.less";
@import "components/umb-iconpicker.less";
@import "components/umb-insert-code-box.less";
@import "components/umb-packages.less";
@import "components/umb-package-local-install.less";
@import "components/umb-lightbox.less";
@import "components/umb-avatar.less";
@import "components/umb-progress-bar.less";
@import "components/umb-querybuilder.less";
@import "components/umb-pagination.less";
@import "components/umb-mini-list-view.less";
@import "components/umb-multiple-textbox.less";
@import "components/umb-badge.less";
@import "components/umb-nested-content.less";
@import "components/umb-checkmark.less";
@import "components/umb-list.less";
@import "components/umb-box.less";
@import "components/umb-number-badge.less";
@import "components/umb-progress-circle.less";
@import "components/buttons/umb-button.less";
@import "components/buttons/umb-button-group.less";
@import "components/buttons/umb-era-button.less";
@import "components/buttons/umb-toggle.less";
@import "components/notifications/umb-notifications.less";
@import "components/umb-file-dropzone.less";
@import "components/umb-node-preview.less";
@import "components/umb-mini-editor.less";
@import "components/users/umb-user-cards.less";
@import "components/users/umb-user-details.less";
@import "components/users/umb-user-group-picker-list.less";
@import "components/users/umb-user-group-preview.less";
@import "components/users/umb-user-preview.less";
@import "components/users/umb-user-picker-list.less";
@import "components/users/umb-permission.less";
// Utilities
@import "utilities/layout/_display.less";
@import "utilities/typography/_text-decoration.less";
@import "utilities/typography/_white-space.less";
@import "utilities/_flexbox.less";
@import "utilities/_spacing.less";
@import "utilities/_text-align.less";
@import "utilities/_width.less";
//page specific styles
@import "pages/document-type-editor.less";
@import "pages/login.less";
@import "pages/welcome-dashboard.less";
//used for property editors
@import "property-editors.less";
//used for prevalue editors
@import "components/prevalues/multivalues.less";
@import "typeahead.less";
@import "hacks.less";
@import "healthcheck.less";
@import "getstarted.less";
// cleanup properties.less when it is done
@import "properties.less";
@@ -110,4 +110,4 @@
.umb-era-button i {
margin-right: 5px;
}
}
@@ -28,8 +28,7 @@
.umb-toggle__toggle {
cursor: pointer;
align-items: center;
display: flex;
display: inline-block;
width: 48px;
height: 24px;
background: @gray-8;
@@ -42,11 +41,6 @@
background-color: @green;
}
.umb-toggle--disabled .umb-toggle__toggle {
cursor: not-allowed;
opacity: 0.8;
}
.umb-toggle--checked .umb-toggle__handler {
transform: translate3d(24px, 0, 0) rotate(0);
}
@@ -69,7 +63,7 @@
.umb-toggle__icon {
position: absolute;
line-height: 1em;
top: 3px;
text-decoration: none;
transition: all 0.2s ease;
}
@@ -102,13 +102,11 @@
}
.umb-card-grid li.-four-in-row {
flex: 0 0 25%;
max-width: 25%;
flex: 0 0 25%;
}
.umb-card-grid li.-three-in-row {
flex: 0 0 33.33%;
max-width:33.33%;
}
.umb-card-grid .umb-card-grid-item {
@@ -174,7 +174,6 @@
box-sizing: border-box;
background: @gray-10;
border-bottom: 1px solid @purple-l3;
pointer-events: none;
}
.umb-overlay__item-details-title-wrapper {
@@ -5,10 +5,6 @@
.umb-overlay & {
width: 500px;
}
p{
margin: 7px 0;
}
}
.umb-prevalues-multivalues__left {
@@ -3,7 +3,7 @@
flex-flow: row wrap;
.umb-color-box {
border: 1px solid rgba(0,0,0,0.15);
border: 1px solid @gray-8;
color: @white;
cursor: pointer;
padding: 1px;
@@ -42,11 +42,10 @@
&.with-labels {
.umb-color-box {
width: 130px;
height: auto;
width: 120px;
height: 100%;
display: flex;
flex-flow: row wrap;
border: 1px solid @gray-8;
.umb-color-box-inner {
display: flex;
@@ -54,21 +53,15 @@
flex: 0 0 100%;
max-width: 100%;
min-height: 80px;
padding: 0;
.check_circle {
margin: 15px auto;
}
padding-top: 10px;
.umb-color-box__label {
background: @white;
font-size: 14px;
display: flex;
flex-flow: column wrap;
flex: 1 0 100%;
justify-content: flex-end;
flex: 0 0 100%;
padding: 1px 5px;
min-height: 45px;
max-width: 100%;
margin-top: auto;
margin-bottom: -3px;
@@ -1,17 +1,4 @@
.umb-multiple-textbox{
&__confirm{
position: relative;
&-action{
margin: 0;
padding: 2px;
background: transparent;
border: 0 none;
}
}
}
.umb-multiple-textbox .textbox-wrapper {
.umb-multiple-textbox .textbox-wrapper {
align-items: center;
margin-bottom: 15px;
}
@@ -20,7 +7,7 @@
margin-bottom: 0;
}
.umb-multiple-textbox .textbox-wrapper i:not(.icon-delete, .icon-check) {
.umb-multiple-textbox .textbox-wrapper i {
margin-right: 5px;
}
@@ -209,6 +209,26 @@
width: 99%;
}
.usky-grid.umb-nested-content__node-type-picker {
.cell-tools-menu {
position: relative;
transform: translate(-50%, -25%);
}
.elements li {
&:hover {
i {
color: @white !important;
}
}
i {
// make sure the item icons shown are in the correct color according to their doc type icon instead of the grid editor item color
color: unset;
}
}
}
// this resolves the layout issue introduced in nested content in 7.12 with the addition of the input for link anchors
// the attribute selector ensures the change only applies to the linkpicker overlay
.form-horizontal .umb-nested-content--narrow [ng-controller*="Umbraco.Overlays.LinkPickerController"] .controls-row {
@@ -165,7 +165,7 @@ input.umb-table__input {
}
.-content .-unpublished:not(.with-unpublished-version) {
.-content :not(.with-unpublished-version).-unpublished {
.umb-table__name > * {
opacity: .4;
}
@@ -21,12 +21,6 @@
cursor: pointer;
}
.umb-permission--disabled .umb-permission__toggle,
.umb-permission--disabled .umb-permission__content {
cursor: not-allowed;
opacity: 0.8;
}
.umb-permission__description {
font-size: 13px;
color: @gray-5;
@@ -594,7 +594,7 @@ div.help {
text-align: center;
text-shadow: 0 1px 0 @white;
background-color: @gray-10;
border: 1px solid @purple-l3;
border: 1px solid @gray-8;
}
.add-on,
.btn,
@@ -1,7 +1,5 @@
.umb-validation-label {
position: absolute;
top: 27px;
width: 200px;
position: relative;
padding: 1px 5px;
background: @red;
color: @white;
@@ -202,7 +202,7 @@ pre {
//font-size: @baseFontSize - 1; // 14px to 13px
color: @gray-2;
line-height: @baseLineHeight;
white-space: pre-wrap; // 1
white-space: pre-line; // 1
overflow-x: auto; // 1
background-color: @gray-10;
border: 1px solid @gray-8;
@@ -222,4 +222,4 @@ pre {
background-color: transparent;
border: 0;
}
}
}
@@ -236,5 +236,4 @@
.umb-healthcheck-group__details-status-action-description {
margin-top: 5px;
font-size: 12px;
padding-left: 165px;
}
@@ -17,14 +17,12 @@
-webkit-font-smoothing: antialiased;
*margin-right: .3em;
}
[class^="icon-"]:before,
[class*=" icon-"]:before {
text-decoration: inherit;
display: inline-block;
speak: none;
}
/*
[class^="icon-"]:before, [class*=" icon-"]:before {
font-family: 'icomoon';
@@ -40,6 +38,7 @@
i.large{
font-size: 32px;
}
i.medium{
font-size: 24px;
}
@@ -188,6 +187,8 @@ i.small{
.icon-umb-translation:before, .traytranslation:before {
content: "\e1fd";
}
.icon-tv:before {
content: "\e02e";
}
@@ -212,8 +213,7 @@ i.small{
.icon-train:before {
content: "\e035";
}
.icon-trafic:before,
.icon-traffic:before {
.icon-trafic:before {
content: "\e036";
}
.icon-traffic-alt:before {
@@ -255,7 +255,6 @@ i.small{
.icon-target:before {
content: "\e043";
}
.icon-temperature-alt:before,
.icon-temperatrure-alt:before {
content: "\e044";
}
@@ -268,7 +267,6 @@ i.small{
.icon-theater:before {
content: "\e047";
}
.icon-thief:before,
.icon-theif:before {
content: "\e048";
}
@@ -377,7 +375,6 @@ i.small{
.icon-shuffle:before {
content: "\e06b";
}
.icon-science:before,
.icon-sience:before {
content: "\e06c";
}
@@ -750,7 +747,6 @@ i.small{
.icon-pictures-alt-2:before {
content: "\e0e7";
}
.icon-panel-close:before,
.icon-pannel-close:before {
content: "\e0e8";
}
@@ -1631,7 +1627,6 @@ i.small{
.icon-alarm-clock:before {
content: "\e20c";
}
.icon-addressbook:before,
.icon-adressbook:before {
content: "\e20d";
}
@@ -1,58 +0,0 @@
.umb-dialog .propertyItemheader {
width: 140px !Important;
}
.umb-dialog .diffDropdown {
width: 400px;
}
.umb-dialog .diffPanel {
height: 400px;
}
.umb-dialog .diff {
margin-top: 10px;
height: 100%;
overflow: auto;
border-top: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 5px;
}
.umb-dialog .diff table {
width: 95%;
max-width: 95%;
margin: 0 3px;
}
.umb-dialog .diff table th {
padding: 5px;
width: 25%;
border-bottom: 1px solid #ccc;
}
.umb-dialog .diff table td {
border-bottom: 1px solid #ccc;
padding: 3px;
}
.umb-dialog .diff del {
background: rgb(255, 230, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff ins {
background: rgb(230, 255, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff .diffnotice {
text-align: center;
margin-bottom: 10px;
}
+5 -16
View File
@@ -23,7 +23,7 @@
margin-top: 0px;
margin-bottom: 15px;
font-size: 14px;
color: @gray-7;
color: @gray-7;
}
h5{
@@ -134,7 +134,7 @@ h5.-black {
padding-bottom: 0;
}
.block-form .umb-control-group label .help-block,
.block-form .umb-control-group label .help-block,
.block-form .umb-control-group label small {
font-size: 13px;
padding-top: 2px;
@@ -243,9 +243,9 @@ label:not([for]) {
}
.umb-version {
color: @gray-7;
position: absolute;
bottom: 5px;
color: @gray-7;
position: absolute;
bottom: 5px;
right: 20px;
}
@@ -653,14 +653,3 @@ input[type=checkbox]:checked + .input-label--small {
.bootstrap-datetimepicker-widget td span {
border-radius: 0 !important;
}
.visuallyhidden{
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
+254 -197
View File
@@ -1,197 +1,254 @@
/* Modals
// -------------------------*/
/* Modalcolumn is used for menu panels */
.umb-modalcolumn {
background: @white;
}
.umb-modalcolumn-header {
background: @gray-10;
border-bottom: 1px solid @purple-l3;
height: 94px;
padding: 5px 20px 0px 20px;
white-space: nowrap
}
.umb-modalcolumn-header h1{
margin: 0;
white-space: nowrap;
font-size: @fontSizeLarge;
font-weight: 400;
padding-top: 10px !important;
}
.umb-modalcolumn-body {
padding: 0px;
background: @white;
top: 100px;
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
overflow: auto;
}
.no-padding .umb-modalcolumn-body {
padding: 0px
}
.umb-modalcolumn .umb-modalcolumn-header .btn {
position: absolute;
top: 13px;
right: 15px
}
.umb-modalcolumn iframe.auto-expand, .umb-modal iframe.auto-expand {
border: none;
padding: 0px;
margin: 0px;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
position: absolute;;
}
/* re-align loader */
.umb-modal .umb-loader-wrapper, .umb-modalcolumn .umb-loader-wrapper, .umb-dialog .umb-loader-wrapper{
position:relative;
margin: 20px -20px;
}
.umb-modal-left .umb-panel-header .umb-headline, .umb-modal-left .umb-panel-header h1 {
width: auto;
padding-left: 0;
}
/* umb.dialog is used for the dialogs on the conent tree*/
.umb-dialog {
outline: none;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
position: absolute;
padding: 0px;
}
.umb-dialog .umb-btn-toolbar .umb-control-group{
border: none;
padding: none;
}
.umb-dialog-body{
position: absolute;
overflow:auto;
top: 0px;
left: 0px;
right: 0px;
bottom: 52px;
}
.umb-dialog-body .umb-pane{margin-top: 15px;}
.umb-dialog-footer{
position: absolute;
overflow:auto;
text-align: right;
height: 32px;
left: 0px;
right: 0px;
bottom: 0px;
padding: 10px 20px;
margin: 0;
background: @gray-10;
border-top: 1px solid @purple-l3;
}
/*we will always make sure to wrap iframe dialogs in proper padding*/
.umbracoDialog{
width: auto !Important;
height: auto !Important;
padding: 20px;
}
.umbracoDialog .umb-pane{margin-left: 0px; margin-right: 0px; margin-top: 0px;}
.umbracoDialog .umb-dialog-body .umb-pane{margin-left: 20px; margin-right: 20px; margin-top: 20px;}
.umbracoDialog form{height: 100%;}
/*ensures dialogs doesnt have side-by-side labels*/
.umbracoDialog .controls-row,
.umb-modal .controls-row{margin-left: 0px !important;}
/* modal and umb-modal are used for right.hand dialogs */
.modal {
border-radius: 0 !important;
&.fade.in{border: none !important;}
}
.umb-modal.fade {
outline: none;
top: 0 !important;
left: -100% !important;
width: 0px !important;
-webkit-transition: left 0.3s linear, left 0.3s ease-out;
-moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-o-transition: opacity 0.3s linear, top 0.3s ease-out;
transition: opacity 0.3s linear, top 0.3s ease-out;
height: 100% !important;
}
.umb-modal.fade.in {
top: 0 !important;
left: 100% !important;
margin-left: -440px;
width: 440px !important;
height: 100% !important;
display: block;
}
.umb-modal-left.fade {
top: 0 !important;
left: -100% !important;
width: 0px !important;
-webkit-transition: left 0.3s linear, left 0.3s ease-out;
-moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-o-transition: opacity 0.3s linear, top 0.3s ease-out;
transition: opacity 0.3s linear, top 0.3s ease-out;
height: 100% !important;
}
.umb-modal-left.fade.in {
top: 0 !important;
left: 0 !important;
margin-left: 80px;
width: 440px !important;
height: 100% !important;
display: block;
}
/*Modal default panel styles*/
.umb-modal .umb-panel-header {
padding: 20px;
background: @white;
border: none;
height: auto;
}
.umb-modal .umb-panel-body{
padding: 0px 20px 0px 20px;
}
.umb-modal.fade.in.wide {
margin-left: -640px;
width: 640px !important;
}
.umb-modal i {
font-size: 20px;
}
.umb-modal .breadcrumb {
background: none;
padding: 0
}
.umb-modal .breadcrumb input {
height: 12px
}
.umb-modal.ysod {
z-index: 10000;
}
/* Modals
// -------------------------*/
/* Modalcolumn is used for menu panels */
.umb-modalcolumn {
background: @white;
}
.umb-modalcolumn-header {
background: @gray-10;
border-bottom: 1px solid @purple-l3;
height: 94px;
padding: 5px 20px 0px 20px;
white-space: nowrap
}
.umb-modalcolumn-header h1{
margin: 0;
white-space: nowrap;
font-size: @fontSizeLarge;
font-weight: 400;
padding-top: 10px !important;
}
.umb-modalcolumn-body {
padding: 0px;
background: @white;
top: 100px;
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
overflow: auto;
}
.no-padding .umb-modalcolumn-body {
padding: 0px
}
.umb-modalcolumn .umb-modalcolumn-header .btn {
position: absolute;
top: 13px;
right: 15px
}
.umb-modalcolumn iframe.auto-expand, .umb-modal iframe.auto-expand {
border: none;
padding: 0px;
margin: 0px;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
position: absolute;;
}
/* re-align loader */
.umb-modal .umb-loader-wrapper, .umb-modalcolumn .umb-loader-wrapper, .umb-dialog .umb-loader-wrapper{
position:relative;
margin: 20px -20px;
}
.umb-modal-left .umb-panel-header .umb-headline, .umb-modal-left .umb-panel-header h1 {
width: auto;
padding-left: 0;
}
/* umb.dialog is used for the dialogs on the conent tree*/
.umb-dialog {
outline: none;
top: 0px;
left: 0px;
right: 0px;
bottom: 0px;
position: absolute;
padding: 0px;
}
.umb-dialog .umb-btn-toolbar .umb-control-group{
border: none;
padding: none;
}
.umb-dialog-body{
position: absolute;
overflow:auto;
top: 0px;
left: 0px;
right: 0px;
bottom: 52px;
}
.umb-dialog-body .umb-pane{margin-top: 15px;}
.umb-dialog-footer{
position: absolute;
overflow:auto;
text-align: right;
height: 32px;
left: 0px;
right: 0px;
bottom: 0px;
padding: 10px 20px;
margin: 0;
background: @gray-10;
border-top: 1px solid @purple-l3;
}
.umb-dialog .propertyItemheader {
width: 140px !Important;
}
.umb-dialog .diffDropdown
{
width:400px;
}
.umb-dialog .diffPanel {
height: 400px;
}
.umb-dialog .diff {
margin-top: 10px;
height: 100%;
overflow: auto;
border-top: 1px solid #ccc;
border-top: 1px solid #ccc;
padding: 5px;
}
.umb-dialog .diff table{
width:95%;
max-width:95%;
margin: 0 3px;
}
.umb-dialog .diff table th {
padding: 5px;
width: 25%;
border-bottom: 1px solid #ccc;
}
.umb-dialog .diff table td {
border-bottom: 1px solid #ccc;
padding: 3px;
}
.umb-dialog .diff del {
background: rgb(255, 230, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff ins {
background: rgb(230, 255, 230) none repeat scroll 0%;
-moz-background-clip: -moz-initial;
-moz-background-origin: -moz-initial;
-moz-background-inline-policy: -moz-initial;
}
.umb-dialog .diff .diffnotice {
text-align: center;
margin-bottom: 10px;
}
/*we will always make sure to wrap iframe dialogs in proper padding*/
.umbracoDialog{
width: auto !Important;
height: auto !Important;
padding: 20px;
}
.umbracoDialog .umb-pane{margin-left: 0px; margin-right: 0px; margin-top: 0px;}
.umbracoDialog .umb-dialog-body .umb-pane{margin-left: 20px; margin-right: 20px; margin-top: 20px;}
.umbracoDialog form{height: 100%;}
/*ensures dialogs doesnt have side-by-side labels*/
.umbracoDialog .controls-row,
.umb-modal .controls-row{margin-left: 0px !important;}
/* modal and umb-modal are used for right.hand dialogs */
.modal {
border-radius: 0 !important;
&.fade.in{border: none !important;}
}
.umb-modal.fade {
outline: none;
top: 0 !important;
left: -100% !important;
width: 0px !important;
-webkit-transition: left 0.3s linear, left 0.3s ease-out;
-moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-o-transition: opacity 0.3s linear, top 0.3s ease-out;
transition: opacity 0.3s linear, top 0.3s ease-out;
height: 100% !important;
}
.umb-modal.fade.in {
top: 0 !important;
left: 100% !important;
margin-left: -440px;
width: 440px !important;
height: 100% !important;
display: block;
}
.umb-modal-left.fade {
top: 0 !important;
left: -100% !important;
width: 0px !important;
-webkit-transition: left 0.3s linear, left 0.3s ease-out;
-moz-transition: opacity 0.3s linear, top 0.3s ease-out;
-o-transition: opacity 0.3s linear, top 0.3s ease-out;
transition: opacity 0.3s linear, top 0.3s ease-out;
height: 100% !important;
}
.umb-modal-left.fade.in {
top: 0 !important;
left: 0 !important;
margin-left: 80px;
width: 440px !important;
height: 100% !important;
display: block;
}
/*Modal default panel styles*/
.umb-modal .umb-panel-header {
padding: 20px;
background: @white;
border: none;
height: auto;
}
.umb-modal .umb-panel-body{
padding: 0px 20px 0px 20px;
}
.umb-modal.fade.in.wide {
margin-left: -640px;
width: 640px !important;
}
.umb-modal i {
font-size: 20px;
}
.umb-modal .breadcrumb {
background: none;
padding: 0
}
.umb-modal .breadcrumb input {
height: 12px
}
.umb-modal.ysod {
z-index: 10000;
}
+10 -10
View File
@@ -16,7 +16,7 @@
.umb-panel-header {
background: @gray-10;
border-bottom: 1px solid @purple-l3;
border-bottom: 1px solid @gray-8;
position: absolute;
height: 99px;
top: 0px;
@@ -43,23 +43,23 @@
}
.umb-mediapicker-upload {
display: -ms-flexbox;
display: -webkit-box;
display: -webkit-flex;
display: flex;
.form-search {
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
&__toggle{
margin: 10px 0;
display: flex;
align-items: center;
input {
margin: 0;
}
label {
margin-left: 5px;
margin-bottom: 0;
label{
margin-right: 10px;
position: relative;
top: -2px;
}
}
}
@@ -1,5 +1,3 @@
@checkered-background: url(../img/checkered-background.png);
//
// Container styles
// --------------------------------------------------
@@ -104,11 +102,11 @@ div.umb-codeeditor {
border: 1px solid @gray-8;
}
div.umb-codeeditor .umb-el-wrap {
padding: 0;
padding: 0px;
}
div.umb-codeeditor .umb-btn-toolbar {
padding: 0;
margin: 0;
padding: 0px;
margin: 0px;
border-bottom: @gray-8 1px solid;
background: @gray-10;
}
@@ -124,7 +122,7 @@ div.umb-codeeditor .umb-btn-toolbar {
position: absolute;
}
}
.mce-tinymce{border: 1px solid @gray-8 !important; border-radius: 0 !important;}
.mce-tinymce{border: 1px solid @gray-8 !important; border-radius: 0px !important;}
.mce-panel{background: @gray-10 !important; border-color: @gray-8 !important;}
.mce-btn-group, .mce-btn{border: none !important; background: none !important;}
.mce-ico{font-size: 12px !important; color: @gray-1 !important;}
@@ -154,7 +152,6 @@ div.umb-codeeditor .umb-btn-toolbar {
border-radius: 3px;
margin-top: auto;
margin-bottom: auto;
flex: 0 0 auto;
}
.handle {
@@ -206,7 +203,7 @@ div.umb-codeeditor .umb-btn-toolbar {
}
label {
border: 1px solid @white;
border: 1px solid #fff;
padding: 6px 10px;
font-family: monospace;
border: 1px solid #dfdfe1;
@@ -216,49 +213,6 @@ div.umb-codeeditor .umb-btn-toolbar {
}
}
//
// Image Cropper
// --------------------------------------------------
.umb-prevalues-multivalues.umb-cropsizes{
max-width: 500px;
width: 100%;
min-width: 66.6%;
@media (min-width: 1101px) and (max-width: 1300px), (max-width: 930px) {
max-width: none;
}
.umb-overlay__form & {
width: 100%;
}
}
.umb-cropsizes {
&__add {
display: inline-flex;
align-items: center;
}
&__controls {
margin: 24px 0 0;
display: flex;
}
&__input {
width: 100%;
&-wrap{
flex: 1 1 auto;
margin-right: 10px;
&--narrow {
flex: 0 1 100px;
}
}
}
}
//
// Media picker
@@ -281,18 +235,6 @@ div.umb-codeeditor .umb-btn-toolbar {
}
}
.umb-mediapicker .label{
&__trashed{
background-color: @red;
position: absolute;
top: 50%;
left: 50%;
z-index: 1;
transform: translate3d(-50%,-50%,0);
margin: 0;
}
}
.umb-mediapicker .picked-image {
position: absolute;
bottom: 10px;
@@ -388,10 +330,10 @@ div.umb-codeeditor .umb-btn-toolbar {
max-height:100%;
margin:auto;
display:block;
background-image: @checkered-background;
background-image: url(../img/checkered-background.png);
}
.umb-sortable-thumbnails li .trashed {
.umb-sortable-thumbnails li img.trashed {
opacity:0.3;
}
@@ -601,18 +543,12 @@ div.umb-codeeditor .umb-btn-toolbar {
vertical-align: top;
}
.gravity-container {
border: 1px solid @gray-8;
line-height: 0;
.gravity-container .viewport {
max-width: 600px;
}
.viewport {
max-width: 600px;
background: @checkered-background;
&:hover {
cursor: pointer;
}
}
.gravity-container .viewport:hover {
cursor: pointer;
}
.imagecropper {
@@ -625,10 +561,6 @@ div.umb-codeeditor .umb-btn-toolbar {
float: left;
max-width: 100%;
}
.viewport img {
background: @checkered-background;
}
}
.imagecropper .umb-cropper__container {
@@ -775,8 +707,8 @@ div.umb-codeeditor .umb-btn-toolbar {
.umb-photo-folder .picrow div, .umb-photo-preview{
margin: 0;
padding: 0;
margin: 0px;
padding: 0px;
border: none;
display: inline-block;
vertical-align: top;
@@ -813,9 +745,9 @@ div.umb-codeeditor .umb-btn-toolbar {
//this is a temp hack, to provide selectors in the dialog:
.umb-photo-folder .pic:hover .selector-overlay {
position: absolute;
bottom: 0;
left: 0;
right: 0;
bottom: 0px;
left: 0px;
right: 0px;
padding: 5px;
background: @black;
z-index: 100;
@@ -895,11 +827,7 @@ div.umb-codeeditor .umb-btn-toolbar {
.umb-fileupload ul {
list-style: none;
vertical-align: middle;
margin-bottom: 0;
img {
background: @checkered-background;
}
margin-bottom: 0px;
}
.umb-fileupload label {
@@ -1057,20 +985,7 @@ div.umb-codeeditor .umb-btn-toolbar {
//
// Nested boolean (e.g. list view bulk action permissions)
// -------------------------------------------------------
// ---------------------=====-----------------------------
.umb-nested-boolean label {margin-bottom: 8px; float: left; width: 320px;}
.umb-nested-boolean label span {float: left; width: 80%;}
.umb-nested-boolean label input[type='checkbox'] {margin-right: 10px; float: left;}
//
// Custom styles of property editors in property preview in document type editor
// -----------------------------------------------------------------------------
.umb-group-builder__property-preview {
.umb-property-editor {
.slider {
.tooltip {
display: none;
}
}
}
}
@@ -207,7 +207,7 @@
}
}
$scope.allowPasswordReset = Umbraco.Sys.ServerVariables.umbracoSettings.canSendRequiredEmail && Umbraco.Sys.ServerVariables.umbracoSettings.allowPasswordReset;
$scope.allowPasswordReset = Umbraco.Sys.ServerVariables.umbracoSettings.allowPasswordReset;
$scope.showLogin = function () {
$scope.errorMsg = "";
@@ -88,7 +88,13 @@
<div class="flex justify-center items-center">
<umb-button type="button"
button-style="success"
label="Done"
label="Get started"
action="getStarted()">
</umb-button>
<umb-button ng-if="!avatarFile.uploaded"
type="button"
button-style="link"
label="Skip"
action="getStarted()">
</umb-button>
</div>
@@ -8,7 +8,7 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
$scope.section = dialogOptions.section;
$scope.treeAlias = dialogOptions.treeAlias;
$scope.multiPicker = dialogOptions.multiPicker;
$scope.hideHeader = (typeof dialogOptions.hideHeader) === "boolean" ? dialogOptions.hideHeader : true;;
$scope.hideHeader = true;
$scope.searchInfo = {
searchFromId: dialogOptions.startNodeId,
searchFromName: null,
@@ -428,4 +428,4 @@ angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController",
$scope.dialogTreeEventHandler.unbind("treeNodeExpanded", nodeExpandedHandler);
$scope.dialogTreeEventHandler.unbind("treeNodeSelect", nodeSelectHandler);
});
});
});
@@ -1,28 +1,13 @@
(function() {
"use strict";
function CompositionsOverlay($scope,$location,$filter) {
function CompositionsOverlay($scope,$location) {
var vm = this;
vm.isSelected = isSelected;
vm.openContentType = openContentType;
// group the content types by their container paths
vm.availableGroups = $filter("orderBy")(
_.map(
_.groupBy($scope.model.availableCompositeContentTypes, function (compositeContentType) {
return compositeContentType.contentType.metaData.containerPath;
}), function(group) {
return {
containerPath: group[0].contentType.metaData.containerPath,
compositeContentTypes: group
};
}
), function (group) {
return group.containerPath.replace(/\//g, " ");
});
function isSelected(alias) {
if($scope.model.contentType.compositeContentTypes.indexOf(alias) !== -1) {
return true;
@@ -32,32 +32,27 @@
<li class="umb-checkbox-list__item" ng-repeat="contentTypeEntity in model.whereCompositionUsed"><a ng-click="vm.openContentType(contentTypeEntity.contentType, model.section)"><i class="{{contentTypeEntity.contentType.icon}}"></i>&nbsp;{{contentTypeEntity.contentType.name}}</a></li>
</ul>
</div>
<div ng-if="vm.availableGroups.length > 0">
<ul class="umb-checkbox-list" ng-repeat="group in vm.availableGroups | filter:searchTerm">
<li style="font-weight: bold" ng-show="vm.availableGroups.length > 1">
<i class="icon-folder umb-checkbox-list__item-icon"></i>
{{group.containerPath}}
</li>
<li class="umb-checkbox-list__item"
ng-repeat="compositeContentType in group.compositeContentTypes | orderBy:'contentType.name' | filter:searchTerm"
ng-class="{'-disabled': compositeContentType.allowed===false || compositeContentType.inherited, '-selected': vm.isSelected(compositeContentType.contentType.alias)}">
<ul class="umb-checkbox-list">
<li class="umb-checkbox-list__item"
ng-repeat="compositeContentType in model.availableCompositeContentTypes | filter:searchTerm"
ng-class="{'-disabled': compositeContentType.allowed===false || compositeContentType.inherited, '-selected': vm.isSelected(compositeContentType.contentType.alias)}">
<div class="umb-checkbox-list__item-checkbox"
ng-class="{ '-selected': model.compositeContentTypes.indexOf(compositeContentType.contentType.alias)+1 }">
<input type="checkbox"
id="umb-overlay-comp-{{compositeContentType.contentType.key}}"
checklist-model="model.compositeContentTypes"
checklist-value="compositeContentType.contentType.alias"
ng-change="model.selectCompositeContentType(compositeContentType.contentType)"
ng-disabled="compositeContentType.allowed===false || compositeContentType.inherited" />
</div>
<div class="umb-checkbox-list__item-checkbox"
ng-class="{ '-selected': model.compositeContentTypes.indexOf(compositeContentType.contentType.alias)+1 }">
<input type="checkbox"
id="umb-overlay-comp-{{compositeContentType.contentType.key}}"
checklist-model="model.compositeContentTypes"
checklist-value="compositeContentType.contentType.alias"
ng-change="model.selectCompositeContentType(compositeContentType.contentType)"
ng-disabled="compositeContentType.allowed===false || compositeContentType.inherited" />
</div>
<label for="umb-overlay-comp-{{compositeContentType.contentType.key}}" class="umb-checkbox-list__item-text" ng-class="{'-faded': compositeContentType.allowed===false}">
<i class="{{ compositeContentType.contentType.icon }} umb-checkbox-list__item-icon"></i>
{{ compositeContentType.contentType.name }}
<span class="umb-checkbox-list__item-caption" ng-if="compositeContentType.inherited">(inherited)</span>
</label>
</li>
</ul>
</div>
<label for="umb-overlay-comp-{{compositeContentType.contentType.key}}" class="umb-checkbox-list__item-text" ng-class="{'-faded': compositeContentType.allowed===false}">
<i class="{{ compositeContentType.contentType.icon }} umb-checkbox-list__item-icon"></i>
{{ compositeContentType.contentType.name }}
<span class="umb-checkbox-list__item-caption" ng-if="compositeContentType.inherited">(inherited)</span>
</label>
</li>
</ul>
</div>
@@ -25,31 +25,30 @@ angular.module("umbraco").controller("Umbraco.Overlays.LinkPickerController",
$scope.showTarget = $scope.model.hideTarget !== true;
if (dialogOptions.currentTarget) {
// clone the current target so we don't accidentally update the caller's model while manipulating $scope.model.target
$scope.model.target = angular.copy(dialogOptions.currentTarget);
$scope.model.target = dialogOptions.currentTarget;
//if we have a node ID, we fetch the current node to build the form data
if ($scope.model.target.id || $scope.model.target.udi) {
//will be either a udi or an int
var id = $scope.model.target.udi ? $scope.model.target.udi : $scope.model.target.id;
// is it a content link?
if (!$scope.model.target.isMedia) {
// get the content path
entityResource.getPath(id, "Document").then(function(path) {
//now sync the tree to this path
$scope.dialogTreeEventHandler.syncTree({
path: path,
tree: "content"
});
});
if (!$scope.model.target.path) {
// get the content properties to build the anchor name list
contentResource.getById(id).then(function (resp) {
$scope.model.target.url = resp.urls[0];
$scope.anchorValues = tinyMceService.getAnchorNames(JSON.stringify(resp.properties));
});
}
entityResource.getPath(id, "Document").then(function (path) {
$scope.model.target.path = path;
//now sync the tree to this path
$scope.dialogTreeEventHandler.syncTree({
path: $scope.model.target.path,
tree: "content"
});
});
}
// if a link exists, get the properties to build the anchor name list
contentResource.getById(id).then(function (resp) {
$scope.anchorValues = tinyMceService.getAnchorNames(JSON.stringify(resp.properties));
$scope.model.target.url = resp.urls[0];
});
} else if ($scope.model.target.url.length) {
// a url but no id/udi indicates an external link - trim the url to remove the anchor/qs
// only do the substring if there's a # or a ?
@@ -88,8 +87,8 @@ angular.module("umbraco").controller("Umbraco.Overlays.LinkPickerController",
$scope.model.target.url = "/";
} else {
contentResource.getById(args.node.id).then(function (resp) {
$scope.model.target.url = resp.urls[0];
$scope.anchorValues = tinyMceService.getAnchorNames(JSON.stringify(resp.properties));
$scope.model.target.url = resp.urls[0];
});
}
@@ -123,12 +122,6 @@ angular.module("umbraco").controller("Umbraco.Overlays.LinkPickerController",
$scope.mediaPickerOverlay.show = false;
$scope.mediaPickerOverlay = null;
// make sure the content tree has nothing highlighted
$scope.dialogTreeEventHandler.syncTree({
path: "-1",
tree: "content"
});
}
};
});
@@ -309,9 +309,21 @@ angular.module("umbraco")
debounceSearchMedia();
};
$scope.toggle = function() {
/**
* Toggle the $scope.model.allowAsRoot value to either true or false
*/
$scope.toggle = function(){
// Make sure to activate the changeSearch function everytime the toggle is clicked
$scope.changeSearch();
// Toggle the showChilds option
if($scope.showChilds){
$scope.showChilds = false;
return;
}
$scope.showChilds = true;
}
$scope.changePagination = function(pageNumber) {
@@ -22,10 +22,14 @@
no-dirty-check />
<div class="form-search__toggle">
<input type="checkbox" ng-model="showChilds" ng-change="toggle()" />
<label>
<localize key="general_includeFromsubFolders">Include subfolders in search</localize>
</label>
<umb-toggle
checked="showChilds"
on-click="toggle()">
</umb-toggle>
</div>
</div>
@@ -1,4 +1,4 @@
<button ng-click="click()" type="button" class="umb-toggle" ng-disabled="disabled" ng-class="{'umb-toggle--checked': checked, 'umb-toggle--disabled': disabled}">
<button ng-click="click()" type="button" class="umb-toggle" ng-class="{'umb-toggle--checked': checked}">
<span ng-if="!labelPosition && showLabels === 'true' || labelPosition === 'left' && showLabels === 'true'">
<span ng-if="!checked" class="umb-toggle__label umb-toggle__label--left">{{ displayLabelOff }}</span>
@@ -6,9 +6,9 @@
</span>
<div class="umb-toggle__toggle">
<i ng-show="checked && hideIcons !== 'true'" class="umb-toggle__icon umb-toggle__icon--left icon-check"></i>
<i ng-show="checked && !hideIcons" class="umb-toggle__icon umb-toggle__icon--left icon-check"></i>
<div class="umb-toggle__handler shadow-depth-1"></div>
<i ng-show="!checked && hideIcons !== 'true'" class="umb-toggle__icon umb-toggle__icon--right icon-wrong"></i>
<i ng-show="!checked && !hideIcons" class="umb-toggle__icon umb-toggle__icon--right icon-wrong"></i>
</div>
<span ng-if="labelPosition === 'right' && showLabels === 'true'">

Some files were not shown because too many files have changed in this diff Show More