diff --git a/BUILD.md b/BUILD.md index 30ea950778..a2406c58bd 100644 --- a/BUILD.md +++ b/BUILD.md @@ -6,19 +6,13 @@ Umbraco Cms Build To build Umbraco, fire PowerShell and move to Umbraco's repository root (the directory that contains `src`, `build`, `README.md`...). There, trigger the build with the following command: - build\build.ps1 + build/build.ps1 -By default, this builds the current version. It is possible to specify a different version as a parameter to the build script: - - build\build.ps1 7.6.44 - -Valid version strings are defined in the `Set-UmbracoVersion` documentation below. - ## PowerShell Quirks There is a good chance that running `build.ps1` ends up in error, with messages such as ->The file ...\build\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies. +>The file ...\build.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies. PowerShell has *Execution Policies* that may prevent the script from running. You can check the current policies with: @@ -42,7 +36,7 @@ Alternatively, you can do it at machine level, from within an elevated PowerShel And *then* the script should run. It *might* however still complain about executing scripts, with messages such as: ->Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build\build.ps1? +>Security warning - Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning message. Do you want to run ...\build.ps1? [D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): This is usually caused by the scripts being *blocked*. And that usually happens when the source code has been downloaded as a Zip file. When Windows downloads Zip files, they are marked as *blocked* (technically, they have a Zone.Identifier alternate data stream, with a value of "3" to indicate that they were downloaded from the Internet). And when such a Zip file is un-zipped, each and every single file is also marked as blocked. @@ -51,34 +45,20 @@ The best solution is to unblock the Zip file before un-zipping: right-click the PS> Get-ChildItem -Recurse *.* | Unblock-File -## Notes +## Git Quirks Git might have issues dealing with long file paths during build. You may want/need to enable `core.longpaths` support (see [this page](https://github.com/msysgit/msysgit/wiki/Git-cannot-create-a-file-or-directory-with-a-long-path) for details). -If PowerShell does not execute the script due to a security error, you may have to run the following command from an administrator prompt: +# Build Infrastructure - Set-ExecutionPolicy -ExecutionPolicy RemoteSigned +The Umbraco Build infrastructure relies on a PowerShell object. The object can be retrieved with: -# Build + $ubuild = build/build.ps1 -get -The Umbraco Build solution relies on a PowerShell module. The module needs to be imported into PowerShell. From within Umbraco's repository root: - - build\build.ps1 -ModuleOnly - -Or the abbreviated form: - - build\build.ps1 -mo - -Once the module has been imported, a set of commands are added to PowerShell. - -## Get-UmbracoBuildEnv - -Gets the Umbraco build environment ie NuGet, Semver, Visual Studio, etc. Downloads things that can be downloaded such as NuGet. Examples: - - $uenv = Get-UmbracoBuildEnv - Write-Host $uenv.SolutionRoot - &$uenv.NuGet help +The object exposes various properties and methods that can be used to fine-grain build Umbraco. Some, but not all, of them are detailed below. +## Properties + The object exposes the following properties: * `SolutionRoot`: the absolute path to the solution root @@ -96,11 +76,11 @@ The Visual Studio object is `null` when Visual Studio has not been detected (eg * `Minor`: Visual Studio minor version * `MsBUild`: the absolute path to the MsBuild executable -## Get-UmbracoVersion +## GetUmbracoVersion Gets an object representing the current Umbraco version. Example: - $v = Get-UmbracoVersion + $v = $ubuild.GetUmbracoVersion() Write-Host $v.Semver The object exposes the following properties: @@ -110,28 +90,24 @@ The object exposes the following properties: * `Comment`: the pre release part of the version (eg `alpha02`) * `Build`: the build number part of the version (eg `1234`) -## Set-UmbracoVersion +## SetUmbracoVersion Modifies Umbraco files with the new version. ->This entirely replaces the legacy `UmbracoVersion.txt` file. +>This entirely replaces the legacy `UmbracoVersion.txt` file. Do *not* edit version infos in files. The version must be a valid semver version. It can include a *pre release* part (eg `alpha02`) and/or a *build number* (eg `1234`). Examples: - Set-UmbracoVersion 7.6.33 - Set-UmbracoVersion 7.6.33-alpha02 - Set-UmbracoVersion 7.6.33+1234 - Set-UmbracoVersion 7.6.33-beta05+5678 + $ubuild.SetUmbracoVersion("7.6.33") + $ubuild.SetUmbracoVersion("7.6.33-alpha.2") + $ubuild.SetUmbracoVersion("7.6.33+1234") + $ubuild.SetUmbracoVersion("7.6.33-beta.5+5678") -Note that `Set-UmbracoVersion` enforces a slightly more restrictive naming scheme than what semver would tolerate. The pre release part can only be composed of a-z and 0-9, therefore `alpha033` is considered valid but not `alpha.033` nor `alpha033-preview` nor `RC2` (would need to be lowercased `rc2`). - ->It is considered best to add trailing zeroes to pre releases, else NuGet gets the order of versions wrong. So if you plan to have more than 10, but no more that 100 alpha versions, number the versions `alpha00`, `alpha01`, etc. - -## Build-Umbraco +## Build Builds Umbraco. Temporary files are generated in `build.tmp` while the actual artifacts (zip files, NuGet packages...) are produced in `build.out`. Example: - Build-Umbraco + $ubuild.Build() Some log files, such as MsBuild logs, are produced in `build.tmp` too. The `build` directory should remain clean during a build. @@ -185,6 +161,4 @@ We should increment versions as soon as a version is released. Ie, as soon as `7 NuGet / NuSpec consistency checks are performed in tests. We should move it so it is done as part of the PowerShell script even before we try to compile and run the tests. -There are still a few commands in `build` (to build docs, install Git or cleanup the install) that will need to be migrated to PowerShell. - /eof \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f8d8aac342..3ec8ef31fe 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 -The following is a set of guidelines for contributing to Umbraco CMS. +The following is a set of guidelines for contributing to Umbraco CMS. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. @@ -10,6 +10,8 @@ Remember, we're a friendly bunch and are happy with whatever contribution you mi #### Table Of Contents +__[Quick start guide for Umbraco v8](https://github.com/umbraco/Umbraco-CMS/blob/temp8/V8_GETTING_STARTED.md)__ + [Code of Conduct](#code-of-conduct) [How Can I Contribute?](#how-can-i-contribute) diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000000..7d786702f4 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/README.md b/README.md index 24aa108c11..f7e6089198 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +_Looking for Umbraco version 7? [Click here](https://github.com/umbraco/Umbraco-CMS) to go to the v7 branch_ + +__Ready to try out Version 8? [See the quick start guide](https://github.com/umbraco/Umbraco-CMS/blob/temp8/V8_GETTING_STARTED.md).__ + Umbraco CMS =========== The friendliest, most flexible and fastest growing ASP.NET CMS used by more than 443,000 websites worldwide: [https://umbraco.com](https://umbraco.com) diff --git a/V8_GETTING_STARTED.md b/V8_GETTING_STARTED.md new file mode 100644 index 0000000000..61734b9959 --- /dev/null +++ b/V8_GETTING_STARTED.md @@ -0,0 +1,30 @@ +## A quick start guide for getting up and runnning with Umbraco v8 + +### What you need: + +* [Visual Studio 2017 Community (Free)](https://www.visualstudio.com/vs/community/), or Professional, Enterprise, etc... +* .NET Framework 4.7.2 installed, get it here: https://www.microsoft.com/net/download/thank-you/net472?survey=false +* .NET Framework 4.7.2 developer pack, get it here: https://www.microsoft.com/net/download/thank-you/net472-developer-pack _(be sure this is the ENU file which will be named `NDP472-DevPack-ENU.exe`)_ +* Clone the Umbraco repository and ensure you have the `temp8` branch checked out + +### Start the solution + +* Open the `/src/umbraco.sln` Visual Studio solution +* Start the solution (easiest way is to use `ctrl + F5`) + * When the solution is first built this may take some time since it will restore all nuget, npm and bower packages, build the .net solution and also build the angular solution. +* When the website starts you'll see the Umbraco installer and just follow the prompts +* Your all set! + +### Making code changes + +* _The process for making code changes in v8 is the same as v7_ +* Any .NET changes you make you just need to compile +* Any Angular/JS changes you make you will need to make sure you are running the Gulp build. Easiest way to do this is from within Visual Studio in the `Task Runner Explorer`. You can find this window by pressing `ctrl + q` and typing in `Task Runner Explorer`. In this window you'll see all Gulp tasks, double click on the `dev` task, this will compile the angular solution and start a file watcher, then any html/js changes you make are automatically built. + * When making js changes, you should have the chrome developer tools open to ensure that cache is disabled + +### What to work on? + +We are keeping track of [known issues and limitations here](http://issues.umbraco.org/issue/U4-11279). These line items will eventually be turned into actual tasks to be worked on. Feel free to help us keep this list updated if you find issues and even help fix some of these items. If there is a particular item you'd like to help fix please mention this on the task and we'll create a sub task for the item to continue discussion there. + +There's [a list of tasks for v8 that haven't been completed](http://issues.umbraco.org/issues/U4?q=Due+in+version%3A+8.0.0+%23Unresolved+). If you are interested in helping out with any of these please mention this on the task. This list will be constantly updated as we begin to document and design some of the other tasks that still need to get done. + diff --git a/build/build-bootstrap.ps1 b/build/build-bootstrap.ps1 index c1b2cb0fbe..71a25bfd7e 100644 --- a/build/build-bootstrap.ps1 +++ b/build/build-bootstrap.ps1 @@ -5,7 +5,7 @@ # . "$PSScriptRoot\build-bootstrap.ps1" # THIS FILE IS DISTRIBUTED AS PART OF UMBRACO.BUILD - # DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION + # DO NOT MODIFY IT - ALWAYS USED THE COMMON VERSION # ################################################################ # BOOTSTRAP @@ -41,12 +41,28 @@ throw "Failed to locate NuGet.exe." } + # NuGet notes + # As soon as we use -ConfigFile, NuGet uses that file, and only that file, and does not + # merge configuration from system level. See comments in NuGet.Client solution, class + # NuGet.Configuration.Settings, method LoadDefaultSettings. + # For NuGet to merge configurations, it needs to "find" the file in the current directory, + # or above. Which means we cannot really use -ConfigFile but instead have to have Umbraco's + # NuGet.config file at root, and always run NuGet.exe while at root or in a directory below + # root. + + $solutionRoot = "$scriptRoot\.." + $testPwd = [System.IO.Path]::GetFullPath($pwd.Path) + "\" + $testRoot = [System.IO.Path]::GetFullPath($solutionRoot) + "\" + if (-not $testPwd.ToLower().StartsWith($testRoot.ToLower())) + { + throw "Cannot run outside of the solution's root." + } + # get the build system if (-not $local) { - $solutionRoot = "$scriptRoot\.." - $nugetConfig = @{$true="$solutionRoot\src\NuGet.config.user";$false="$solutionRoot\src\NuGet.config"}[(test-path "$solutionRoot\src\NuGet.config.user")] - &$nuget install Umbraco.Build -OutputDirectory $scriptTemp -Verbosity quiet -PreRelease -ConfigFile $nugetConfig + $params = "-OutputDirectory", $scriptTemp, "-Verbosity", "quiet", "-PreRelease" + &$nuget install Umbraco.Build @params if (-not $?) { throw "Failed to download Umbraco.Build." } } @@ -63,7 +79,7 @@ # at that point the build.ps1 script must boot the build system # eg - # $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."), + # $ubuild.Boot($ubuildPath.FullName, [System.IO.Path]::GetFullPath("$scriptRoot\.."), # @{ Local = $local; With7Zip = $false; WithNode = $false }, # @{ continue = $continue }) # if (-not $?) { throw "Failed to boot the build system." } @@ -73,4 +89,4 @@ # Write-Host "Umbraco.Whatever Build" # Write-Host "Umbraco.Build v$($ubuild.BuildVersion)" - # eof \ No newline at end of file + # eof diff --git a/build/build.ps1 b/build/build.ps1 index 1c8d429333..3bdf2ba6e1 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -342,13 +342,13 @@ $this.TempStoreFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config") Write-Host "Create clean web.config" $this.CopyFile("$($this.SolutionRoot)\src\Umbraco.Web.UI\web.Template.config", "$($this.SolutionRoot)\src\Umbraco.Web.UI\web.config") - + Write-host "Set environment" $env:UMBRACO_VERSION=$this.Version.Semver.ToString() $env:UMBRACO_RELEASE=$this.Version.Release $env:UMBRACO_COMMENT=$this.Version.Comment $env:UMBRACO_BUILD=$this.Version.Build - + if ($args -and $args[0] -eq "vso") { Write-host "Set VSO environment" @@ -378,7 +378,7 @@ { Write-Host "Restore NuGet" Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log" - &$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" -ConfigFile $this.BuildEnv.NuGetConfig > "$($this.BuildTemp)\nuget.restore.log" + &$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\src\Umbraco.sln" > "$($this.BuildTemp)\nuget.restore.log" if (-not $?) { throw "Failed to restore NuGet packages." } }) diff --git a/apidocs/docfx.filter.yml b/src/ApiDocs/docfx.filter.yml similarity index 100% rename from apidocs/docfx.filter.yml rename to src/ApiDocs/docfx.filter.yml diff --git a/apidocs/docfx.json b/src/ApiDocs/docfx.json similarity index 100% rename from apidocs/docfx.json rename to src/ApiDocs/docfx.json diff --git a/apidocs/index.md b/src/ApiDocs/index.md similarity index 100% rename from apidocs/index.md rename to src/ApiDocs/index.md diff --git a/apidocs/toc.yml b/src/ApiDocs/toc.yml similarity index 100% rename from apidocs/toc.yml rename to src/ApiDocs/toc.yml diff --git a/apidocs/umbracotemplate/partials/class.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/class.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/class.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/class.tmpl.partial diff --git a/apidocs/umbracotemplate/partials/footer.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/footer.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/footer.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/footer.tmpl.partial diff --git a/apidocs/umbracotemplate/partials/head.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/head.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/head.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/head.tmpl.partial diff --git a/apidocs/umbracotemplate/partials/namespace.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/namespace.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/namespace.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/namespace.tmpl.partial diff --git a/apidocs/umbracotemplate/partials/navbar.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/navbar.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/navbar.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/navbar.tmpl.partial diff --git a/apidocs/umbracotemplate/partials/rest.tmpl.partial b/src/ApiDocs/umbracotemplate/partials/rest.tmpl.partial similarity index 100% rename from apidocs/umbracotemplate/partials/rest.tmpl.partial rename to src/ApiDocs/umbracotemplate/partials/rest.tmpl.partial diff --git a/apidocs/umbracotemplate/styles/main.css b/src/ApiDocs/umbracotemplate/styles/main.css similarity index 100% rename from apidocs/umbracotemplate/styles/main.css rename to src/ApiDocs/umbracotemplate/styles/main.css diff --git a/src/NuGet.Config b/src/NuGet.Config deleted file mode 100644 index 722f368692..0000000000 --- a/src/NuGet.Config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/src/SolutionInfo.cs b/src/SolutionInfo.cs index 124dc93140..37150025fa 100644 --- a/src/SolutionInfo.cs +++ b/src/SolutionInfo.cs @@ -10,6 +10,8 @@ using System.Resources; // versions // read https://stackoverflow.com/questions/64602/what-are-differences-between-assemblyversion-assemblyfileversion-and-assemblyin + +// note: do NOT change anything here manually, use the build scripts // this is the ONLY ONE the CLR cares about for compatibility // should change ONLY when "hard" breaking compatibility (manual change) diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs index b58df9b527..4a00aeb3ee 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs @@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings { internal class ContentElement : UmbracoConfigurationElement, IContentSection { - private const string DefaultPreviewBadge = @"In Preview Mode - click to end"; + private const string DefaultPreviewBadge = @"In Preview Mode - click to end"; [ConfigurationProperty("imaging")] internal ContentImagingElement Imaging => (ContentImagingElement) this["imaging"]; diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index b72725af29..1fa5bd676a 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -60,7 +60,7 @@ - + diff --git a/src/Umbraco.Tests/App.config b/src/Umbraco.Tests/App.config index 0d504aaea1..e5a8fcd1a6 100644 --- a/src/Umbraco.Tests/App.config +++ b/src/Umbraco.Tests/App.config @@ -171,32 +171,11 @@ - - - - - + - + diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs index fa2e5b1fbd..0980b600e8 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs @@ -144,7 +144,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public void PreviewBadge() { - Assert.IsTrue(SettingsSection.Content.PreviewBadge == @"In Preview Mode - click to end"); + Assert.IsTrue(SettingsSection.Content.PreviewBadge == @"In Preview Mode - click to end"); } [Test] public void UmbracoLibraryCacheDuration() diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config b/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config index fc59f62d12..07eb355d68 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config @@ -75,7 +75,7 @@ true - In Preview Mode - click to end]]> + In Preview Mode - click to end]]> diff --git a/src/Umbraco.Web.UI.Client/src/assets/img/preview-mode-badge.png b/src/Umbraco.Web.UI.Client/src/assets/img/preview-mode-badge.png new file mode 100644 index 0000000000..af6a9789e6 Binary files /dev/null and b/src/Umbraco.Web.UI.Client/src/assets/img/preview-mode-badge.png differ diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js index 5d39fb3bcf..1281443952 100644 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js +++ b/src/Umbraco.Web.UI.Client/src/canvasdesigner.loader.js @@ -9,7 +9,6 @@ LazyLoad.js([ '../js/umbraco.services.js', '../js/umbraco.security.js', '../ServerVariables', - '../lib/spectrum/spectrum.js', '../lib/signalr/jquery.signalR.js', '/umbraco/BackOffice/signalr/hubs', '../js/umbraco.canvasdesigner.js' diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.controller.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.controller.js index 6a8d7564dc..975d490086 100644 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.controller.js +++ b/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.controller.js @@ -3,7 +3,7 @@ /* Canvasdesigner panel app and controller */ /*********************************************************************************************************/ -var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', 'umbraco.resources', 'umbraco.services']) +var app = angular.module("Umbraco.canvasdesigner", ['umbraco.resources', 'umbraco.services']) .controller("Umbraco.canvasdesignerController", function ($scope, $http, $window, $timeout, $location, dialogService) { @@ -18,8 +18,6 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', $scope.isOpen = false; $scope.frameLoaded = false; - $scope.enableCanvasdesigner = 0; - $scope.googleFontFamilies = {}; var pageId = $location.search().id; $scope.pageId = pageId; $scope.pageUrl = "../dialogs/Preview.aspx?id=" + pageId; @@ -33,9 +31,7 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', { name: "smartphone landscape - 320px", css: "smartphone-landscape border", icon: "icon-iphone flip", title: "Smartphone landscape" } ]; $scope.previewDevice = $scope.devices[0]; - - var apiController = "../Api/Canvasdesigner/"; - + /*****************************************************************************/ /* Preview devices */ /*****************************************************************************/ @@ -53,224 +49,7 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', window.top.location.href = "../endPreview.aspx?redir=%2f" + $scope.pageId; }; - /*****************************************************************************/ - /* UI designer managment */ - /*****************************************************************************/ - // Update all Canvasdesigner config's values from data - var updateConfigValue = function (data) { - - var fonts = []; - - $.each($scope.canvasdesignerModel.configs, function (indexConfig, config) { - if (config.editors) { - $.each(config.editors, function (indexItem, item) { - - /* try to get value */ - try { - - if (item.values) { - angular.forEach(Object.keys(item.values), function (key, indexKey) { - if (key != "''") { - var propertyAlias = key.toLowerCase() + item.alias.toLowerCase(); - var newValue = eval("data." + propertyAlias.replace("@", "")); - if (newValue == "''") { - newValue = ""; - } - item.values[key] = newValue; - } - }) - } - - // TODO: special init for font family picker - if (item.type == "googlefontpicker") { - if (item.values.fontType == 'google' && item.values.fontFamily + item.values.fontWeight && $.inArray(item.values.fontFamily + ":" + item.values.fontWeight, fonts) < 0) { - fonts.splice(0, 0, item.values.fontFamily + ":" + item.values.fontWeight); - } - } - - } - catch (err) { - console.info("Style parameter not found " + item.alias); - } - - }); - } - - }); - - // Load google font - $.each(fonts, function (indexFont, font) { - loadGoogleFont(font); - loadGoogleFontInFront(font); - }); - - $scope.valueAreLoaded = true; - - }; - - // Load parameters from GetLessParameters and init data of the Canvasdesigner config - $scope.initCanvasdesigner = function () { - - LazyLoad.js(['https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js']); - - $http.get(apiController + 'Load', { params: { pageId: $scope.pageId } }) - .success(function (data) { - - updateConfigValue(data); - - $timeout(function () { - $scope.frameLoaded = true; - }, 200); - - }); - - }; - - // Refresh all less parameters for every changes watching canvasdesignerModel - var refreshCanvasdesigner = function () { - - var parameters = []; - - if ($scope.canvasdesignerModel) { - - angular.forEach($scope.canvasdesignerModel.configs, function (config, indexConfig) { - - // Get currrent selected element - // TODO - //if ($scope.schemaFocus && angular.lowercase($scope.schemaFocus) == angular.lowercase(config.name)) { - // $scope.currentSelected = config.selector ? config.selector : config.schema; - //} - - if (config.editors) { - angular.forEach(config.editors, function (item, indexItem) { - - // Add new style - if (item.values) { - angular.forEach(Object.keys(item.values), function (key, indexKey) { - var propertyAlias = key.toLowerCase() + item.alias.toLowerCase(); - var value = eval("item.values." + key); - parameters.splice(parameters.length + 1, 0, "'@" + propertyAlias + "':'" + value + "'"); - }) - } - }); - } - - }); - - // Refresh page style - refreshFrontStyles(parameters); - - // Refresh layout of selected element - //$timeout(function () { - $scope.positionSelectedHide(); - if ($scope.currentSelected) { - refreshOutlineSelected($scope.currentSelected); - } - //}, 200); - - - - } - } - - $scope.createStyle = function (){ - $scope.saveLessParameters(false); - } - - $scope.saveStyle = function () { - $scope.saveLessParameters(true); - } - - // Save all parameter in CanvasdesignerParameters.less file - $scope.saveLessParameters = function (inherited) { - - var parameters = []; - $.each($scope.canvasdesignerModel.configs, function (indexConfig, config) { - if (config.editors) { - $.each(config.editors, function (indexItem, item) { - - if (item.values) { - angular.forEach(Object.keys(item.values), function (key, indexKey) { - var propertyAlias = key.toLowerCase() + item.alias.toLowerCase(); - var value = eval("item.values." + key); - parameters.splice(parameters.length + 1, 0, "@" + propertyAlias + ":" + value + ";"); - }) - - // TODO: special init for font family picker - if (item.type == "googlefontpicker" && item.values.fontFamily) { - var variant = item.values.fontWeight != "" || item.values.fontStyle != "" ? ":" + item.values.fontWeight + item.values.fontStyle : ""; - var gimport = "@import url('https://fonts.googleapis.com/css?family=" + item.values.fontFamily + variant + "');"; - if ($.inArray(gimport, parameters) < 0) { - parameters.splice(0, 0, gimport); - } - } - } - - }); - } - }); - - var resultParameters = { parameters: parameters.join(""), pageId: $scope.pageId, inherited: inherited }; - var transform = function (result) { - return $.param(result); - } - - $('.btn-default-save').attr("disabled", true); - $http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"; - $http.post(apiController + 'Save', resultParameters, { - headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }, - transformRequest: transform - }) - .success(function (data) { - $('.btn-default-save').attr("disabled", false); - $('#speechbubble').fadeIn('slow').delay(5000).fadeOut('slow'); - }); - - } - - // Delete current page Canvasdesigner - $scope.deleteCanvasdesigner = function () { - $('.btn-default-delete').attr("disabled", true); - $http.get(apiController + 'Delete', { params: { pageId: $scope.pageId } }) - .success(function (data) { - location.reload(); - }) - } - - - /*****************************************************************************/ - /* Preset design */ - /*****************************************************************************/ - - // Refresh with selected Canvasdesigner palette - $scope.refreshCanvasdesignerByPalette = function (palette) { - updateConfigValue(palette.data); - refreshCanvasdesigner(); - }; - - // Hidden botton to make preset from the current settings - $scope.makePreset = function () { - - var parameters = []; - $.each($scope.canvasdesignerModel.configs, function (indexConfig, config) { - if (config.editors) { - $.each(config.editors, function (indexItem, item) { - if (item.values) { - angular.forEach(Object.keys(item.values), function (key, indexKey) { - var propertyAlias = key.toLowerCase() + item.alias.toLowerCase(); - var value = eval("item.values." + key); - var value = (value != 0 && (value == undefined || value == "")) ? "''" : value; - parameters.splice(parameters.length + 1, 0, "\"" + propertyAlias + "\":" + " \"" + value + "\""); - }) - } - }); - } - }); - - $(".btn-group").append(""); - - }; /*****************************************************************************/ /* Panel managment */ @@ -281,216 +60,21 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', $scope.closeIntelCanvasdesigner(); } - $scope.closePreviewDevice = function(){ - $scope.showDevicesPreview = false; - if ($scope.showStyleEditor) { - $scope.openIntelCanvasdesigner(); - } - } - - $scope.openPalettePicker = function () { - $scope.showPalettePicker = true; - $scope.showStyleEditor = false; - $scope.closeIntelCanvasdesigner(); - }; - - $scope.openStyleEditor = function () { - $scope.showStyleEditor = true; - $scope.showPalettePicker = false; - $scope.outlineSelectedHide() - $scope.openIntelCanvasdesigner() - } - - // Remove value from field - $scope.removeField = function (field) { - field.value = ""; - }; - - // Check if category existe - $scope.hasEditor = function (editors, category) { - var result = false; - angular.forEach(editors, function (item, index) { - if (item.category == category) { - result = true; - } - }); - return result; - }; - - $scope.closeFloatPanels = function () { - - /* hack to hide color picker */ - $(".spectrumcolorpicker input").spectrum("hide"); - - dialogService.close(); - $scope.showPalettePicker = false; - $scope.$apply(); - }; - - $scope.clearHighlightedItems = function () { - $.each($scope.canvasdesignerModel.configs, function (indexConfig, config) { - config.highlighted = false; - }); - } - - $scope.setCurrentHighlighted = function (item) { - $scope.clearHighlightedItems(); - item.highlighted = true; - } - - $scope.setCurrentSelected = function(item) { - $scope.currentSelected = item; - $scope.clearSelectedCategory(); - refreshOutlineSelected($scope.currentSelected); - } - - /* Editor categories */ - - $scope.getCategories = function (item) { - - var propertyCategories = []; - - $.each(item.editors, function (indexItem, editor) { - if (editor.category) { - if ($.inArray(editor.category, propertyCategories) < 0) { - propertyCategories.splice( propertyCategories.length + 1, 0, editor.category); - } - } - }); - - return propertyCategories; - - } - - $scope.setSelectedCategory = function (item) { - $scope.categoriesVisibility = $scope.categoriesVisibility || {}; - $scope.categoriesVisibility[item] = !$scope.categoriesVisibility[item]; - } - - $scope.clearSelectedCategory = function () { - $scope.categoriesVisibility = null; - } - /*****************************************************************************/ /* Call function into the front-end */ /*****************************************************************************/ - - var loadGoogleFontInFront = function (font) { - if (document.getElementById("resultFrame").contentWindow.getFont) - document.getElementById("resultFrame").contentWindow.getFont(font); - }; - - var refreshFrontStyles = function (parameters) { - if (document.getElementById("resultFrame").contentWindow.refreshLayout) - document.getElementById("resultFrame").contentWindow.refreshLayout(parameters); - }; + var hideUmbracoPreviewBadge = function () { var iframe = (document.getElementById("resultFrame").contentWindow || document.getElementById("resultFrame").contentDocument); if(iframe.document.getElementById("umbracoPreviewBadge")) iframe.document.getElementById("umbracoPreviewBadge").style.display = "none"; }; - - $scope.openIntelCanvasdesigner = function () { - if (document.getElementById("resultFrame").contentWindow.initIntelCanvasdesigner) - document.getElementById("resultFrame").contentWindow.initIntelCanvasdesigner($scope.canvasdesignerModel); - }; - - $scope.closeIntelCanvasdesigner = function () { - if (document.getElementById("resultFrame").contentWindow.closeIntelCanvasdesigner) - document.getElementById("resultFrame").contentWindow.closeIntelCanvasdesigner($scope.canvasdesignerModel); - $scope.outlineSelectedHide(); - }; - - var refreshOutlineSelected = function (config) { - var schema = config.selector ? config.selector : config.schema; - if (document.getElementById("resultFrame").contentWindow.refreshOutlineSelected) - document.getElementById("resultFrame").contentWindow.refreshOutlineSelected(schema); - } - - $scope.outlineSelectedHide = function () { - $scope.currentSelected = null; - if (document.getElementById("resultFrame").contentWindow.outlineSelectedHide) - document.getElementById("resultFrame").contentWindow.outlineSelectedHide(); - }; - - $scope.refreshOutlinePosition = function (config) { - var schema = config.selector ? config.selector : config.schema; - if (document.getElementById("resultFrame").contentWindow.refreshOutlinePosition) - document.getElementById("resultFrame").contentWindow.refreshOutlinePosition(schema); - } - - $scope.positionSelectedHide = function () { - if (document.getElementById("resultFrame").contentWindow.outlinePositionHide) - document.getElementById("resultFrame").contentWindow.outlinePositionHide(); - } - - /*****************************************************************************/ - /* Google font loader, TODO: put together from directive, front and back */ - /*****************************************************************************/ - - var webFontScriptLoaded = false; - var loadGoogleFont = function (font) { - - if (!webFontScriptLoaded) { - $.getScript('https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js') - .done(function () { - webFontScriptLoaded = true; - // Recursively call once webfont script is available. - loadGoogleFont(font); - }) - .fail(function () { - console.log('error loading webfont'); - }); - } - else { - WebFont.load({ - google: { - families: [font] - }, - loading: function () { - //console.log('loading font' + font + ' in UI designer'); - }, - active: function () { - //console.log('loaded font ' + font + ' in UI designer'); - }, - inactive: function () { - //console.log('error loading font ' + font + ' in UI designer'); - } - }); - } - - }; - + /*****************************************************************************/ /* Init */ /*****************************************************************************/ - - // Preload of the google font - if ($scope.showStyleEditor) { - $http.get(apiController + 'GetGoogleFont').success(function (data) { - $scope.googleFontFamilies = data; - }); - } - - // watch framLoaded, only if iframe page have enableCanvasdesigner() - $scope.$watch("enableCanvasdesigner", function () { - $timeout(function () { - if ($scope.enableCanvasdesigner > 0) { - - $scope.$watch('ngRepeatFinished', function (ngRepeatFinishedEvent) { - $timeout(function () { - $scope.initCanvasdesigner(); - }, 200); - }); - - $scope.$watch('canvasdesignerModel', function () { - refreshCanvasdesigner(); - }, true); - - } - }, 100); - }, true); + // signalr hub var previewHub = $.connection.previewHub; @@ -513,19 +97,7 @@ var app = angular.module("Umbraco.canvasdesigner", ['colorpicker', 'ui.slider', .done(function () { console.log("Connected to SignalR preview hub (ID=" + $.connection.hub.id + ")"); }) .fail(function () { console.log("Could not connect to SignalR preview hub."); }); }) - -.directive('onFinishRenderFilters', function ($timeout) { - return { - restrict: 'A', - link: function (scope, element, attr) { - if (scope.$last === true) { - $timeout(function () { - scope.$emit('ngRepeatFinished'); - }); - } - } - }; -}) + .directive('iframeIsLoaded', function ($timeout) { return { diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.front.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.front.js deleted file mode 100644 index 042d3ed89a..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.front.js +++ /dev/null @@ -1,297 +0,0 @@ -/*********************************************************************************************************/ -/* Global function and variable for panel/page com */ -/*********************************************************************************************************/ - -var currentTarget = undefined; - -var refreshLayout = function (parameters) { - - // hide preview badget - $("#umbracoPreviewBadge").hide(); - - var string = "less.modifyVars({" + parameters.join(",") + "})"; - eval(string); -} - -/* Fonts loaded in the Canvasdesigner panel need to be loaded independently in - * the content iframe to allow live previewing. - */ -var webFontScriptLoaded = false; -var getFont = function (font) { - if (!webFontScriptLoaded) { - $.getScript('https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js') - .done(function () { - webFontScriptLoaded = true; - // Recursively call once webfont script is available. - getFont(font); - }) - .fail(function () { - console.log('error loading webfont'); - }); - } - else { - WebFont.load({ - google: { - families: [font] - }, - loading: function () { - //console.log('loading font' + font + ' in iframe'); - }, - active: function () { - //console.log('loaded font ' + font + ' in iframe'); - }, - inactive: function () { - //console.log('error loading font ' + font + ' in iframe'); - } - }); - } -} - -var closeIntelCanvasdesigner = function (canvasdesignerModel) { - - if (canvasdesignerModel) { - - $.each(canvasdesignerModel.configs, function (indexConfig, config) { - if (config.schema) { - $(config.schema).unbind(); - $(config.schema).removeAttr("canvasdesigner-over"); - } - }); - - initBodyClickEvent(); - - } - -} - -var initBodyClickEvent = function () { - $("body").on("click", function () { - if (parent.iframeBodyClick) { - parent.iframeBodyClick(); - } - }); -} - -var initIntelCanvasdesigner = function (canvasdesignerModel) { - - if (canvasdesignerModel) { - - // Add canvasdesigner-over attr for each schema from config - $.each(canvasdesignerModel.configs, function (indexConfig, config) { - var schema = config.selector ? config.selector : config.schema; - if (schema) { - $(schema).attr("canvasdesigner-over", config.schema); - $(schema).attr("canvasdesigner-over-name", config.name); - $(schema).css("cursor", "default"); - } - }); - - // Outline canvasdesigner-over - $(document).mousemove(function (e) { - - e.stopPropagation(); - - var target = $(e.target); - while (target.length > 0 && (target.attr('canvasdesigner-over') == undefined || target.attr('canvasdesigner-over') == '')) { - target = target.parent(); - } - - if (target.attr('canvasdesigner-over') != undefined && target.attr('canvasdesigner-over') != '') { - target.unbind(); - outlinePosition(target); - - parent.onMouseoverCanvasdesignerItem(target.attr('canvasdesigner-over-name'), target); - - target.click(function (e) { - e.stopPropagation(); - e.preventDefault(); - //console.info(target.attr('canvasdesigner-over')); - - currentTarget = target; - outlineSelected(); - - parent.onClickCanvasdesignerItem(target.attr('canvasdesigner-over'), target); - return false; - }); - } - else { - outlinePositionHide(); - } - }); - - } - -} - -var refreshOutlinePosition = function(schema) { - outlinePosition($(schema)); -} - -var outlinePosition = function (oTarget) { - - var target = oTarget; - - if (target.length > 0 && target.attr('canvasdesigner-over') != undefined && target.attr('canvasdesigner-over') != '') { - - var localname = target[0].localName; - var height = $(target).outerHeight(); - var width = $(target).outerWidth(); - var position = $(target).offset(); - var posY = position.top ; - //$(window).scrollTop(); - var posX = position.left; - //+ $(window).scrollLeft(); - - $(".canvasdesigner-overlay").css('display', 'block'); - $(".canvasdesigner-overlay").css('left', posX); - $(".canvasdesigner-overlay").css('top', posY); - $(".canvasdesigner-overlay").css('width', width + "px"); - $(".canvasdesigner-overlay").css('height', height + "px"); - - //console.info("element select " + localname); - $(".canvasdesigner-overlay span").html(target.attr('canvasdesigner-over-name')); - - } - else { - outlinePositionHide(); - //console.info("element not found select"); - } -} - -var refreshOutlineSelected = function (schema) { - outlineSelected($(schema)); -} - -var outlineSelected = function (oTarget) { - - var target = currentTarget; - - if (oTarget) { - currentTarget = oTarget; - target = oTarget; - } - - if (target && target.length > 0 && target.attr('canvasdesigner-over') != undefined && target.attr('canvasdesigner-over') != '') { - - var localname = target[0].localName; - var height = $(target).outerHeight(); - var width = $(target).outerWidth(); - var position = $(target).offset(); - var posY = position.top; - //$(window).scrollTop(); - var posX = position.left; - //+ $(window).scrollLeft(); - - $(".canvasdesigner-overlay-selected").css('display', 'block'); - $(".canvasdesigner-overlay-selected").css('left', posX); - $(".canvasdesigner-overlay-selected").css('top', posY); - $(".canvasdesigner-overlay-selected").css('width', width + "px"); - $(".canvasdesigner-overlay-selected").css('height', height + "px"); - - //console.info("element select " + localname); - $(".canvasdesigner-overlay-selected span").html(target.attr('canvasdesigner-over-name')); - - } - else { - outlinePositionHide(); - //console.info("element not found select"); - } - -} - -var outlinePositionHide = function () { - $(".canvasdesigner-overlay").css('display', "none"); -} - -var outlineSelectedHide = function () { - currentTarget = undefined; - $(".canvasdesigner-overlay-selected").css('display', "none"); -} - -var initCanvasdesignerPanel = function () { - - $('link[data-title="canvasdesignerCss"]').attr('disabled', 'disabled'); - - // First load the canvasdesigner config from file - if (!canvasdesignerConfig) { - console.info("canvasdesigner config not found"); - } - - // Add canvasdesigner from HTML 5 data tags - $("[data-canvasdesigner]").each(function (index, value) { - var tagName = $(value).data("canvasdesigner") ? $(value).data("canvasdesigner") : $(value)[0].nodeName.toLowerCase(); - var tagSchema = $(value).data("schema") ? $(value).data("schema") : $(value)[0].nodeName.toLowerCase(); - var tagSelector = $(value).data("selector") ? $(value).data("selector") : tagSchema; - var tagEditors = $(value).data("editors"); //JSON.parse(...); - canvasdesignerConfig.configs.splice(canvasdesignerConfig.configs.length, 0, { - name: tagName, - schema: tagSchema, - selector: tagSelector, - editors: tagEditors - }); - }); - - // For each editor config create a composite alias - $.each(canvasdesignerConfig.configs, function (configIndex, config) { - if (config.editors) { - $.each(config.editors, function (editorIndex, editor) { - var clearSchema = config.schema.replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); - var clearEditor = JSON.stringify(editor).replace(/[^a-zA-Z0-9]+/g, '').toLowerCase(); - editor.alias = clearSchema + clearEditor; - }); - } - }); - - // Create or update the less file - $.ajax({ - url: "/Umbraco/Api/CanvasDesigner/Init", - type: 'POST', - dataType: "json", - error: function (err) { - alert(err.responseText) - }, - data: { - config: JSON.stringify(canvasdesignerConfig), - pageId: pageId - }, - success: function (data) { - - // Add Less link in head - $("head").append(""); - css = $("head").children(":last"); - css.attr({ - rel: "stylesheet/less", - type: "text/css", - href: data - }); - //console.info("Less styles are loaded"); - - // Init Less.js - $.getScript("/Umbraco/lib/Less/less-1.7.0.min.js", function (data, textStatus, jqxhr) { - - // Init panel - if (parent.setFrameIsLoaded) { - parent.setFrameIsLoaded(canvasdesignerConfig, canvasdesignerPalette); - } - }); - } - }); - -} - -$(function () { - - if (parent.setFrameIsLoaded) { - - // Overlay background-color: rgba(28, 203, 255, 0.05); - $("body").append("
"); - $("body").append("
"); - - // Set event for any body click - initBodyClickEvent() - - // Init canvasdesigner panel - initCanvasdesignerPanel(); - } - -}); diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.global.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.global.js deleted file mode 100644 index 9315c3326f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/canvasdesigner.global.js +++ /dev/null @@ -1,61 +0,0 @@ - -/*********************************************************************************************************/ -/* Global function and variable for panel/page com */ -/*********************************************************************************************************/ - -/* Called for every canvasdesigner-over click */ -var onClickCanvasdesignerItem = function (schema) { - - var scope = angular.element($("#canvasdesignerPanel")).scope(); - - //if (scope.schemaFocus != schema.toLowerCase()) { - //var notFound = true; - $.each(scope.canvasdesignerModel.configs, function (indexConfig, config) { - if (config.schema && schema.toLowerCase() == config.schema.toLowerCase()) { - scope.currentSelected = config; - } - }); - //} - - scope.clearSelectedCategory(); - - scope.closeFloatPanels(); - - scope.$apply(); - -} - -/* Called for every canvasdesigner-over rollover */ -var onMouseoverCanvasdesignerItem = function (name) { - - var scope = angular.element($("#canvasdesignerPanel")).scope(); - - $.each(scope.canvasdesignerModel.configs, function (indexConfig, config) { - config.highlighted = false; - if (config.name && name.toLowerCase() == config.name.toLowerCase()) { - config.highlighted = true; - } - }); - - scope.$apply(); - -} - -/* Called when the iframe is first loaded */ -var setFrameIsLoaded = function (canvasdesignerConfig, canvasdesignerPalette) { - - var scope = angular.element($("#canvasdesignerPanel")).scope(); - - scope.canvasdesignerModel = canvasdesignerConfig; - scope.canvasdesignerPalette = canvasdesignerPalette; - scope.enableCanvasdesigner++; - scope.$apply(); -} - -/* Iframe body click */ -var iframeBodyClick = function () { - - var scope = angular.element($("#canvasdesignerPanel")).scope(); - - scope.closeFloatPanels(); -} diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.config.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.config.js deleted file mode 100644 index 54a27cc415..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.config.js +++ /dev/null @@ -1,313 +0,0 @@ - -/*********************************************************************************************************/ -/* Canvasdesigner setting panel config */ -/*********************************************************************************************************/ - -var canvasdesignerConfig = { - configs: [{ - name: "Body", - schema: "body", - selector: "body", - editors: [ - { - type: "background", - category: "Color", - name: "Background", - }, - { - type: "color", - category: "Font", - name: "Font Color (main)", - css: "color", - schema: "body, h1, h2, h3, h4, h5, h6, h7, #nav li a" - }, - { - type: "color", - category: "Font", - name: "Font Color (secondary)", - css: "color", - schema: "ul.meta, .byline" - }, - { - type: "googlefontpicker", - category: "Font", - name: "Font Family", - css: "color", - schema: "body, h1, h2, h3, h4, h5, h6, h7, .byline, #nav, .button" - } - ] - }, - { - name: "Nav", - schema: "#nav", - selector: "nav", - editors: [ - { - type: "background", - category: "Color", - name: "Background", - }, - { - type: "border", - category: "Color", - name: "Border", - }, - { - type: "color", - category: "Nav", - name: "Font Color", - css: "color", - schema: "#nav li a" - }, - { - type: "color", - category: "Nav", - name: "Font Color (hover / selected)", - css: "color", - schema: "#nav li:hover a" - }, - { - type: "color", - category: "Nav", - name: "Background Color (hover)", - css: "background-color", - schema: "#nav li:hover a" - }, - { - type: "color", - category: "Nav", - name: "Background Color (selected)", - css: "background-color", - schema: "#nav li.current_page_item a" - }, - { - type: "googlefontpicker", - category: "Font", - name: "Font familly", - } - ] - }, - { - name: "Logo", - schema: "#header .logo div", - selector: "#header .logo div", - editors: [ - { - type: "color", - category: "Color", - name: "Border color", - css: "border-top-color", - schema: "#header .logo" - }, - { - type: "padding", - category: "Position", - name: "Margin", - enable: ["top", "bottom"], - schema: "#header" - }, - ] - }, - { - name: "h2", - schema: "h2", - selector: "h2 span", - editors: [ - { - type: "color", - category: "Color", - name: "Border color", - css: "border-top-color", - schema: "h2.major" - }, - { - type: "color", - category: "Font", - name: "Font color", - css: "color", - } - ] - }, - { - name: "h3", - schema: "h3", - selector: "h3", - editors: [ - { - type: "color", - category: "Font", - name: "Font color", - css: "color", - } - ] - }, - { - name: "Banner Title", - schema: "#banner h2", - selector: "#banner h2", - editors: [ - { - type: "color", - category: "Font", - name: "Font color", - css: "color", - }, - { - type: "slider", - category: "Font", - name: "Font size", - css: "font-size", - min: 18, - max: 100 - }, - { - type: "margin", - category: "Position", - name: "Margin", - } - - ] - }, - { - name: "Banner Sub-title", - schema: "#banner .byline", - selector: "#banner .byline", - editors: [ - { - type: "color", - category: "Font", - name: "Font color", - css: "color", - }, - { - type: "slider", - category: "Font", - name: "Font size", - css: "font-size", - min: 18, - max: 100 - }, - { - type: "margin", - category: "Position", - name: "Margin", - } - - ] - }, - { - name: "Banner", - schema: "#banner", - selector: "#banner", - editors: [ - { - type: "background", - category: "Color", - name: "Background", - css: "color" - } - ] - }, - { - name: "Banner-wrapper", - schema: "#banner-wrapper", - selector: "#banner-wrapper", - editors: [ - { - type: "background", - category: "Color", - name: "Background", - }, - { - type: "padding", - category: "Position", - name: "Padding", - enable: ["top", "bottom"] - } - ] - }, - { - name: "#main-wrapper", - schema: "#main-wrapper", - selector: "#main-wrapper", - editors: [ - { - type: "border", - category: "Styling", - name: "Border", - enable: ["top", "bottom"] - } - ] - }, - { - name: "Image", - schema: ".image,.image img,.image:before", - selector: ".image", - editors: [ - { - type: "radius", - category: "Styling", - name: "Radius" - } - ] - }, - { - name: "Button", - schema: ".button", - selector: ".button", - editors: [ - { - type: "color", - category: "Color", - name: "Color", - css: "color" - }, - { - type: "color", - category: "Color", - name: "Background", - css: "background" - }, - { - type: "color", - category: "Color", - name: "Background Hover", - css: "background", - schema: ".button:hover" - }, - { - type: "radius", - category: "Styling", - name: "Radius" - } - ] - }, - { - name: "Button Alt", - schema: ".button-alt", - selector: ".button-alt", - editors: [ - { - type: "color", - category: "Color", - name: "Color", - css: "color" - }, - { - type: "color", - category: "Color", - name: "Background", - css: "background" - }, - { - type: "color", - category: "Color", - name: "Background Hover", - css: "background", - schema: ".button-alt:hover" - }, - ] - } -] -}; - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.palettes.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.palettes.js deleted file mode 100644 index 6f46b83108..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/config/canvasdesigner.palettes.js +++ /dev/null @@ -1,58 +0,0 @@ - -/*********************************************************************************************************/ -/* Canvasdesigner palette tab config */ -/*********************************************************************************************************/ - -var canvasdesignerPalette = [ - - { - name:"Default", - color1: "rgb(193, 202, 197)", - color2: "rgb(231, 234, 232)", - color3: "rgb(107, 119, 112)", - color4: "rgb(227, 218, 168)", - color5: "rgba(21, 28, 23, 0.95)", - data: - { - "widebodytypewidecategorydimensionnamelayout": "wide","imageorpatternbodytypebackgroundcategorycolornamebackground": "","colorbodytypebackgroundcategorycolornamebackground": "","colorbodytypecolorcategoryfontnamefontcolormaincsscolorschemabodyh1h2h3h4h5h6h7navlia": "rgb(107, 119, 112)","colorbodytypecolorcategoryfontnamefontcolorsecondarycsscolorschemaulmetabyline": "rgb(193, 202, 197)","fontfamilybodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "Open Sans Condensed","fonttypebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "google","fontweightbodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "700","fontstylebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "","imageorpatternnavtypebackgroundcategorycolornamebackground": "","colornavtypebackgroundcategorycolornamebackground": "","bordersizenavtypebordercategorycolornameborder": "","bordercolornavtypebordercategorycolornameborder": "","bordertypenavtypebordercategorycolornameborder": "solid","leftbordersizenavtypebordercategorycolornameborder": "","leftbordercolornavtypebordercategorycolornameborder": "","leftbordertypenavtypebordercategorycolornameborder": "solid","rightbordersizenavtypebordercategorycolornameborder": "","rightbordercolornavtypebordercategorycolornameborder": "","rightbordertypenavtypebordercategorycolornameborder": "solid","topbordersizenavtypebordercategorycolornameborder": "","topbordercolornavtypebordercategorycolornameborder": "","topbordertypenavtypebordercategorycolornameborder": "solid","bottombordersizenavtypebordercategorycolornameborder": "","bottombordercolornavtypebordercategorycolornameborder": "","bottombordertypenavtypebordercategorycolornameborder": "solid","colornavtypecolorcategorynavnamefontcolorcsscolorschemanavlia": "rgb(107, 119, 112)","colornavtypecolorcategorynavnamefontcolorhoverselectedcsscolorschemanavlihovera": "rgb(255, 255, 255)","colornavtypecolorcategorynavnamebackgroundcolorhovercssbackgroundcolorschemanavlihovera": "rgb(193, 202, 197)","colornavtypecolorcategorynavnamebackgroundcolorselectedcssbackgroundcolorschemanavlicurrentpageitema": "rgb(227, 218, 168)","fontfamilynavtypegooglefontpickercategoryfontnamefontfamilly": "","fonttypenavtypegooglefontpickercategoryfontnamefontfamilly": "","fontweightnavtypegooglefontpickercategoryfontnamefontfamilly": "","fontstylenavtypegooglefontpickercategoryfontnamefontfamilly": "","colorheaderlogodivtypecolorcategorycolornamebordercolorcssbordertopcolorschemaheaderlogo": "rgb(231, 234, 232)","paddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","leftpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","rightpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","toppaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "172","bottompaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "101","colorh2typecolorcategorycolornamebordercolorcssbordertopcolorschemah2major": "rgb(231, 234, 232)","colorh2typecolorcategoryfontnamefontcolorcsscolor": "","colorh3typecolorcategoryfontnamefontcolorcsscolor": "","colorbannerh2typecolorcategoryfontnamefontcolorcsscolor": "","sliderbannerh2typeslidercategoryfontnamefontsizecssfontsizemin18max100": "45","marginvaluebannerh2typemargincategorypositionnamemargin": "","leftmarginvaluebannerh2typemargincategorypositionnamemargin": "","rightmarginvaluebannerh2typemargincategorypositionnamemargin": "","topmarginvaluebannerh2typemargincategorypositionnamemargin": "","bottommarginvaluebannerh2typemargincategorypositionnamemargin": "","colorbannerbylinetypecolorcategoryfontnamefontcolorcsscolor": "","sliderbannerbylinetypeslidercategoryfontnamefontsizecssfontsizemin18max100": "22","marginvaluebannerbylinetypemargincategorypositionnamemargin": "","leftmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","rightmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","topmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","bottommarginvaluebannerbylinetypemargincategorypositionnamemargin": "","imageorpatternbannertypebackgroundcategorycolornamebackgroundcsscolor": "","colorbannertypebackgroundcategorycolornamebackgroundcsscolor": "rgba(21, 28, 23, 0.95)","imageorpatternbannerwrappertypebackgroundcategorycolornamebackground": "","colorbannerwrappertypebackgroundcategorycolornamebackground": "","paddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","leftpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","rightpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","toppaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "123","bottompaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "125","bordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","leftbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","rightbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","topbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "32","topbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(227, 218, 168)","topbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","bottombordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "10","bottombordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(193, 202, 197)","bottombordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","radiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "8","topleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","toprightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","bottomleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","bottomrightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","colorbuttontypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttontypecolorcategorycolornamebackgroundcssbackground": "rgb(227, 218, 168)","colorbuttontypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonhover": "rgb(235, 227, 178)","radiusvaluebuttontyperadiuscategorystylingnameradius": "7","topleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","toprightradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomrightradiusvaluebuttontyperadiuscategorystylingnameradius": "","colorbuttonalttypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttonalttypecolorcategorycolornamebackgroundcssbackground": "rgb(193, 202, 197)","colorbuttonalttypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonalthover": "rgb(204, 213, 208)" - } - }, - - { - name: "Blue Alternative", - color1: "rgb(193, 202, 197)", - color2: "rgb(231, 234, 232)", - color3: "rgb(107, 119, 112)", - color4: "rgb(68, 187, 204)", - color5: "rgba(21, 28, 23, 0.95)", - data: - { - "widebodytypewidecategorydimensionnamelayout": "wide","imageorpatternbodytypebackgroundcategorycolornamebackground": "","colorbodytypebackgroundcategorycolornamebackground": "","colorbodytypecolorcategoryfontnamefontcolormaincsscolorschemabodyh1h2h3h4h5h6h7navlia": "rgb(51, 68, 51)","colorbodytypecolorcategoryfontnamefontcolorsecondarycsscolorschemaulmetabyline": "rgb(68, 187, 204)","fontfamilybodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "Alef","fonttypebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "google","fontweightbodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "regular","fontstylebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "","imageorpatternnavtypebackgroundcategorycolornamebackground": "","colornavtypebackgroundcategorycolornamebackground": "","bordersizenavtypebordercategorycolornameborder": "","bordercolornavtypebordercategorycolornameborder": "","bordertypenavtypebordercategorycolornameborder": "solid","leftbordersizenavtypebordercategorycolornameborder": "","leftbordercolornavtypebordercategorycolornameborder": "","leftbordertypenavtypebordercategorycolornameborder": "solid","rightbordersizenavtypebordercategorycolornameborder": "","rightbordercolornavtypebordercategorycolornameborder": "","rightbordertypenavtypebordercategorycolornameborder": "solid","topbordersizenavtypebordercategorycolornameborder": "","topbordercolornavtypebordercategorycolornameborder": "","topbordertypenavtypebordercategorycolornameborder": "solid","bottombordersizenavtypebordercategorycolornameborder": "1","bottombordercolornavtypebordercategorycolornameborder": "rgba(0, 0, 0, 0.05)","bottombordertypenavtypebordercategorycolornameborder": "solid","colornavtypecolorcategorynavnamefontcolorcsscolorschemanavlia": "rgb(107, 119, 112)","colornavtypecolorcategorynavnamefontcolorhoverselectedcsscolorschemanavlihovera": "rgb(255, 255, 255)","colornavtypecolorcategorynavnamebackgroundcolorhovercssbackgroundcolorschemanavlihovera": "rgb(193, 202, 197)","colornavtypecolorcategorynavnamebackgroundcolorselectedcssbackgroundcolorschemanavlicurrentpageitema": "rgb(68, 187, 204)","fontfamilynavtypegooglefontpickercategoryfontnamefontfamilly": "","fonttypenavtypegooglefontpickercategoryfontnamefontfamilly": "","fontweightnavtypegooglefontpickercategoryfontnamefontfamilly": "","fontstylenavtypegooglefontpickercategoryfontnamefontfamilly": "","colorheaderlogodivtypecolorcategorycolornamebordercolorcssbordertopcolorschemaheaderlogo": "rgb(231, 234, 232)","paddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","leftpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","rightpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","toppaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "166","bottompaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "91","colorh2typecolorcategorycolornamebordercolorcssbordertopcolorschemah2major": "rgb(231, 234, 232)","colorh2typecolorcategoryfontnamefontcolorcsscolor": "","colorh3typecolorcategoryfontnamefontcolorcsscolor": "","colorbannerh2typecolorcategoryfontnamefontcolorcsscolor": "","sliderbannerh2typeslidercategoryfontnamefontsizecssfontsizemin18max100": "45","marginvaluebannerh2typemargincategorypositionnamemargin": "","leftmarginvaluebannerh2typemargincategorypositionnamemargin": "","rightmarginvaluebannerh2typemargincategorypositionnamemargin": "","topmarginvaluebannerh2typemargincategorypositionnamemargin": "","bottommarginvaluebannerh2typemargincategorypositionnamemargin": "","colorbannerbylinetypecolorcategoryfontnamefontcolorcsscolor": "","sliderbannerbylinetypeslidercategoryfontnamefontsizecssfontsizemin18max100": "22","marginvaluebannerbylinetypemargincategorypositionnamemargin": "","leftmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","rightmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","topmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","bottommarginvaluebannerbylinetypemargincategorypositionnamemargin": "","imageorpatternbannertypebackgroundcategorycolornamebackgroundcsscolor": "","colorbannertypebackgroundcategorycolornamebackgroundcsscolor": "rgba(21, 28, 23, 0.95)","imageorpatternbannerwrappertypebackgroundcategorycolornamebackground": "","colorbannerwrappertypebackgroundcategorycolornamebackground": "","paddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","leftpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","rightpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","toppaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "48","bottompaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "55","bordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","leftbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","rightbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","topbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "10","topbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(68, 187, 204)","topbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","bottombordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "10","bottombordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(193, 202, 197)","bottombordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","radiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0","topleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "20","toprightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","bottomleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "","bottomrightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "20","colorbuttontypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttontypecolorcategorycolornamebackgroundcssbackground": "rgb(68, 187, 204)","colorbuttontypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonhover": "rgb(133, 220, 232)","radiusvaluebuttontyperadiuscategorystylingnameradius": "7","topleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","toprightradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomrightradiusvaluebuttontyperadiuscategorystylingnameradius": "","colorbuttonalttypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttonalttypecolorcategorycolornamebackgroundcssbackground": "rgb(193, 202, 197)","colorbuttonalttypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonalthover": "rgb(204, 213, 208)" - } - }, - { - name: "Green safe", - color1: "rgb(193, 202, 197)", - color2: "rgb(240, 240, 240)", - color3: "rgb(0, 153, 0)", - color4: "rgb(0, 51, 0)", - color5: "rgb(51, 51, 51)", - data: - { - "widebodytypewidecategorydimensionnamelayout": "box","imageorpatternbodytypebackgroundcategorycolornamebackground": "","colorbodytypebackgroundcategorycolornamebackground": "rgb(240, 240, 240)","colorbodytypecolorcategoryfontnamefontcolormaincsscolorschemabodyh1h2h3h4h5h6h7navlia": "rgb(85, 85, 85)","colorbodytypecolorcategoryfontnamefontcolorsecondarycsscolorschemaulmetabyline": "rgb(0, 153, 0)","fontfamilybodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "Karma","fonttypebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "google","fontweightbodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "300","fontstylebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "","imageorpatternnavtypebackgroundcategorycolornamebackground": "","colornavtypebackgroundcategorycolornamebackground": "rgb(0, 51, 0)","bordersizenavtypebordercategorycolornameborder": "","bordercolornavtypebordercategorycolornameborder": "","bordertypenavtypebordercategorycolornameborder": "solid","leftbordersizenavtypebordercategorycolornameborder": "","leftbordercolornavtypebordercategorycolornameborder": "","leftbordertypenavtypebordercategorycolornameborder": "solid","rightbordersizenavtypebordercategorycolornameborder": "","rightbordercolornavtypebordercategorycolornameborder": "","rightbordertypenavtypebordercategorycolornameborder": "solid","topbordersizenavtypebordercategorycolornameborder": "","topbordercolornavtypebordercategorycolornameborder": "","topbordertypenavtypebordercategorycolornameborder": "solid","bottombordersizenavtypebordercategorycolornameborder": "1","bottombordercolornavtypebordercategorycolornameborder": "rgba(0, 0, 0, 0.05)","bottombordertypenavtypebordercategorycolornameborder": "solid","colornavtypecolorcategorynavnamefontcolorcsscolorschemanavlia": "rgb(187, 187, 187)","colornavtypecolorcategorynavnamefontcolorhoverselectedcsscolorschemanavlihovera": "rgb(255, 255, 255)","colornavtypecolorcategorynavnamebackgroundcolorhovercssbackgroundcolorschemanavlihovera": "rgb(0, 153, 0)","colornavtypecolorcategorynavnamebackgroundcolorselectedcssbackgroundcolorschemanavlicurrentpageitema": "rgb(0, 153, 0)","fontfamilynavtypegooglefontpickercategoryfontnamefontfamilly": "","fonttypenavtypegooglefontpickercategoryfontnamefontfamilly": "","fontweightnavtypegooglefontpickercategoryfontnamefontfamilly": "","fontstylenavtypegooglefontpickercategoryfontnamefontfamilly": "","colorheaderlogodivtypecolorcategorycolornamebordercolorcssbordertopcolorschemaheaderlogo": "rgb(231, 234, 232)","paddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","leftpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","rightpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "","toppaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "151","bottompaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "57","colorh2typecolorcategorycolornamebordercolorcssbordertopcolorschemah2major": "rgb(231, 234, 232)","colorh2typecolorcategoryfontnamefontcolorcsscolor": "","colorh3typecolorcategoryfontnamefontcolorcsscolor": "","colorbannerh2typecolorcategoryfontnamefontcolorcsscolor": "rgb(0, 153, 0)","sliderbannerh2typeslidercategoryfontnamefontsizecssfontsizemin18max100": "54","marginvaluebannerh2typemargincategorypositionnamemargin": "","leftmarginvaluebannerh2typemargincategorypositionnamemargin": "","rightmarginvaluebannerh2typemargincategorypositionnamemargin": "","topmarginvaluebannerh2typemargincategorypositionnamemargin": "33","bottommarginvaluebannerh2typemargincategorypositionnamemargin": "","colorbannerbylinetypecolorcategoryfontnamefontcolorcsscolor": "rgb(255, 255, 255)","sliderbannerbylinetypeslidercategoryfontnamefontsizecssfontsizemin18max100": "26","marginvaluebannerbylinetypemargincategorypositionnamemargin": "","leftmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","rightmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","topmarginvaluebannerbylinetypemargincategorypositionnamemargin": "","bottommarginvaluebannerbylinetypemargincategorypositionnamemargin": "30","imageorpatternbannertypebackgroundcategorycolornamebackgroundcsscolor": "","colorbannertypebackgroundcategorycolornamebackgroundcsscolor": "rgb(51, 51, 51)","imageorpatternbannerwrappertypebackgroundcategorycolornamebackground": "","colorbannerwrappertypebackgroundcategorycolornamebackground": "rgba(0, 153, 0, 0.15)","paddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","leftpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","rightpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "","toppaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "21","bottompaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "21","bordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","bordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","leftbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","leftbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","rightbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "","rightbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","topbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "1","topbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgba(68, 187, 204, 0)","topbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","bottombordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "10","bottombordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(193, 202, 197)","bottombordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid","radiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "8","topleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0","toprightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0","bottomleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0","bottomrightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0","colorbuttontypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttontypecolorcategorycolornamebackgroundcssbackground": "rgb(0, 51, 0)","colorbuttontypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonhover": "rgba(0, 51, 0, 0.62)","radiusvaluebuttontyperadiuscategorystylingnameradius": "7","topleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","toprightradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomleftradiusvaluebuttontyperadiuscategorystylingnameradius": "","bottomrightradiusvaluebuttontyperadiuscategorystylingnameradius": "","colorbuttonalttypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)","colorbuttonalttypecolorcategorycolornamebackgroundcssbackground": "rgb(193, 202, 197)","colorbuttonalttypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonalthover": "rgb(204, 213, 208)" - } - }, - { - name: "Orange", - color1: "rgb(193, 202, 197)", - color2: "rgb(231, 234, 232)", - color3: "rgb(230, 126, 34)", - color4: "rgb(211, 84, 0)", - color5: "rgb(51, 51, 51)", - data: - { - "widebodytypewidecategorydimensionnamelayout": "wide", "imageorpatternbodytypebackgroundcategorycolornamebackground": "", "colorbodytypebackgroundcategorycolornamebackground": "rgb(240, 240, 240)", "colorbodytypecolorcategoryfontnamefontcolormaincsscolorschemabodyh1h2h3h4h5h6h7navlia": "rgb(85, 85, 85)", "colorbodytypecolorcategoryfontnamefontcolorsecondarycsscolorschemaulmetabyline": "rgb(230, 126, 34)", "fontfamilybodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "Lato", "fonttypebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "google", "fontweightbodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "300", "fontstylebodytypegooglefontpickercategoryfontnamefontfamilycsscolorschemabodyh1h2h3h4h5h6h7bylinenavbutton": "", "imageorpatternnavtypebackgroundcategorycolornamebackground": "", "colornavtypebackgroundcategorycolornamebackground": "rgb(51, 51, 51)", "bordersizenavtypebordercategorycolornameborder": "", "bordercolornavtypebordercategorycolornameborder": "", "bordertypenavtypebordercategorycolornameborder": "solid", "leftbordersizenavtypebordercategorycolornameborder": "", "leftbordercolornavtypebordercategorycolornameborder": "", "leftbordertypenavtypebordercategorycolornameborder": "solid", "rightbordersizenavtypebordercategorycolornameborder": "", "rightbordercolornavtypebordercategorycolornameborder": "", "rightbordertypenavtypebordercategorycolornameborder": "solid", "topbordersizenavtypebordercategorycolornameborder": "", "topbordercolornavtypebordercategorycolornameborder": "", "topbordertypenavtypebordercategorycolornameborder": "solid", "bottombordersizenavtypebordercategorycolornameborder": "1", "bottombordercolornavtypebordercategorycolornameborder": "rgba(0, 0, 0, 0.05)", "bottombordertypenavtypebordercategorycolornameborder": "solid", "colornavtypecolorcategorynavnamefontcolorcsscolorschemanavlia": "rgb(187, 187, 187)", "colornavtypecolorcategorynavnamefontcolorhoverselectedcsscolorschemanavlihovera": "rgb(255, 255, 255)", "colornavtypecolorcategorynavnamebackgroundcolorhovercssbackgroundcolorschemanavlihovera": "rgb(181, 181, 181)", "colornavtypecolorcategorynavnamebackgroundcolorselectedcssbackgroundcolorschemanavlicurrentpageitema": "rgb(211, 84, 0)", "fontfamilynavtypegooglefontpickercategoryfontnamefontfamilly": "", "fonttypenavtypegooglefontpickercategoryfontnamefontfamilly": "", "fontweightnavtypegooglefontpickercategoryfontnamefontfamilly": "", "fontstylenavtypegooglefontpickercategoryfontnamefontfamilly": "", "colorheaderlogodivtypecolorcategorycolornamebordercolorcssbordertopcolorschemaheaderlogo": "rgb(231, 234, 232)", "paddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "", "leftpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "", "rightpaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "", "toppaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "151", "bottompaddingvalueheaderlogodivtypepaddingcategorypositionnamemarginenabletopbottomschemaheader": "57", "colorh2typecolorcategorycolornamebordercolorcssbordertopcolorschemah2major": "rgb(231, 234, 232)", "colorh2typecolorcategoryfontnamefontcolorcsscolor": "", "colorh3typecolorcategoryfontnamefontcolorcsscolor": "", "colorbannerh2typecolorcategoryfontnamefontcolorcsscolor": "", "sliderbannerh2typeslidercategoryfontnamefontsizecssfontsizemin18max100": "54", "marginvaluebannerh2typemargincategorypositionnamemargin": "", "leftmarginvaluebannerh2typemargincategorypositionnamemargin": "", "rightmarginvaluebannerh2typemargincategorypositionnamemargin": "", "topmarginvaluebannerh2typemargincategorypositionnamemargin": "33", "bottommarginvaluebannerh2typemargincategorypositionnamemargin": "", "colorbannerbylinetypecolorcategoryfontnamefontcolorcsscolor": "rgb(225, 225, 225)", "sliderbannerbylinetypeslidercategoryfontnamefontsizecssfontsizemin18max100": "26", "marginvaluebannerbylinetypemargincategorypositionnamemargin": "", "leftmarginvaluebannerbylinetypemargincategorypositionnamemargin": "", "rightmarginvaluebannerbylinetypemargincategorypositionnamemargin": "", "topmarginvaluebannerbylinetypemargincategorypositionnamemargin": "", "bottommarginvaluebannerbylinetypemargincategorypositionnamemargin": "30", "imageorpatternbannertypebackgroundcategorycolornamebackgroundcsscolor": "", "colorbannertypebackgroundcategorycolornamebackgroundcsscolor": "rgb(230, 126, 34)", "imageorpatternbannerwrappertypebackgroundcategorycolornamebackground": "", "colorbannerwrappertypebackgroundcategorycolornamebackground": "rgb(255, 255, 255)", "paddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "", "leftpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "", "rightpaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "", "toppaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "21", "bottompaddingvaluebannerwrappertypepaddingcategorypositionnamepaddingenabletopbottom": "21", "bordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "", "bordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "", "bordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid", "leftbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "", "leftbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "", "leftbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid", "rightbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "", "rightbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "", "rightbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid", "topbordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "1", "topbordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgba(68, 187, 204, 0)", "topbordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid", "bottombordersizemainwrappertypebordercategorystylingnameborderenabletopbottom": "10", "bottombordercolormainwrappertypebordercategorystylingnameborderenabletopbottom": "rgb(193, 202, 197)", "bottombordertypemainwrappertypebordercategorystylingnameborderenabletopbottom": "solid", "radiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "8", "topleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0", "toprightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0", "bottomleftradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0", "bottomrightradiusvalueimageimageimgimagebeforetyperadiuscategorystylingnameradius": "0", "colorbuttontypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)", "colorbuttontypecolorcategorycolornamebackgroundcssbackground": "rgb(230, 126, 34)", "colorbuttontypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonhover": "rgba(230, 126, 34, 0.55)", "radiusvaluebuttontyperadiuscategorystylingnameradius": "7", "topleftradiusvaluebuttontyperadiuscategorystylingnameradius": "", "toprightradiusvaluebuttontyperadiuscategorystylingnameradius": "", "bottomleftradiusvaluebuttontyperadiuscategorystylingnameradius": "", "bottomrightradiusvaluebuttontyperadiuscategorystylingnameradius": "", "colorbuttonalttypecolorcategorycolornamecolorcsscolor": "rgb(255, 255, 255)", "colorbuttonalttypecolorcategorycolornamebackgroundcssbackground": "rgb(193, 202, 197)", "colorbuttonalttypecolorcategorycolornamebackgroundhovercssbackgroundschemabuttonalthover": "rgb(204, 213, 208)" - } - } - -]; \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.js deleted file mode 100644 index 647a1b85ea..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.js +++ /dev/null @@ -1,180 +0,0 @@ - -/*********************************************************************************************************/ -/* Background editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.background", function ($scope, dialogService) { - - if (!$scope.item.values) { - $scope.item.values = { - imageorpattern: '', - color: '' - }; - } - - $scope.open = function (field) { - - var config = { - template: "mediaPickerModal.html", - change: function (data) { - $scope.item.values.imageorpattern = data; - }, - callback: function (data) { - $scope.item.values.imageorpattern = data; - }, - cancel: function (data) { - $scope.item.values.imageorpattern = data; - }, - dialogData: $scope.googleFontFamilies, - dialogItem: $scope.item.values.imageorpattern - }; - - dialogService.open(config); - - }; - -}) - -.controller('canvasdesigner.mediaPickerModal', function ($scope, $http, mediaResource, umbRequestHelper, entityResource, mediaHelper) { - - if (mediaHelper && mediaHelper.registerFileResolver) { - mediaHelper.registerFileResolver("Umbraco.UploadField", function (property, entity, thumbnail) { - if (thumbnail) { - - if (mediaHelper.detectIfImageByExtension(property.value)) { - var thumbnailUrl = umbRequestHelper.getApiUrl( - "imagesApiBaseUrl", - "GetBigThumbnail", - [{ originalImagePath: property.value }]); - - return thumbnailUrl; - } - else { - return null; - } - - } - else { - return property.value; - } - }); - } - - var modalFieldvalue = $scope.dialogItem; - - $scope.currentFolder = {}; - $scope.currentFolder.children = []; - $scope.currentPath = []; - $scope.startNodeId = -1; - - $scope.options = { - url: umbRequestHelper.getApiUrl("mediaApiBaseUrl", "PostAddFile"), - formData: { - currentFolder: $scope.startNodeId - } - }; - - //preload selected item - $scope.selectedMedia = undefined; - - $scope.submitFolder = function (e) { - if (e.keyCode === 13) { - e.preventDefault(); - $scope.$parent.data.showFolderInput = false; - - if ($scope.$parent.data.newFolder && $scope.$parent.data.newFolder != "") { - mediaResource - .addFolder($scope.$parent.data.newFolder, $scope.currentFolder.id) - .then(function (data) { - $scope.$parent.data.newFolder = undefined; - $scope.gotoFolder(data); - }); - } - } - }; - - $scope.gotoFolder = function (folder) { - - if (!folder) { - folder = { id: $scope.startNodeId, name: "Media", icon: "icon-folder" }; - } - - if (folder.id > 0) { - var matches = _.filter($scope.currentPath, function (value, index) { - if (value.id == folder.id) { - value.indexInPath = index; - return value; - } - }); - - if (matches && matches.length > 0) { - $scope.currentPath = $scope.currentPath.slice(0, matches[0].indexInPath + 1); - } - else { - $scope.currentPath.push(folder); - } - } - else { - $scope.currentPath = []; - } - - //mediaResource.rootMedia() - mediaResource.getChildren(folder.id) - .then(function (data) { - folder.children = data.items ? data.items : []; - - angular.forEach(folder.children, function (child) { - child.isFolder = child.contentTypeAlias == "Folder" ? true : false; - if (!child.isFolder) { - angular.forEach(child.properties, function (property) { - if (property.alias == "umbracoFile" && property.value) - { - child.thumbnail = mediaHelper.resolveFile(child, true); - child.image = property.value; - } - }) - } - }); - - $scope.options.formData.currentFolder = folder.id; - $scope.currentFolder = folder; - }); - }; - - $scope.iconFolder = "glyphicons-icon folder-open" - - $scope.selectMedia = function (media) { - - if (!media.isFolder) { - //we have 3 options add to collection (if multi) show details, or submit it right back to the callback - $scope.selectedMedia = media; - modalFieldvalue = "url(" + $scope.selectedMedia.image + ")"; - $scope.change(modalFieldvalue); - } - else { - $scope.gotoFolder(media); - } - - }; - - //default root item - if (!$scope.selectedMedia) { - $scope.gotoFolder(); - } - - $scope.submitAndClose = function () { - if (modalFieldvalue != "") { - $scope.submit(modalFieldvalue); - } else { - $scope.cancel(); - } - - }; - - $scope.cancelAndClose = function () { - $scope.cancel(); - } - -}) diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.less deleted file mode 100644 index 8506229336..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/background.less +++ /dev/null @@ -1,25 +0,0 @@ - -/************************************************************************/ -/* background -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@imageorpattern-ALIAS-:''; -@color-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-gridStyle--ALIAS-***/ --SCHEMA- { - background-image: @imageorpattern-ALIAS- !important; - background-position: center; - background-repeat: no-repeat; - background-attachment: fixed; - -webkit-background-size: cover; - -moz-background-size: cover; - -o-background-size: cover; - background-size: cover; - background:@color-ALIAS- !important; -} -/***end-gridStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.js deleted file mode 100644 index bf64ad3fa0..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.js +++ /dev/null @@ -1,124 +0,0 @@ - -/*********************************************************************************************************/ -/* Background editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.border", function ($scope, dialogService) { - - $scope.defaultBorderList = ["all", "left", "right", "top", "bottom"]; - $scope.borderList = []; - - $scope.bordertypes = ["solid", "dashed", "dotted"]; - $scope.selectedBorder = { - name: "all", - size: 0, - color: '', - type: '' - }; - - $scope.setselectedBorder = function (bordertype) { - - if (bordertype == "all") { - $scope.selectedBorder.name="all"; - $scope.selectedBorder.size= $scope.item.values.bordersize; - $scope.selectedBorder.color= $scope.item.values.bordercolor; - $scope.selectedBorder.type= $scope.item.values.bordertype; - } - - if (bordertype == "left") { - $scope.selectedBorder.name= "left"; - $scope.selectedBorder.size= $scope.item.values.leftbordersize; - $scope.selectedBorder.color= $scope.item.values.leftbordercolor; - $scope.selectedBorder.type= $scope.item.values.leftbordertype; - } - - if (bordertype == "right") { - $scope.selectedBorder.name= "right"; - $scope.selectedBorder.size= $scope.item.values.rightbordersize; - $scope.selectedBorder.color= $scope.item.values.rightbordercolor; - $scope.selectedBorder.type= $scope.item.values.rightbordertype; - } - - if (bordertype == "top") { - $scope.selectedBorder.name= "top"; - $scope.selectedBorder.size= $scope.item.values.topbordersize; - $scope.selectedBorder.color= $scope.item.values.topbordercolor; - $scope.selectedBorder.type= $scope.item.values.topbordertype; - } - - if (bordertype == "bottom") { - $scope.selectedBorder.name= "bottom"; - $scope.selectedBorder.size= $scope.item.values.bottombordersize; - $scope.selectedBorder.color= $scope.item.values.bottombordercolor; - $scope.selectedBorder.type= $scope.item.values.bottombordertype; - } - - } - - if (!$scope.item.values) { - $scope.item.values = { - bordersize: '', - bordercolor: '', - bordertype: 'solid', - leftbordersize: '', - leftbordercolor: '', - leftbordertype: 'solid', - rightbordersize: '', - rightbordercolor: '', - rightbordertype: 'solid', - topbordersize: '', - topbordercolor: '', - topbordertype: 'solid', - bottombordersize: '', - bottombordercolor: '', - bottombordertype: 'solid', - }; - } - - if ($scope.item.enable) { - angular.forEach($scope.defaultBorderList, function (key, indexKey) { - if ($.inArray(key, $scope.item.enable) >= 0) { - $scope.borderList.splice($scope.borderList.length + 1, 0, key); - } - }) - } - else { - $scope.borderList = $scope.defaultBorderList; - } - - $scope.$watch("valueAreLoaded", function () { - $scope.setselectedBorder($scope.borderList[0]); - }, false); - - $scope.$watch("selectedBorder", function () { - - if ($scope.selectedBorder.name == "all") { - $scope.item.values.bordersize = $scope.selectedBorder.size; - $scope.item.values.bordertype = $scope.selectedBorder.type; - } - - if ($scope.selectedBorder.name == "left") { - $scope.item.values.leftbordersize = $scope.selectedBorder.size; - $scope.item.values.leftbordertype = $scope.selectedBorder.type; - } - - if ($scope.selectedBorder.name == "right") { - $scope.item.values.rightbordersize = $scope.selectedBorder.size; - $scope.item.values.rightbordertype = $scope.selectedBorder.type; - } - - if ($scope.selectedBorder.name == "top") { - $scope.item.values.topbordersize = $scope.selectedBorder.size; - $scope.item.values.topbordertype = $scope.selectedBorder.type; - } - - if ($scope.selectedBorder.name == "bottom") { - $scope.item.values.bottombordersize = $scope.selectedBorder.size; - $scope.item.values.bottombordertype = $scope.selectedBorder.type; - } - - }, true) - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.less deleted file mode 100644 index 0901e4e6e6..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/border.less +++ /dev/null @@ -1,70 +0,0 @@ - -/************************************************************************/ -/* border -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@bordersize-ALIAS-:''; -@bordercolor-ALIAS-:''; -@bordertype-ALIAS-:solid; - -@leftbordersize-ALIAS-:''; -@leftbordercolor-ALIAS-:''; -@leftbordertype-ALIAS-:solid; - -@rightbordersize-ALIAS-:''; -@rightbordercolor-ALIAS-:''; -@rightbordertype-ALIAS-:solid; - -@topbordersize-ALIAS-:''; -@topbordercolor-ALIAS-:''; -@topbordertype-ALIAS-:solid; - -@bottombordersize-ALIAS-:''; -@bottombordercolor-ALIAS-:''; -@bottombordertype-ALIAS-:solid; - -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.all-ALIAS- () when (isnumber(@bordersize-ALIAS-)) { - border: @bordersize-ALIAS- + 0px; - border-color:@bordercolor-ALIAS-; - border-style:@bordertype-ALIAS-; -} - -.left-ALIAS- () when (isnumber(@leftbordersize-ALIAS-)) { - border-left: @leftbordersize-ALIAS- + 0px; - border-left-color:@leftbordercolor-ALIAS-; - border-left-style:@leftbordertype-ALIAS-; -} - -.right-ALIAS- () when (isnumber(@rightbordersize-ALIAS-)) { - border-right: @rightbordersize-ALIAS- + 0px; - border-right-color:@rightbordercolor-ALIAS-; - border-right-style:@rightbordertype-ALIAS-; -} - -.top-ALIAS- () when (isnumber(@topbordersize-ALIAS-)) { - border-top: @topbordersize-ALIAS- + 0px; - border-top-color:@topbordercolor-ALIAS-; - border-top-style:@topbordertype-ALIAS-; -} - -.bottom-ALIAS- () when (isnumber(@bottombordersize-ALIAS-)) { - border-bottom: @bottombordersize-ALIAS- + 0px; - border-bottom-color:@bottombordercolor-ALIAS-; - border-bottom-style:@bottombordertype-ALIAS-; -} - --SCHEMA- { - .all-ALIAS-; - .left-ALIAS-; - .right-ALIAS-; - .top-ALIAS-; - .bottom-ALIAS-; -} -/***end-lessStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.js deleted file mode 100644 index 61e6da43dd..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.js +++ /dev/null @@ -1,16 +0,0 @@ - -/*********************************************************************************************************/ -/* color editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.color", function ($scope) { - - if (!$scope.item.values) { - $scope.item.values = { - color: '' - }; - } - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.less deleted file mode 100644 index efa24384a6..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/color.less +++ /dev/null @@ -1,14 +0,0 @@ - -/************************************************************************/ -/* color -ALIAS- -CSS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@color-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ --SCHEMA- { - -CSS-:@color-ALIAS-; -} -/***end-lessStyle--ALIAS-***/ \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.js deleted file mode 100644 index ce6bf2c9f7..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.js +++ /dev/null @@ -1,196 +0,0 @@ - -/*********************************************************************************************************/ -/* google font editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.googlefontpicker", function ($scope, dialogService) { - - if (!$scope.item.values) { - $scope.item.values = { - fontFamily: '', - fontType: '', - fontWeight: '', - fontStyle: '', - } - } - - $scope.setStyleVariant = function () { - if ($scope.item.values != undefined) { - return { - 'font-family': $scope.item.values.fontFamily, - 'font-weight': $scope.item.values.fontWeight, - 'font-style': $scope.item.values.fontStyle - } - } - }; - - $scope.open = function (field) { - - var config = { - template: "googlefontdialog.html", - change: function (data) { - $scope.item.values = data; - }, - callback: function (data) { - $scope.item.values = data; - }, - cancel: function (data) { - $scope.item.values = data; - }, - dialogData: $scope.googleFontFamilies, - dialogItem: $scope.item.values - }; - - dialogService.open(config); - - }; - -}) - -.controller("googlefontdialog.controller", function ($scope) { - - $scope.safeFonts = ["Arial, Helvetica", "Impact", "Lucida Sans Unicode", "Tahoma", "Trebuchet MS", "Verdana", "Georgia", "Times New Roman", "Courier New, Courier"]; - $scope.fonts = []; - $scope.selectedFont = {}; - - var googleGetWeight = function (googleVariant) { - return (googleVariant != undefined && googleVariant != "") ? googleVariant.replace("italic", "") : ""; - }; - - var googleGetStyle = function (googleVariant) { - var variantStyle = ""; - if (googleVariant != undefined && googleVariant != "" && googleVariant.indexOf("italic") >= 0) { - variantWeight = googleVariant.replace("italic", ""); - variantStyle = "italic"; - } - return variantStyle; - }; - - angular.forEach($scope.safeFonts, function (value, key) { - $scope.fonts.push({ - groupName: "Safe fonts", - fontType: "safe", - fontFamily: value, - fontWeight: "normal", - fontStyle: "normal", - }); - }); - - angular.forEach($scope.dialogData.items, function (value, key) { - var variants = value.variants; - var variant = value.variants.length > 0 ? value.variants[0] : ""; - var fontWeight = googleGetWeight(variant); - var fontStyle = googleGetStyle(variant); - $scope.fonts.push({ - groupName: "Google fonts", - fontType: "google", - fontFamily: value.family, - variants: value.variants, - variant: variant, - fontWeight: fontWeight, - fontStyle: fontStyle - }); - }); - - $scope.setStyleVariant = function () { - if ($scope.dialogItem != undefined) { - return { - 'font-family': $scope.selectedFont.fontFamily, - 'font-weight': $scope.selectedFont.fontWeight, - 'font-style': $scope.selectedFont.fontStyle - } - } - }; - - function loadFont(font, variant) { - WebFont.load({ - google: { - families: [font.fontFamily + ":" + variant] - }, - loading: function () { - console.log('loading'); - }, - active: function () { - $scope.selectedFont = font; - $scope.selectedFont.fontWeight = googleGetWeight(variant); - $scope.selectedFont.fontStyle = googleGetStyle(variant); - // If $apply isn't called, the new font family isn't applied until the next user click. - $scope.change({ - fontFamily: $scope.selectedFont.fontFamily, - fontType: $scope.selectedFont.fontType, - fontWeight: $scope.selectedFont.fontWeight, - fontStyle: $scope.selectedFont.fontStyle, - }); - } - }); - } - - var webFontScriptLoaded = false; - $scope.showFontPreview = function (font, variant) { - - if (!variant) - variant = font.variant; - - if (font != undefined && font.fontFamily != "" && font.fontType == "google") { - - // Font needs to be independently loaded in the iframe for live preview to work. - document.getElementById("resultFrame").contentWindow.getFont(font.fontFamily + ":" + variant); - - if (!webFontScriptLoaded) { - $.getScript('https://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js') - .done(function() { - webFontScriptLoaded = true; - loadFont(font, variant); - }) - .fail(function() { - console.log('error loading webfont'); - }); - } - else { - loadFont(font, variant); - } - } - else { - - // Font is available, apply it immediately in modal preview. - $scope.selectedFont = font; - // If $apply isn't called, the new font family isn't applied until the next user click. - $scope.change({ - fontFamily: $scope.selectedFont.fontFamily, - fontType: $scope.selectedFont.fontType, - fontWeight: $scope.selectedFont.fontWeight, - fontStyle: $scope.selectedFont.fontStyle, - }); - } - - - - } - - $scope.cancelAndClose = function () { - $scope.cancel(); - } - - $scope.submitAndClose = function () { - $scope.submit({ - fontFamily: $scope.selectedFont.fontFamily, - fontType: $scope.selectedFont.fontType, - fontWeight: $scope.selectedFont.fontWeight, - fontStyle: $scope.selectedFont.fontStyle, - }); - }; - - if ($scope.dialogItem != undefined) { - angular.forEach($scope.fonts, function (value, key) { - if (value.fontFamily == $scope.dialogItem.fontFamily) { - $scope.selectedFont = value; - $scope.selectedFont.variant = $scope.dialogItem.fontWeight + $scope.dialogItem.fontStyle; - $scope.selectedFont.fontWeight = $scope.dialogItem.fontWeight; - $scope.selectedFont.fontStyle = $scope.dialogItem.fontStyle; - } - }); - } - -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.less deleted file mode 100644 index 5fb99d8c13..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/googlefontpicker.less +++ /dev/null @@ -1,34 +0,0 @@ - -/************************************************************************/ -/* font family -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@fontfamily-ALIAS-:''; -@fontweight-ALIAS-:''; -@fontstyle-ALIAS-:''; -@fonttype-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-fontfamilystyle--ALIAS-***/ - -.fontfamily-ALIAS- () when not (@fontfamily-ALIAS- = '') { - font-family:@fontfamily-ALIAS-; -} - -.fontweight-ALIAS- () when not (@fontweight-ALIAS- = '') { - font-weight:@fontweight-ALIAS-; -} - -.fontstyle-ALIAS- () when not (@fontstyle-ALIAS- = '') { - font-style:@fontstyle-ALIAS-; -} - --SCHEMA- { - .fontfamily-ALIAS-; - .fontweight-ALIAS-; - .fontstyle-ALIAS-; -} -/***end-fontfamilystyle--ALIAS-***/ - - \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.js deleted file mode 100644 index 49da2f76b4..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.js +++ /dev/null @@ -1,16 +0,0 @@ - -/*********************************************************************************************************/ -/* grid row editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.gridRow", function ($scope) { - - if (!$scope.item.values) { - $scope.item.values = { - fullsize: false - }; - } - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.less deleted file mode 100644 index 93a3b6e99f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/gridRow.less +++ /dev/null @@ -1,40 +0,0 @@ - -/************************************************************************/ -/* grid row -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@fullsize-ALIAS-:false; -/***end-lessParam--ALIAS-***/ - -/***start-gridStyle--ALIAS-***/ - -.fullusky-container-ALIAS- () when (@fullsize-ALIAS- = true) { - width:100%; -} - -.fullusky-grid-cell-ALIAS- () when (@fullsize-ALIAS- = true) { - margin-top: 0px; - margin-bottom: 0px; -} - -.fullcolumn-ALIAS- () when (@fullsize-ALIAS- = true) { - padding-right: 0px; - padding-left: 0px; -} - --SCHEMA- .container { - .fullusky-container-ALIAS- -} - --SCHEMA- .usky-grid-cell { - .fullusky-grid-cell-ALIAS- -} - --SCHEMA- .column { - .fullcolumn-ALIAS- -} - -/***end-gridStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.js deleted file mode 100644 index efd553f42b..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.js +++ /dev/null @@ -1,16 +0,0 @@ - -/*********************************************************************************************************/ -/* Layout */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.layout", function ($scope) { - - if (!$scope.item.values) { - $scope.item.values = { - layout: "" - } - } - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.less deleted file mode 100644 index 7cc10da979..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/layout.less +++ /dev/null @@ -1,96 +0,0 @@ - -/************************************************************************/ -/* wide -ALIAS- -CSS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@layout-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.box1200-ALIAS- () when (@layout-ALIAS- = box) { - width: 1140px; -} - -.box992-ALIAS- () when (@layout-ALIAS- = box) { - width: 940px; -} - -.box768-ALIAS- () when (@layout-ALIAS- = box) { - width: 720px; -} - -.boxFull-ALIAS- () when (@layout-ALIAS- = box) { - width: 100%; -} - -.wide1200-ALIAS- () when (@layout-ALIAS- = wide) { - width: 1140px; -} - -.wide992-ALIAS- () when (@layout-ALIAS- = wide) { - width: 940px; -} - -.wide768-ALIAS- () when (@layout-ALIAS- = wide) { - width: 720px; -} - -.wideFull-ALIAS- () when (@layout-ALIAS- = wide) { - width: 100% !important; -} - -.fullFull-ALIAS- () when (@layout-ALIAS- = full) { - width: 100%; -} - -@media (min-width: 768px) { - -SCHEMACONTAINER- { - .wide768-ALIAS-; - .boxFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -@media (min-width: 992px) { - -SCHEMACONTAINER- { - .wide992-ALIAS-; - .boxFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -@media (min-width: 1200px) { - -SCHEMACONTAINER- { - .wide1200-ALIAS-; - .boxFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -@media (min-width: 768px) { - -SCHEMA- { - .box768-ALIAS-; - .wideFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -@media (min-width: 992px) { - -SCHEMA- { - .box992-ALIAS-; - .wideFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -@media (min-width: 1200px) { - -SCHEMA- { - .box1200-ALIAS-; - .wideFull-ALIAS-; - .fullFull-ALIAS-; - } -} - -/***end-lessStyle--ALIAS-***/ \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.js deleted file mode 100644 index 617421f702..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.js +++ /dev/null @@ -1,98 +0,0 @@ - -/*********************************************************************************************************/ -/* margin editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.margin", function ($scope, dialogService) { - - $scope.defaultmarginList = ["all", "left", "right", "top", "bottom"]; - $scope.marginList = []; - - $scope.selectedmargin = { - name: "", - value: 0, - }; - - $scope.setSelectedmargin = function (margintype) { - - if (margintype == "all") { - $scope.selectedmargin.name = "all"; - $scope.selectedmargin.value = $scope.item.values.marginvalue; - } - - if (margintype == "left") { - $scope.selectedmargin.name = "left"; - $scope.selectedmargin.value = $scope.item.values.leftmarginvalue; - } - - if (margintype == "right") { - $scope.selectedmargin.name = "right"; - $scope.selectedmargin.value = $scope.item.values.rightmarginvalue; - } - - if (margintype == "top") { - $scope.selectedmargin.name = "top"; - $scope.selectedmargin.value = $scope.item.values.topmarginvalue; - } - - if (margintype == "bottom") { - $scope.selectedmargin.name = "bottom"; - $scope.selectedmargin.value = $scope.item.values.bottommarginvalue; - } - - } - - if (!$scope.item.values) { - $scope.item.values = { - marginvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 0 ? $scope.item.defaultValue[0] : '', - leftmarginvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 1 ? $scope.item.defaultValue[1] : '', - rightmarginvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 2 ? $scope.item.defaultValue[2] : '', - topmarginvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 3 ? $scope.item.defaultValue[3] : '', - bottommarginvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 4 ? $scope.item.defaultValue[4] : '', - }; - } - - if ($scope.item.enable) { - angular.forEach($scope.defaultmarginList, function (key, indexKey) { - if ($.inArray(key, $scope.item.enable) >= 0) { - $scope.marginList.splice($scope.marginList.length + 1, 0, key); - } - }) - } - else { - $scope.marginList = $scope.defaultmarginList; - } - - $scope.$watch("valueAreLoaded", function () { - $scope.setSelectedmargin($scope.marginList[0]); - }, false); - - $scope.$watch("selectedmargin", function () { - - if ($scope.selectedmargin.name == "all") { - $scope.item.values.marginvalue = $scope.selectedmargin.value; - } - - if ($scope.selectedmargin.name == "left") { - $scope.item.values.leftmarginvalue = $scope.selectedmargin.value; - } - - if ($scope.selectedmargin.name == "right") { - $scope.item.values.rightmarginvalue = $scope.selectedmargin.value; - } - - if ($scope.selectedmargin.name == "top") { - $scope.item.values.topmarginvalue = $scope.selectedmargin.value; - } - - if ($scope.selectedmargin.name == "bottom") { - $scope.item.values.bottommarginvalue = $scope.selectedmargin.value; - } - - }, true) - - - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.less deleted file mode 100644 index 2f1c0de215..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/margin.less +++ /dev/null @@ -1,45 +0,0 @@ - -/************************************************************************/ -/* margin -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@marginvalue-ALIAS-:''; -@leftmarginvalue-ALIAS-:''; -@rightmarginvalue-ALIAS-:''; -@topmarginvalue-ALIAS-:''; -@bottommarginvalue-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.all-ALIAS- () when (isnumber(@marginvalue-ALIAS-)) { - margin: @marginvalue-ALIAS- + 0px; -} - -.left-ALIAS- () when (isnumber(@leftmarginvalue-ALIAS-)) { - margin-left: @leftmarginvalue-ALIAS- + 0px; -} - -.right-ALIAS- () when (isnumber(@rightmarginvalue-ALIAS-)) { - margin-right: @rightmarginvalue-ALIAS- + 0px; -} - -.top-ALIAS- () when (isnumber(@topmarginvalue-ALIAS-)) { - margin-top: @topmarginvalue-ALIAS- + 0px; -} - -.bottom-ALIAS- () when (isnumber(@bottommarginvalue-ALIAS-)) { - margin-bottom: @bottommarginvalue-ALIAS- + 0px; -} - --SCHEMA- { - .all-ALIAS-; - .left-ALIAS-; - .right-ALIAS-; - .top-ALIAS-; - .bottom-ALIAS-; -} -/***end-lessStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.js deleted file mode 100644 index 81690cd7e4..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.js +++ /dev/null @@ -1,98 +0,0 @@ - -/*********************************************************************************************************/ -/* padding editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.padding", function ($scope, dialogService) { - - $scope.defaultPaddingList = ["all", "left", "right", "top", "bottom"]; - $scope.paddingList = []; - - $scope.selectedpadding = { - name: "", - value: 0, - }; - - $scope.setSelectedpadding = function (paddingtype) { - - if (paddingtype == "all") { - $scope.selectedpadding.name="all"; - $scope.selectedpadding.value= $scope.item.values.paddingvalue; - } - - if (paddingtype == "left") { - $scope.selectedpadding.name= "left"; - $scope.selectedpadding.value= $scope.item.values.leftpaddingvalue; - } - - if (paddingtype == "right") { - $scope.selectedpadding.name= "right"; - $scope.selectedpadding.value= $scope.item.values.rightpaddingvalue; - } - - if (paddingtype == "top") { - $scope.selectedpadding.name= "top"; - $scope.selectedpadding.value= $scope.item.values.toppaddingvalue; - } - - if (paddingtype == "bottom") { - $scope.selectedpadding.name= "bottom"; - $scope.selectedpadding.value= $scope.item.values.bottompaddingvalue; - } - - } - - if (!$scope.item.values) { - $scope.item.values = { - paddingvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 0 ? $scope.item.defaultValue[0] : '', - leftpaddingvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 1 ? $scope.item.defaultValue[1] : '', - rightpaddingvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 2 ? $scope.item.defaultValue[2] : '', - toppaddingvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 3 ? $scope.item.defaultValue[3] : '', - bottompaddingvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 4 ? $scope.item.defaultValue[4] : '', - }; - } - - if ($scope.item.enable) { - angular.forEach($scope.defaultPaddingList, function (key, indexKey) { - if ($.inArray(key, $scope.item.enable) >= 0) { - $scope.paddingList.splice($scope.paddingList.length + 1, 0, key); - } - }) - } - else { - $scope.paddingList = $scope.defaultPaddingList; - } - - $scope.$watch("valueAreLoaded", function () { - $scope.setSelectedpadding($scope.paddingList[0]); - }, false); - - $scope.$watch( "selectedpadding", function () { - - if ($scope.selectedpadding.name == "all") { - $scope.item.values.paddingvalue = $scope.selectedpadding.value; - } - - if ($scope.selectedpadding.name == "left") { - $scope.item.values.leftpaddingvalue = $scope.selectedpadding.value; - } - - if ($scope.selectedpadding.name == "right") { - $scope.item.values.rightpaddingvalue = $scope.selectedpadding.value; - } - - if ($scope.selectedpadding.name == "top") { - $scope.item.values.toppaddingvalue = $scope.selectedpadding.value; - } - - if ($scope.selectedpadding.name == "bottom") { - $scope.item.values.bottompaddingvalue = $scope.selectedpadding.value; - } - - }, true) - - - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.less deleted file mode 100644 index 66c5c30f6f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/padding.less +++ /dev/null @@ -1,45 +0,0 @@ - -/************************************************************************/ -/* padding -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@paddingvalue-ALIAS-:''; -@leftpaddingvalue-ALIAS-:''; -@rightpaddingvalue-ALIAS-:''; -@toppaddingvalue-ALIAS-:''; -@bottompaddingvalue-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.all-ALIAS- () when (isnumber(@paddingvalue-ALIAS-)) { - padding: @paddingvalue-ALIAS- + 0px; -} - -.left-ALIAS- () when (isnumber(@leftpaddingvalue-ALIAS-)) { - padding-left: @leftpaddingvalue-ALIAS- + 0px; -} - -.right-ALIAS- () when (isnumber(@rightpaddingvalue-ALIAS-)) { - padding-right: @rightpaddingvalue-ALIAS- + 0px; -} - -.top-ALIAS- () when (isnumber(@toppaddingvalue-ALIAS-)) { - padding-top: @toppaddingvalue-ALIAS- + 0px; -} - -.bottom-ALIAS- () when (isnumber(@bottompaddingvalue-ALIAS-)) { - padding-bottom: @bottompaddingvalue-ALIAS- + 0px; -} - --SCHEMA- { - .all-ALIAS-; - .left-ALIAS-; - .right-ALIAS-; - .top-ALIAS-; - .bottom-ALIAS-; -} -/***end-lessStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.js deleted file mode 100644 index 7305591a83..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.js +++ /dev/null @@ -1,96 +0,0 @@ - -/*********************************************************************************************************/ -/* radius editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.radius", function ($scope, dialogService) { - - $scope.defaultRadiusList = ["all", "topleft", "topright", "bottomleft", "bottomright"]; - $scope.radiusList = []; - - $scope.selectedradius = { - name: "", - value: 0, - }; - - $scope.setSelectedradius = function (radiustype) { - - if (radiustype == "all") { - $scope.selectedradius.name="all"; - $scope.selectedradius.value= $scope.item.values.radiusvalue; - } - - if (radiustype == "topleft") { - $scope.selectedradius.name = "topleft"; - $scope.selectedradius.value = $scope.item.values.topleftradiusvalue; - } - - if (radiustype == "topright") { - $scope.selectedradius.name = "topright"; - $scope.selectedradius.value = $scope.item.values.toprightradiusvalue; - } - - if (radiustype == "bottomleft") { - $scope.selectedradius.name = "bottomleft"; - $scope.selectedradius.value = $scope.item.values.bottomleftradiusvalue; - } - - if (radiustype == "bottomright") { - $scope.selectedradius.name = "bottomright"; - $scope.selectedradius.value = $scope.item.values.bottomrightradiusvalue; - } - - } - - if (!$scope.item.values) { - $scope.item.values = { - radiusvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 0 ? $scope.item.defaultValue[0] : '', - topleftradiusvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 1 ? $scope.item.defaultValue[1] : '', - toprightradiusvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 2 ? $scope.item.defaultValue[2] : '', - bottomleftradiusvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 3 ? $scope.item.defaultValue[3] : '', - bottomrightradiusvalue: $scope.item.defaultValue && $scope.item.defaultValue.length > 4 ? $scope.item.defaultValue[4] : '', - }; - } - - if ($scope.item.enable) { - angular.forEach($scope.defaultRadiusList, function (key, indexKey) { - if ($.inArray(key, $scope.item.enable) >= 0) { - $scope.radiusList.splice($scope.radiusList.length + 1, 0, key); - } - }) - } - else { - $scope.radiusList = $scope.defaultRadiusList; - } - - $scope.$watch("valueAreLoaded", function () { - $scope.setSelectedradius($scope.radiusList[0]); - }, false); - - $scope.$watch( "selectedradius", function () { - - if ($scope.selectedradius.name == "all") { - $scope.item.values.radiusvalue = $scope.selectedradius.value; - } - - if ($scope.selectedradius.name == "topleft") { - $scope.item.values.topleftradiusvalue = $scope.selectedradius.value; - } - - if ($scope.selectedradius.name == "topright") { - $scope.item.values.toprightradiusvalue = $scope.selectedradius.value; - } - - if ($scope.selectedradius.name == "bottomleft") { - $scope.item.values.bottomleftradiusvalue = $scope.selectedradius.value; - } - - if ($scope.selectedradius.name == "bottomright") { - $scope.item.values.bottomrightradiusvalue = $scope.selectedradius.value; - } - - }, true) - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.less deleted file mode 100644 index a4ca1e3e49..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/radius.less +++ /dev/null @@ -1,65 +0,0 @@ - -/************************************************************************/ -/* radius -ALIAS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@radiusvalue-ALIAS-:''; -@topleftradiusvalue-ALIAS-:''; -@toprightradiusvalue-ALIAS-:''; -@bottomleftradiusvalue-ALIAS-:''; -@bottomrightradiusvalue-ALIAS-:''; - - -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.allzero-ALIAS- () when (isnumber(@radiusvalue-ALIAS-)) { - -webkit-border-radius: @radiusvalue-ALIAS- + 0px; - -moz-border-radius: @radiusvalue-ALIAS- + 0px; - border-radius: @radiusvalue-ALIAS- + 0px; -} - -.all-ALIAS- () when (isnumber(@radiusvalue-ALIAS-)) and (@radiusvalue-ALIAS- > 0) { - -webkit-border-radius: @radiusvalue-ALIAS- + 0px; - -moz-border-radius: @radiusvalue-ALIAS- + 0px; - border-radius: @radiusvalue-ALIAS- + 0px; -} - -.topleft-ALIAS- () when (isnumber(@topleftradiusvalue-ALIAS-)) { - -webkit-border-top-left-radius: @topleftradiusvalue-ALIAS- + 0px; - -moz-border-radius-topleft: @topleftradiusvalue-ALIAS- + 0px; - border-top-left-radius: @topleftradiusvalue-ALIAS- + 0px; -} - -.topright-ALIAS- () when (isnumber(@toprightradiusvalue-ALIAS-)) { - -webkit-border-top-right-radius: @toprightradiusvalue-ALIAS- + 0px; - -moz-border-radius-topright: @toprightradiusvalue-ALIAS- + 0px; - border-top-right-radius: @toprightradiusvalue-ALIAS- + 0px; -} - -.bottomleft-ALIAS- () when (isnumber(@bottomleftradiusvalue-ALIAS-)) { - -webkit-border-bottom-left-radius: @bottomleftradiusvalue-ALIAS- + 0px; - -moz-border-radius-bottomleft: @bottomleftradiusvalue-ALIAS- + 0px; - border-bottom-left-radius: @bottomleftradiusvalue-ALIAS- + 0px; -} - -.bottomright-ALIAS- () when (isnumber(@bottomrightradiusvalue-ALIAS-)) { - -webkit-border-bottom-right-radius: @bottomrightradiusvalue-ALIAS- + 0px; - -moz-border-radius-bottomright: @bottomrightradiusvalue-ALIAS- + 0px; - border-bottom-right-radius: @bottomrightradiusvalue-ALIAS- + 0px; -} - - --SCHEMA- { - .allzero-ALIAS-; - .topleft-ALIAS-; - .topright-ALIAS-; - .bottomleft-ALIAS-; - .bottomright-ALIAS-; - .all-ALIAS-; -} -/***end-lessStyle--ALIAS-***/ - - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.js deleted file mode 100644 index fa082db741..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.js +++ /dev/null @@ -1,16 +0,0 @@ - -/*********************************************************************************************************/ -/* shadow editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.shadow", function ($scope) { - - if (!$scope.item.values) { - $scope.item.values = { - shadow: '' - } - } - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.less deleted file mode 100644 index e131911fb3..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/shadow.less +++ /dev/null @@ -1,21 +0,0 @@ - -/************************************************************************/ -/* shadow -ALIAS- -CSS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@shadow-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.valueshadow-ALIAS- () when (isnumber(@shadow-ALIAS-)) { - -webkit-box-shadow: 0 0 @shadow-ALIAS- + 0px rgba(0, 0, 0, 0.5); - -moz-box-shadow: 0 0 @shadow-ALIAS- + 0px rgba(0, 0, 0, 0.5); - box-shadow: 0 0 @shadow-ALIAS- + 0px rgba(0, 0, 0, 0.5); -} - --SCHEMA- { - .valueshadow-ALIAS- -} -/***end-lessStyle--ALIAS-***/ \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.js deleted file mode 100644 index 766f13efb5..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.js +++ /dev/null @@ -1,16 +0,0 @@ - -/*********************************************************************************************************/ -/* slider editor */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner") - -.controller("Umbraco.canvasdesigner.slider", function ($scope) { - - if (!$scope.item.values) { - $scope.item.values = { - slider: '' - } - } - -}) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.less b/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.less deleted file mode 100644 index 664b10574b..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/editors/slider.less +++ /dev/null @@ -1,19 +0,0 @@ - -/************************************************************************/ -/* slider -ALIAS- -CSS- */ -/************************************************************************/ - -/***start-lessParam--ALIAS-***/ -@slider-ALIAS-:''; -/***end-lessParam--ALIAS-***/ - -/***start-lessStyle--ALIAS-***/ - -.valueslider-ALIAS- () when (isnumber(@slider-ALIAS-)) { - -CSS-:@slider-ALIAS- + 0px; -} - --SCHEMA- { - .valueslider-ALIAS- -} -/***end-lessStyle--ALIAS-***/ \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/colorpicker.directive.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/colorpicker.directive.js deleted file mode 100644 index fed5886dff..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/colorpicker.directive.js +++ /dev/null @@ -1,69 +0,0 @@ - -/*********************************************************************************************************/ -/* spectrum color picker directive */ -/*********************************************************************************************************/ - -angular.module('colorpicker', ['spectrumcolorpicker']) - .directive('colorpicker', ['dialogService', function (dialogService) { - return { - restrict: 'EA', - scope: { - ngModel: '=' - }, - link: function (scope, $element) { - - scope.openColorDialog = function () { - var config = { - template: "colorModal.html", - change: function (data) { - scope.ngModel = data; - }, - callback: function (data) { - scope.ngModel = data; - }, - cancel: function (data) { - scope.ngModel = data; - }, - dialogItem: scope.ngModel, - scope: scope - }; - - dialogService.open(config); - } - - scope.setColor = false; - - scope.submitAndClose = function () { - if (scope.ngModel != "") { - scope.setColor = true; - scope.submit(scope.ngModel); - } else { - scope.cancel(); - } - - }; - - scope.cancelAndClose = function () { - scope.cancel(); - } - - }, - template: - '
' + - '
' + - '' + - '
', - replace: true - }; - }]) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/dialog.service.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/dialog.service.js deleted file mode 100644 index c362dd50dc..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/dialog.service.js +++ /dev/null @@ -1,115 +0,0 @@ - -/*********************************************************************************************************/ -/* jQuery UI Slider plugin wrapper */ -/*********************************************************************************************************/ - -angular.module("Umbraco.canvasdesigner").factory('dialogService', function ($rootScope, $q, $http, $timeout, $compile, $templateCache) { - - function closeDialog(dialog, destroyScope) { - if (dialog.element) { - dialog.element.removeClass("selected"); - dialog.element.html(""); - - if (destroyScope) { - dialog.scope.$destroy(); - } - } - } - - function open() { - } - - return { - - open: function (options) { - - var defaults = { - template: "", - callback: undefined, - change: undefined, - cancel: undefined, - element: undefined, - dialogItem: undefined, - dialogData: undefined - }; - - var dialog = angular.extend(defaults, options); - var destroyScope = true; - - if (options && options.scope) { - destroyScope = false; - } - var scope = (options && options.scope) || $rootScope.$new(); - - // Save original value for cancel action - var originalDialogItem = angular.copy(dialog.dialogItem); - - dialog.element = $(".float-panel"); - - - /************************************/ - // Close dialog if the user clicks outside the dialog. (Not working well with colorpickers and datepickers) - $(document).mousedown(function (e) { - var container = dialog.element; - if (!container.is(e.target) && container.has(e.target).length === 0) { - closeDialog(dialog, destroyScope); - } - }); - /************************************/ - - - $q.when($templateCache.get(dialog.template) || $http.get(dialog.template, { cache: true }).then(function (res) { return res.data; })) - .then(function onSuccess(template) { - - dialog.element.html(template); - - $timeout(function () { - $compile(dialog.element)(scope); - }); - - dialog.element.addClass("selected") - - scope.cancel = function () { - if (dialog.cancel) { - dialog.cancel(originalDialogItem); - } - closeDialog(dialog, destroyScope); - } - - scope.change = function (data) { - if (dialog.change) { - dialog.change(data); - } - } - - scope.submit = function (data) { - if (dialog.callback) { - dialog.callback(data); - } - closeDialog(dialog, destroyScope); - }; - - scope.close = function () { - closeDialog(dialog, destroyScope); - } - - scope.dialogData = dialog.dialogData; - scope.dialogItem = dialog.dialogItem; - - dialog.scope = scope; - - }); - - return dialog; - - }, - - close: function() { - var modal = $(".float-panel"); - modal.removeClass("selected") - } - - } - - -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/slider.directive.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/slider.directive.js deleted file mode 100644 index 941adeb542..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/slider.directive.js +++ /dev/null @@ -1,156 +0,0 @@ - -/*********************************************************************************************************/ -/* jQuery UI Slider plugin wrapper */ -/*********************************************************************************************************/ - -angular.module('ui.slider', []).value('uiSliderConfig', {}).directive('uiSlider', ['uiSliderConfig', '$timeout', function (uiSliderConfig, $timeout) { - uiSliderConfig = uiSliderConfig || {}; - return { - require: 'ngModel', - template: '
', - replace: true, - compile: function () { - return function (scope, elm, attrs, ngModel) { - - scope.value = ngModel.$viewValue; - - function parseNumber(n, decimals) { - return (decimals) ? parseFloat(n) : parseInt(n); - }; - - var options = angular.extend(scope.$eval(attrs.uiSlider) || {}, uiSliderConfig); - // Object holding range values - var prevRangeValues = { - min: null, - max: null - }; - - // convenience properties - var properties = ['min', 'max', 'step']; - var useDecimals = (!angular.isUndefined(attrs.useDecimals)) ? true : false; - - var init = function () { - // When ngModel is assigned an array of values then range is expected to be true. - // Warn user and change range to true else an error occurs when trying to drag handle - if (angular.isArray(ngModel.$viewValue) && options.range !== true) { - console.warn('Change your range option of ui-slider. When assigning ngModel an array of values then the range option should be set to true.'); - options.range = true; - } - - // Ensure the convenience properties are passed as options if they're defined - // This avoids init ordering issues where the slider's initial state (eg handle - // position) is calculated using widget defaults - // Note the properties take precedence over any duplicates in options - angular.forEach(properties, function (property) { - if (angular.isDefined(attrs[property])) { - options[property] = parseNumber(attrs[property], useDecimals); - } - }); - - elm.find(".slider").slider(options); - init = angular.noop; - }; - - // Find out if decimals are to be used for slider - angular.forEach(properties, function (property) { - // support {{}} and watch for updates - attrs.$observe(property, function (newVal) { - if (!!newVal) { - init(); - elm.find(".slider").slider('option', property, parseNumber(newVal, useDecimals)); - } - }); - }); - attrs.$observe('disabled', function (newVal) { - init(); - elm.find(".slider").slider('option', 'disabled', !!newVal); - }); - - // Watch ui-slider (byVal) for changes and update - scope.$watch(attrs.uiSlider, function (newVal) { - init(); - if (newVal != undefined) { - elm.find(".slider").slider('option', newVal); - elm.find(".ui-slider-handle").html("" + ui.value + "px") - } - }, true); - - // Late-bind to prevent compiler clobbering - $timeout(init, 0, true); - - // Update model value from slider - elm.find(".slider").bind('slidestop', function (event, ui) { - ngModel.$setViewValue(ui.values || ui.value); - scope.$apply(); - }); - - elm.bind('slide', function (event, ui) { - event.stopPropagation(); - elm.find(".slider-input").val(ui.value); - elm.find(".ui-slider-handle").html("" + ui.value + "px") - }); - - // Update slider from model value - ngModel.$render = function () { - init(); - var method = options.range === true ? 'values' : 'value'; - - if (isNaN(ngModel.$viewValue) && !(ngModel.$viewValue instanceof Array)) - ngModel.$viewValue = 0; - - if (ngModel.$viewValue == '') - ngModel.$viewValue = 0; - - scope.value = ngModel.$viewValue; - - // Do some sanity check of range values - if (options.range === true) { - - // Check outer bounds for min and max values - if (angular.isDefined(options.min) && options.min > ngModel.$viewValue[0]) { - ngModel.$viewValue[0] = options.min; - } - if (angular.isDefined(options.max) && options.max < ngModel.$viewValue[1]) { - ngModel.$viewValue[1] = options.max; - } - - // Check min and max range values - if (ngModel.$viewValue[0] >= ngModel.$viewValue[1]) { - // Min value should be less to equal to max value - if (prevRangeValues.min >= ngModel.$viewValue[1]) - ngModel.$viewValue[0] = prevRangeValues.min; - // Max value should be less to equal to min value - if (prevRangeValues.max <= ngModel.$viewValue[0]) - ngModel.$viewValue[1] = prevRangeValues.max; - } - - - - // Store values for later user - prevRangeValues.min = ngModel.$viewValue[0]; - prevRangeValues.max = ngModel.$viewValue[1]; - - } - elm.find(".slider").slider(method, ngModel.$viewValue); - elm.find(".ui-slider-handle").html("" + ngModel.$viewValue + "px") - }; - - scope.$watch("value", function () { - ngModel.$setViewValue(scope.value); - }, true); - - scope.$watch(attrs.ngModel, function () { - if (options.range === true) { - ngModel.$render(); - } - }, true); - - function destroy() { - elm.find(".slider").slider('destroy'); - } - elm.find(".slider").bind('$destroy', destroy); - }; - } - }; -}]); - diff --git a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/spectrum.directive.js b/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/spectrum.directive.js deleted file mode 100644 index 214190a9b9..0000000000 --- a/src/Umbraco.Web.UI.Client/src/canvasdesigner/lib/spectrum.directive.js +++ /dev/null @@ -1,66 +0,0 @@ - -/*********************************************************************************************************/ -/* spectrum color picker directive */ -/*********************************************************************************************************/ - -angular.module('spectrumcolorpicker', []) - .directive('spectrum', function () { - return { - restrict: 'E', - transclude: true, - scope: { - colorselected: '=', - setColor: '=', - flat: '=', - showPalette: '=' - }, - link: function (scope, $element) { - - var initColor; - - $element.find("input").spectrum({ - color: scope.colorselected, - allowEmpty: true, - preferredFormat: "hex", - showAlpha: true, - showInput: true, - flat: scope.flat, - localStorageKey: "spectrum.panel", - showPalette: scope.showPalette, - palette: [], - change: function (color) { - - if (color) { - scope.colorselected = color.toRgbString(); - } - else { - scope.colorselected = ''; - } - scope.$apply(); - }, - move: function (color) { - scope.colorselected = color.toRgbString(); - scope.$apply(); - }, - beforeShow: function (color) { - initColor = angular.copy(scope.colorselected); - $(this).spectrum("container").find(".sp-cancel").click(function (e) { - scope.colorselected = initColor; - scope.$apply(); - }); - }, - - }); - - scope.$watch('setcolor', function (setColor) { - if (scope.$eval(setColor) === true) { - $element.find("input").spectrum("set", scope.colorselected); - } - }, true); - - }, - template: - '
', - replace: true - }; - }) \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js index 292f0cc786..bce81c1ffd 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/buttons/umbbuttongroup.directive.js @@ -103,7 +103,10 @@ Use this directive to render a button with a dropdown of alternative actions. subButtons: "=", state: "=?", direction: "@?", - float: "@?" + float: "@?", + buttonStyle: "@?", + size: "@?", + icon: "@?" } }; diff --git a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js index 94781a6529..726f23c45d 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/navigation.service.js @@ -280,7 +280,7 @@ function navigationService($rootScope, $route, $routeParams, $log, $location, $q * @param {Event} event the click event triggering the method, passed from the DOM element */ showMenu: function(args) { - + var deferred = $q.defer(); var self = this; @@ -410,37 +410,7 @@ function navigationService($rootScope, $route, $routeParams, $log, $location, $q }); } }, - - /** - * @ngdoc method - * @name umbraco.services.navigationService#showUserDialog - * @methodOf umbraco.services.navigationService - * - * @description - * Opens the user dialog, next to the sections navigation - * template is located in views/common/dialogs/user.html - */ - showUserDialog: function () { - // hide tray and close help dialog - if (service.helpDialog) { - service.helpDialog.close(); - } - service.hideTray(); - - if (service.userDialog) { - service.userDialog.close(); - service.userDialog = undefined; - } - - service.userDialog = dialogService.open( - { - template: "views/common/dialogs/user.html", - modalClass: "umb-modal-left", - show: true - }); - - return service.userDialog; - }, + /** * @ngdoc method diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index 311f8fe666..7acb286ac9 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -142,7 +142,6 @@ @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"; diff --git a/src/Umbraco.Web.UI.Client/src/less/buttons.less b/src/Umbraco.Web.UI.Client/src/less/buttons.less index 1eaf285119..6a402c7946 100644 --- a/src/Umbraco.Web.UI.Client/src/less/buttons.less +++ b/src/Umbraco.Web.UI.Client/src/less/buttons.less @@ -68,6 +68,7 @@ .btn-group .btn.dropdown-toggle { border-left-width: 1px; border-left-style: solid; + border-color: rgba(0,0,0,0.09); } // Button Sizes diff --git a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less index 9762eaf058..388d3587c1 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button-group.less @@ -17,31 +17,7 @@ .umb-button-group__toggle { border-radius: 0px 3px 3px 0; - } - -} - -// hack for umb-era-button -.umb-era-button-group { - - display: flex; - - .umb-era-button:first-child { - padding-right: 15px; - border-radius: 3px 0 0 3px; - } - - .umb-era-button.umb-button-group__toggle { - padding-right: 10px; - padding-left: 10px; - border-radius: 0 3px 3px 0; - border-left-style: solid; - border-left-width: 1px; - border-left-color: rgba(0,0,0,0.1); - } - - .umb-era-button.umb-button-group__toggle .caret { - margin: 0; + border-left: 1px solid rgba(0,0,0,0.09); } } diff --git a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button.less b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button.less index ab8b6b0671..4b670ab781 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-button.less @@ -7,10 +7,9 @@ outline: none; } - .umb-button__button { +.umb-button__button { position: relative; - z-index: 1; - } +} .umb-button__content { opacity: 1; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-era-button.less b/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-era-button.less deleted file mode 100644 index 138383ce32..0000000000 --- a/src/Umbraco.Web.UI.Client/src/less/components/buttons/umb-era-button.less +++ /dev/null @@ -1,113 +0,0 @@ -.umb-era-button { - display: flex; - justify-content: center; - align-items: center; - font-size: 14px; - height: 38px; - line-height: 1; - max-width: 100%; - padding: 0 18px; - color: #202129; - background-color: #edeeee; - text-decoration: none !important; - user-select: none; - white-space: nowrap; - overflow: hidden; - border-radius: 3px; - border: 0 none; - box-sizing: border-box; - cursor: pointer; - transition: background-color 80ms ease, color 80ms ease; - font-weight: bold; -} - - -.umb-era-button:hover, -.umb-era-button:active { - color: #484848; - background-color: #e1e2e2; - outline: none; - text-decoration: none; -} - - -.umb-era-button:focus { - outline: none; -} - -.umb-era-button.-blue { - background: @blue; - color: white; -} - -.umb-era-button.-blue:hover { - background-color: @blueDark; -} - -.umb-era-button.-red { - background: @btnDangerBackground; - color: white; -} - -.umb-era-button.-red:hover { - background-color: darken(@btnDangerBackground, 5%); -} - -.umb-era-button.-green { - background: @green; - color: @white; -} - -.umb-era-button.-green:hover { - background-color: @green-d1; -} - -.umb-era-button.-link { - padding: 0; - background: transparent; -} - -.umb-era-button.-link:hover { - background-color: transparent; - opacity: .6; -} - -.umb-era-button.-inactive { - cursor: not-allowed; - color: #BBB; - background: #EAE7E7; -} - -.umb-era-button.-inactive:hover { - color: #BBB; - background: #EAE7E7; -} - - -.umb-era-button.-full-width { - display: block; - width: 100%; -} - -.umb-era-button.umb-button--s { - height: 30px; - font-size: 13px; -} - -.umb-era-button.-white { - background-color: @white; - - &:hover { - opacity: .9; - } -} - -.umb-era-button.-text-black { - color: @black; -} - -/* icons */ - -.umb-era-button i { - margin-right: 5px; -} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js deleted file mode 100644 index 5e5363ae6c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.controller.js +++ /dev/null @@ -1,25 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.ApprovedColorPickerController", function ($scope, $http, umbPropEditorHelper, assetsService) { - assetsService.loadJs("lib/cssparser/cssparser.js", $scope) - .then(function () { - - var cssPath = $scope.dialogData.cssPath; - $scope.cssClass = $scope.dialogData.cssClass; - - $scope.classes = []; - - $scope.change = function (newClass) { - $scope.model.value = newClass; - } - - $http.get(cssPath) - .success(function (data) { - var parser = new CSSParser(); - $scope.classes = parser.parse(data, false, false).cssRules; - $scope.classes.splice(0, 0, "noclass"); - }) - - assetsService.loadCss("/App_Plugins/Lecoati.uSky.Grid/lib/uSky.Grid.ApprovedColorPicker.css", $scope); - assetsService.loadCss(cssPath, $scope); - }); -}); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html deleted file mode 100644 index 91b53f4d78..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/approvedcolorpicker.html +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
-
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js deleted file mode 100644 index e33c37ab05..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.controller.js +++ /dev/null @@ -1,50 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.HelpController", function ($scope, $location, $routeParams, helpService, userService, localizationService) { - $scope.section = $routeParams.section; - $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion; - - if(!$scope.section){ - $scope.section = "content"; - } - - $scope.sectionName = $scope.section; - - var rq = {}; - rq.section = $scope.section; - - //translate section name - localizationService.localize("sections_" + rq.section).then(function (value) { - $scope.sectionName = value; - }); - - userService.getCurrentUser().then(function(user){ - - rq.lang = user.locale; - - if($routeParams.url){ - rq.path = decodeURIComponent($routeParams.url); - - if(rq.path.indexOf(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath) === 0){ - rq.path = rq.path.substring(Umbraco.Sys.ServerVariables.umbracoSettings.umbracoPath.length); - } - - if(rq.path.indexOf(".aspx") > 0){ - rq.path = rq.path.substring(0, rq.path.indexOf(".aspx")); - } - - }else{ - rq.path = rq.section + "/" + $routeParams.tree + "/" + $routeParams.method; - } - - helpService.findHelp(rq).then(function(topics){ - $scope.topics = topics; - }); - - helpService.findVideos(rq).then(function(videos){ - $scope.videos = videos; - }); - - }); - - - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html deleted file mode 100644 index b9428fb242..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/help.html +++ /dev/null @@ -1,58 +0,0 @@ -
-
-

Help

- Umbraco version {{version}} -
- -
-
-
-
Help topics for: {{sectionName}}
- - - -
- -
-
Video chapters for: {{sectionName}}
- - - - -
-
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js deleted file mode 100644 index 7f7eed8e4c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.controller.js +++ /dev/null @@ -1,19 +0,0 @@ -//used for the icon picker dialog -angular.module("umbraco") - .controller("Umbraco.Dialogs.IconPickerController", - function ($scope, iconHelper) { - - iconHelper.getIcons().then(function(icons){ - $scope.icons = icons; - }); - - $scope.submitClass = function(icon){ - if($scope.color) { - $scope.submit(icon + " " + $scope.color); - } - else { - $scope.submit(icon); - } - }; - } - ); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html deleted file mode 100644 index f21fdf0b06..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/iconpicker.html +++ /dev/null @@ -1,57 +0,0 @@ -
-
-
- -
-
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js deleted file mode 100644 index dbb86e87ec..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.controller.js +++ /dev/null @@ -1,169 +0,0 @@ -/** - * @ngdoc controller - * @name Umbraco.Dialogs.InsertMacroController - * @function - * - * @description - * The controller for the custom insert macro dialog. Until we upgrade the template editor to be angular this - * is actually loaded into an iframe with full html. - */ -function InsertMacroController($scope, entityResource, macroResource, umbPropEditorHelper, macroService, formHelper) { - - /** changes the view to edit the params of the selected macro */ - function editParams() { - //get the macro params if there are any - macroResource.getMacroParameters($scope.selectedMacro.id) - .then(function (data) { - - //go to next page if there are params otherwise we can just exit - if (!angular.isArray(data) || data.length === 0) { - //we can just exist! - submitForm(); - - } else { - $scope.wizardStep = "paramSelect"; - $scope.macroParams = data; - - //fill in the data if we are editing this macro - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroParamsDictionary) { - _.each($scope.dialogData.macroData.macroParamsDictionary, function (val, key) { - var prop = _.find($scope.macroParams, function (item) { - return item.alias == key; - }); - if (prop) { - - if (_.isString(val)) { - //we need to unescape values as they have most likely been escaped while inserted - val = _.unescape(val); - - //detect if it is a json string - if (val.detectIsJson()) { - try { - //Parse it to json - prop.value = angular.fromJson(val); - } - catch (e) { - // not json - prop.value = val; - } - } - else { - prop.value = val; - } - } - else { - prop.value = val; - } - } - }); - - } - } - }); - } - - /** submit the filled out macro params */ - function submitForm() { - - //collect the value data, close the dialog and send the data back to the caller - - //create a dictionary for the macro params - var paramDictionary = {}; - _.each($scope.macroParams, function (item) { - - var val = item.value; - - if (item.value != null && item.value != undefined && !_.isString(item.value)) { - try { - val = angular.toJson(val); - } - catch (e) { - // not json - } - } - - //each value needs to be xml escaped!! since the value get's stored as an xml attribute - paramDictionary[item.alias] = _.escape(val); - - }); - - //need to find the macro alias for the selected id - var macroAlias = $scope.selectedMacro.alias; - - //get the syntax based on the rendering engine - var syntax; - if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "WebForms") { - syntax = macroService.generateWebFormsSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - else if ($scope.dialogData.renderingEngine && $scope.dialogData.renderingEngine === "Mvc") { - syntax = macroService.generateMvcSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - else { - syntax = macroService.generateMacroSyntax({ macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - - $scope.submit({ syntax: syntax, macroAlias: macroAlias, macroParamsDictionary: paramDictionary }); - } - - $scope.macros = []; - $scope.selectedMacro = null; - $scope.wizardStep = "macroSelect"; - $scope.macroParams = []; - - $scope.submitForm = function () { - - if (formHelper.submitForm({ scope: $scope })) { - - formHelper.resetForm({ scope: $scope }); - - if ($scope.wizardStep === "macroSelect") { - editParams(); - } - else { - submitForm(); - } - - } - }; - - //here we check to see if we've been passed a selected macro and if so we'll set the - //editor to start with parameter editing - if ($scope.dialogData && $scope.dialogData.macroData) { - $scope.wizardStep = "paramSelect"; - } - - //get the macro list - pass in a filter if it is only for rte - entityResource.getAll("Macro", ($scope.dialogData && $scope.dialogData.richTextEditor && $scope.dialogData.richTextEditor === true) ? "UseInEditor=true" : null) - .then(function (data) { - - //if 'allowedMacros' is specified, we need to filter - if (angular.isArray($scope.dialogData.allowedMacros) && $scope.dialogData.allowedMacros.length > 0) { - $scope.macros = _.filter(data, function(d) { - return _.contains($scope.dialogData.allowedMacros, d.alias); - }); - } - else { - $scope.macros = data; - } - - - //check if there's a pre-selected macro and if it exists - if ($scope.dialogData && $scope.dialogData.macroData && $scope.dialogData.macroData.macroAlias) { - var found = _.find(data, function (item) { - return item.alias === $scope.dialogData.macroData.macroAlias; - }); - if (found) { - //select the macro and go to next screen - $scope.selectedMacro = found; - editParams(); - return; - } - } - //we don't have a pre-selected macro so ensure the correct step is set - $scope.wizardStep = "macroSelect"; - }); - - -} - -angular.module("umbraco").controller("Umbraco.Dialogs.InsertMacroController", InsertMacroController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html deleted file mode 100644 index 065683b211..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/insertmacro.html +++ /dev/null @@ -1,50 +0,0 @@ -
-
- - - -
- - - - - - - -
- -
{{$parent.$parent.selectedMacro.name}}
- -
    -
  • - - - - - - - -
  • -
- -
- -
- -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js deleted file mode 100644 index 81b86fc969..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.controller.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @ngdoc controller - * @name Umbraco.Dialogs.LegacyDeleteController - * @function - * - * @description - * The controller for deleting content - */ -function LegacyDeleteController($scope, legacyResource, treeService, navigationService) { - - $scope.performDelete = function() { - - //mark it for deletion (used in the UI) - $scope.currentNode.loading = true; - - legacyResource.deleteItem({ - nodeId: $scope.currentNode.id, - nodeType: $scope.currentNode.nodeType, - alias: $scope.currentNode.name, - }).then(function () { - $scope.currentNode.loading = false; - //TODO: Need to sync tree, etc... - treeService.removeNode($scope.currentNode); - navigationService.hideMenu(); - }); - - }; - - $scope.cancel = function() { - navigationService.hideDialog(); - }; -} - -angular.module("umbraco").controller("Umbraco.Dialogs.LegacyDeleteController", LegacyDeleteController); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html deleted file mode 100644 index e6c757ef1e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/legacydelete.html +++ /dev/null @@ -1,14 +0,0 @@ -
-
- -
-

- Are you sure you want to delete {{currentNode.name}} ? -

- - - - -
-
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js deleted file mode 100644 index 5055f088c7..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.controller.js +++ /dev/null @@ -1,147 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.LinkPickerController", - function ($scope, eventsService, dialogService, entityResource, contentResource, mediaHelper, userService, localizationService) { - var dialogOptions = $scope.dialogOptions; - - var searchText = "Search..."; - localizationService.localize("general_search").then(function (value) { - searchText = value + "..."; - }); - - $scope.dialogTreeApi = {}; - $scope.target = {}; - $scope.searchInfo = { - searchFromId: null, - searchFromName: null, - showSearch: false, - results: [], - selectedSearchResults: [] - } - - if (dialogOptions.currentTarget) { - $scope.target = dialogOptions.currentTarget; - - //if we have a node ID, we fetch the current node to build the form data - if ($scope.target.id || $scope.target.udi) { - - var id = $scope.target.udi ? $scope.target.udi : $scope.target.id; - - if (!$scope.target.path) { - entityResource.getPath(id, "Document").then(function (path) { - $scope.target.path = path; - //now sync the tree to this path - $scope.dialogTreeApi.syncTree({ path: $scope.target.path, tree: "content" }); - }); - } - - contentResource.getNiceUrl(id).then(function (url) { - $scope.target.url = url; - }); - } - } - - function nodeSelectHandler(args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - if (args.node.metaData.listViewNode) { - //check if list view 'search' node was selected - - $scope.searchInfo.showSearch = true; - $scope.searchInfo.searchFromId = args.node.metaData.listViewNode.id; - $scope.searchInfo.searchFromName = args.node.metaData.listViewNode.name; - } - else { - eventsService.emit("dialogs.linkPicker.select", args); - - if ($scope.currentNode) { - //un-select if there's a current one selected - $scope.currentNode.selected = false; - } - - $scope.currentNode = args.node; - $scope.currentNode.selected = true; - $scope.target.id = args.node.id; - $scope.target.udi = args.node.udi; - $scope.target.name = args.node.name; - - if (args.node.id < 0) { - $scope.target.url = "/"; - } - else { - contentResource.getNiceUrl(args.node.id).then(function (url) { - $scope.target.url = url; - }); - } - - if (!angular.isUndefined($scope.target.isMedia)) { - delete $scope.target.isMedia; - } - } - } - - function nodeExpandedHandler(args) { - if (angular.isArray(args.children)) { - - //iterate children - _.each(args.children, function (child) { - //check if any of the items are list views, if so we need to add a custom - // child: A node to activate the search - if (child.metaData.isContainer) { - child.hasChildren = true; - child.children = [ - { - level: child.level + 1, - hasChildren: false, - name: searchText, - metaData: { - listViewNode: child, - }, - cssClass: "icon umb-tree-icon sprTree icon-search", - cssClasses: ["not-published"] - } - ]; - } - }); - } - } - - $scope.switchToMediaPicker = function () { - userService.getCurrentUser().then(function (userData) { - dialogService.mediaPicker({ - startNodeId: userData.startMediaIds.length == 0 ? -1 : userData.startMediaIds[0], - callback: function(media) { - $scope.target.id = media.id; - $scope.target.isMedia = true; - $scope.target.name = media.name; - $scope.target.url = mediaHelper.resolveFile(media); - } - }); - }); - }; - - $scope.hideSearch = function () { - $scope.searchInfo.showSearch = false; - $scope.searchInfo.searchFromId = null; - $scope.searchInfo.searchFromName = null; - $scope.searchInfo.results = []; - } - - // method to select a search result - $scope.selectResult = function (evt, result) { - result.selected = result.selected === true ? false : true; - nodeSelectHandler(evt, {event: evt, node: result}); - }; - - //callback when there are search results - $scope.onSearchResults = function (results) { - $scope.searchInfo.results = results; - $scope.searchInfo.showSearch = true; - }; - - $scope.onTreeInit = function () { - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - $scope.dialogTreeApi.callbacks.treeNodeExpanded(nodeExpandedHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html deleted file mode 100644 index 222ce85243..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/linkpicker.html +++ /dev/null @@ -1,75 +0,0 @@ -
- - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js deleted file mode 100644 index 5b66ac3bab..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.controller.js +++ /dev/null @@ -1,14 +0,0 @@ -//used for the macro picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.MacroPickerController", function ($scope, macroFactory, umbPropEditorHelper) { - $scope.macros = macroFactory.all(true); - $scope.dialogMode = "list"; - - $scope.configureMacro = function(macro){ - $scope.dialogMode = "configure"; - $scope.dialogData.macro = macroFactory.getMacro(macro.alias); - //set the correct view for each item - for (var i = 0; i < dialogData.macro.properties.length; i++) { - dialogData.macro.properties[i].editorView = umbPropEditorHelper.getViewPath(dialogData.macro.properties[i].view); - } - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html deleted file mode 100644 index 87fa0e7fe8..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/macropicker.html +++ /dev/null @@ -1,38 +0,0 @@ -
- - - - -
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js deleted file mode 100644 index f337dbce18..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.controller.js +++ /dev/null @@ -1,134 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco") - .controller("Umbraco.Dialogs.MediaPickerController", - function($scope, mediaResource, umbRequestHelper, entityResource, $log, mediaHelper, mediaTypeHelper, eventsService, treeService) { - - var dialogOptions = $scope.dialogOptions; - - $scope.onlyImages = dialogOptions.onlyImages; - $scope.showDetails = dialogOptions.showDetails; - $scope.multiPicker = (dialogOptions.multiPicker && dialogOptions.multiPicker !== "0") ? true : false; - $scope.startNodeId = dialogOptions.startNodeId ? dialogOptions.startNodeId : -1; - $scope.cropSize = dialogOptions.cropSize; - - //preload selected item - $scope.target = undefined; - if (dialogOptions.currentTarget) { - $scope.target = dialogOptions.currentTarget; - } - - $scope.acceptedMediatypes = []; - mediaTypeHelper.getAllowedImagetypes($scope.startNodeId) - .then(function(types) { - $scope.acceptedMediatypes = types; - }); - - $scope.upload = function(v) { - angular.element(".umb-file-dropzone-directive .file-select").click(); - }; - - $scope.dragLeave = function(el, event) { - $scope.activeDrag = false; - }; - - $scope.dragEnter = function(el, event) { - $scope.activeDrag = true; - }; - - $scope.submitFolder = function(e) { - if (e.keyCode === 13) { - e.preventDefault(); - - mediaResource - .addFolder($scope.newFolderName, $scope.currentFolder.id) - .then(function(data) { - $scope.showFolderInput = false; - $scope.newFolderName = ""; - - //we've added a new folder so lets clear the tree cache for that specific item - treeService.clearCache({ - cacheKey: "__media", //this is the main media tree cache key - childrenOf: data.parentId //clear the children of the parent - }); - - $scope.gotoFolder(data); - }); - } - }; - - $scope.gotoFolder = function(folder) { - if (!folder) { - folder = { id: -1, name: "Media", icon: "icon-folder" }; - } - - if (folder.id > 0) { - entityResource.getAncestors(folder.id, "media") - .then(function(anc) { - // anc.splice(0,1); - $scope.path = _.filter(anc, - function(f) { - return f.path.indexOf($scope.startNodeId) !== -1; - }); - }); - - mediaTypeHelper.getAllowedImagetypes(folder.id) - .then(function(types) { - $scope.acceptedMediatypes = types; - }); - } else { - $scope.path = []; - } - - //mediaResource.rootMedia() - mediaResource.getChildren(folder.id) - .then(function(data) { - $scope.searchTerm = ""; - $scope.images = data.items ? data.items : []; - }); - - $scope.currentFolder = folder; - }; - - - $scope.clickHandler = function(image, ev, select) { - ev.preventDefault(); - - if (image.isFolder && !select) { - $scope.gotoFolder(image); - } else { - eventsService.emit("dialogs.mediaPicker.select", image); - - //we have 3 options add to collection (if multi) show details, or submit it right back to the callback - if ($scope.multiPicker) { - $scope.select(image); - image.cssclass = ($scope.dialogData.selection.indexOf(image) > -1) ? "selected" : ""; - } else if ($scope.showDetails) { - $scope.target = image; - $scope.target.url = mediaHelper.resolveFile(image); - } else { - $scope.submit(image); - } - } - }; - - $scope.exitDetails = function() { - if (!$scope.currentFolder) { - $scope.gotoFolder(); - } - - $scope.target = undefined; - }; - - $scope.onUploadComplete = function() { - $scope.gotoFolder($scope.currentFolder); - }; - - $scope.onFilesQueue = function() { - $scope.activeDrag = false; - }; - - //default root item - if (!$scope.target) { - $scope.gotoFolder({ id: $scope.startNodeId, name: "Media", icon: "icon-folder" }); - } - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html deleted file mode 100644 index 274cdeace1..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/mediapicker.html +++ /dev/null @@ -1,161 +0,0 @@ -
- -
- - - -
- - -
- - -
- -
- - -
- -
- -
- -
- -
-
- - - - - - - -
- -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js deleted file mode 100644 index 8962bf91a3..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.controller.js +++ /dev/null @@ -1,37 +0,0 @@ -//used for the member picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.MemberGroupPickerController", - function($scope, eventsService, entityResource, searchService, $log) { - var dialogOptions = $scope.dialogOptions; - $scope.dialogTreeApi = {}; - $scope.multiPicker = dialogOptions.multiPicker; - - /** Method used for selecting a node */ - function select(text, id) { - - if (dialogOptions.multiPicker) { - $scope.select(id); - } - else { - $scope.submit(id); - } - } - - function nodeSelectHandler(args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - eventsService.emit("dialogs.memberGroupPicker.select", args); - - //This is a tree node, so we don't have an entity to pass in, it will need to be looked up - //from the server in this method. - select(args.node.name, args.node.id); - - //toggle checked state - args.node.selected = args.node.selected === true ? false : true; - } - - function onTreeInit() { - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html deleted file mode 100644 index 23b8bb93e0..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/membergrouppicker.html +++ /dev/null @@ -1,35 +0,0 @@ -
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html deleted file mode 100644 index 89bb3383de..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/property.html +++ /dev/null @@ -1 +0,0 @@ -{{propertyTypeToRender}} \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js deleted file mode 100644 index 0c1cb5b62e..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.controller.js +++ /dev/null @@ -1,79 +0,0 @@ -angular.module("umbraco").controller("Umbraco.Dialogs.RteEmbedController", function ($scope, $http, umbRequestHelper) { - $scope.form = {}; - $scope.form.url = ""; - $scope.form.width = 360; - $scope.form.height = 240; - $scope.form.constrain = true; - $scope.form.preview = ""; - $scope.form.success = false; - $scope.form.info = ""; - $scope.form.supportsDimensions = false; - - var origWidth = 500; - var origHeight = 300; - - $scope.showPreview = function() { - - if ($scope.form.url) { - $scope.form.show = true; - $scope.form.preview = "
"; - $scope.form.info = ""; - $scope.form.success = false; - - $http({ method: 'GET', url: umbRequestHelper.getApiUrl("embedApiBaseUrl", "GetEmbed"), params: { url: $scope.form.url, width: $scope.form.width, height: $scope.form.height } }) - .success(function (data) { - - $scope.form.preview = ""; - - switch (data.Status) { - case 0: - //not supported - $scope.form.info = "Not supported"; - break; - case 1: - //error - $scope.form.info = "Could not embed media - please ensure the URL is valid"; - break; - case 2: - $scope.form.preview = data.Markup; - $scope.form.supportsDimensions = data.SupportsDimensions; - $scope.form.success = true; - break; - } - }) - .error(function () { - $scope.form.supportsDimensions = false; - $scope.form.preview = ""; - $scope.form.info = "Could not embed media - please ensure the URL is valid"; - }); - } else { - $scope.form.supportsDimensions = false; - $scope.form.preview = ""; - $scope.form.info = "Please enter a URL"; - } - }; - - $scope.changeSize = function (type) { - var width, height; - - if ($scope.form.constrain) { - width = parseInt($scope.form.width, 10); - height = parseInt($scope.form.height, 10); - if (type == 'width') { - origHeight = Math.round((width / origWidth) * height); - $scope.form.height = origHeight; - } else { - origWidth = Math.round((height / origHeight) * width); - $scope.form.width = origWidth; - } - } - if ($scope.form.url != "") { - $scope.showPreview(); - } - - }; - - $scope.insert = function(){ - $scope.submit($scope.form.preview); - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html deleted file mode 100644 index ae7c57541a..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/rteembed.html +++ /dev/null @@ -1,36 +0,0 @@ -
-
- - - -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js deleted file mode 100644 index 6dae664a3d..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.controller.js +++ /dev/null @@ -1,102 +0,0 @@ -angular.module("umbraco").controller('Umbraco.Dialogs.Template.QueryBuilderController', - function($scope, $http, dialogService){ - - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetAllowedProperties").then(function(response) { - $scope.properties = response.data; - }); - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetContentTypes").then(function (response) { - $scope.contentTypes = response.data; - }); - - $http.get("backoffice/UmbracoApi/TemplateQuery/GetFilterConditions").then(function (response) { - $scope.conditions = response.data; - }); - - - $scope.query = { - contentType: { - name: "Everything" - }, - source:{ - name: "My website" - }, - filters:[ - { - property:undefined, - operator: undefined - } - ], - sort:{ - property:{ - alias: "", - name: "", - }, - direction: "ascending" - } - }; - - - - $scope.chooseSource = function(query){ - dialogService.contentPicker({ - callback: function (data) { - - if (data.id > 0) { - query.source = { id: data.id, name: data.name }; - } else { - query.source.name = "My website"; - delete query.source.id; - } - } - }); - }; - - var throttledFunc = _.throttle(function() { - - $http.post("backoffice/UmbracoApi/TemplateQuery/PostTemplateQuery", $scope.query).then(function (response) { - $scope.result = response.data; - }); - - }, 200); - - $scope.$watch("query", function(value) { - throttledFunc(); - }, true); - - $scope.getPropertyOperators = function (property) { - - var conditions = _.filter($scope.conditions, function(condition) { - var index = condition.appliesTo.indexOf(property.type); - return index >= 0; - }); - return conditions; - }; - - - $scope.addFilter = function(query){ - query.filters.push({}); - }; - - $scope.trashFilter = function (query) { - query.filters.splice(query,1); - }; - - $scope.changeSortOrder = function(query){ - if(query.sort.direction === "ascending"){ - query.sort.direction = "descending"; - }else{ - query.sort.direction = "ascending"; - } - }; - - $scope.setSortProperty = function(query, property){ - query.sort.property = property; - if(property.type === "datetime"){ - query.sort.direction = "descending"; - }else{ - query.sort.direction = "ascending"; - } - }; - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html deleted file mode 100644 index 80ea07d003..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/querybuilder.html +++ /dev/null @@ -1,158 +0,0 @@ -
- - - -
- -
-

Build a query

-
- - - - -
-
- diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js deleted file mode 100644 index 17e593ff86..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.controller.js +++ /dev/null @@ -1,8 +0,0 @@ -angular.module("umbraco").controller('Umbraco.Dialogs.Template.SnippetController', - function($scope) { - $scope.type = $scope.dialogOptions.type; - $scope.section = { - name: "", - required: false - }; - }); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html deleted file mode 100644 index 0d6c05091c..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/template/snippet.html +++ /dev/null @@ -1,37 +0,0 @@ -
-
- -
-
Configure the section
-
- - - - -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js deleted file mode 100644 index e6d0da2b6f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.controller.js +++ /dev/null @@ -1,428 +0,0 @@ -//used for the media picker dialog -angular.module("umbraco").controller("Umbraco.Dialogs.TreePickerController", - function ($scope, entityResource, eventsService, $log, searchService, angularHelper, $timeout, localizationService, treeService) { - - var tree = null; - var dialogOptions = $scope.dialogOptions; - $scope.dialogTreeApi = {}; - $scope.section = dialogOptions.section; - $scope.treeAlias = dialogOptions.treeAlias; - $scope.multiPicker = dialogOptions.multiPicker; - $scope.hideHeader = true; - $scope.searchInfo = { - searchFromId: dialogOptions.startNodeId, - searchFromName: null, - showSearch: false, - results: [], - selectedSearchResults: [] - } - - //create the custom query string param for this tree - $scope.customTreeParams = dialogOptions.startNodeId ? "startNodeId=" + dialogOptions.startNodeId : ""; - $scope.customTreeParams += dialogOptions.customTreeParams ? "&" + dialogOptions.customTreeParams : ""; - - var searchText = "Search..."; - localizationService.localize("general_search").then(function (value) { - searchText = value + "..."; - }); - - // Allow the entity type to be passed in but defaults to Document for backwards compatibility. - var entityType = dialogOptions.entityType ? dialogOptions.entityType : "Document"; - - - //min / max values - if (dialogOptions.minNumber) { - dialogOptions.minNumber = parseInt(dialogOptions.minNumber, 10); - } - if (dialogOptions.maxNumber) { - dialogOptions.maxNumber = parseInt(dialogOptions.maxNumber, 10); - } - - if (dialogOptions.section === "member") { - entityType = "Member"; - } - else if (dialogOptions.section === "media") { - entityType = "Media"; - } - - //Configures filtering - if (dialogOptions.filter) { - - dialogOptions.filterExclude = false; - dialogOptions.filterAdvanced = false; - - //used advanced filtering - if (angular.isFunction(dialogOptions.filter)) { - dialogOptions.filterAdvanced = true; - } - else if (angular.isObject(dialogOptions.filter)) { - dialogOptions.filterAdvanced = true; - } - else { - if (dialogOptions.filter.startsWith("!")) { - dialogOptions.filterExclude = true; - dialogOptions.filter = dialogOptions.filter.substring(1); - } - - //used advanced filtering - if (dialogOptions.filter.startsWith("{")) { - dialogOptions.filterAdvanced = true; - //convert to object - dialogOptions.filter = angular.fromJson(dialogOptions.filter); - } - } - } - - function nodeExpandedHandler(ev, args) { - if (angular.isArray(args.children)) { - - //iterate children - _.each(args.children, function (child) { - - //check if any of the items are list views, if so we need to add some custom - // children: A node to activate the search, any nodes that have already been - // selected in the search - if (child.metaData.isContainer) { - child.hasChildren = true; - child.children = [ - { - level: child.level + 1, - hasChildren: false, - parent: function () { - return child; - }, - name: searchText, - metaData: { - listViewNode: child, - }, - cssClass: "icon-search", - cssClasses: ["not-published"] - } - ]; - //add base transition classes to this node - child.cssClasses.push("tree-node-slide-up"); - - var listViewResults = _.filter($scope.searchInfo.selectedSearchResults, function(i) { - return i.parentId == child.id; - }); - _.each(listViewResults, function(item) { - child.children.unshift({ - id: item.id, - name: item.name, - cssClass: "icon umb-tree-icon sprTree " + item.icon, - level: child.level + 1, - metaData: { - isSearchResult: true - }, - hasChildren: false, - parent: function () { - return child; - } - }); - }); - } - - //now we need to look in the already selected search results and - // toggle the check boxes for those ones that are listed - var exists = _.find($scope.searchInfo.selectedSearchResults, function (selected) { - return child.id == selected.id; - }); - if (exists) { - child.selected = true; - } - }); - - //check filter - performFiltering(args.children); - } - } - - //gets the tree object when it loads - function treeLoadedHandler(args) { - tree = args.tree; - } - - //wires up selection - function nodeSelectHandler(ev, args) { - args.event.preventDefault(); - args.event.stopPropagation(); - - if (args.node.metaData.listViewNode) { - //check if list view 'search' node was selected - - $scope.searchInfo.showSearch = true; - $scope.searchInfo.searchFromId = args.node.metaData.listViewNode.id; - $scope.searchInfo.searchFromName = args.node.metaData.listViewNode.name; - - //add transition classes - var listViewNode = args.node.parent(); - listViewNode.cssClasses.push('tree-node-slide-up-hide-active'); - } - else if (args.node.metaData.isSearchResult) { - //check if the item selected was a search result from a list view - - //unselect - select(args.node.name, args.node.id); - - //remove it from the list view children - var listView = args.node.parent(); - listView.children = _.reject(listView.children, function(child) { - return child.id == args.node.id; - }); - - //remove it from the custom tracked search result list - $scope.searchInfo.selectedSearchResults = _.reject($scope.searchInfo.selectedSearchResults, function (i) { - return i.id == args.node.id; - }); - } - else { - eventsService.emit("dialogs.treePickerController.select", args); - - if (args.node.filtered) { - return; - } - - //This is a tree node, so we don't have an entity to pass in, it will need to be looked up - //from the server in this method. - select(args.node.name, args.node.id); - - //toggle checked state - args.node.selected = args.node.selected === true ? false : true; - } - } - - /** Method used for selecting a node */ - function select(text, id, entity) { - //if we get the root, we just return a constructed entity, no need for server data - if (id < 0) { - if ($scope.multiPicker) { - $scope.select(id); - } - else { - var node = { - alias: null, - icon: "icon-folder", - id: id, - name: text - }; - $scope.submit(node); - } - } - else { - - if ($scope.multiPicker) { - $scope.select(Number(id)); - } - else { - - $scope.hideSearch(); - - //if an entity has been passed in, use it - if (entity) { - $scope.submit(entity); - } else { - //otherwise we have to get it from the server - entityResource.getById(id, entityType).then(function (ent) { - $scope.submit(ent); - }); - } - } - } - } - - function performFiltering(nodes) { - - if (!dialogOptions.filter) { - return; - } - - //remove any list view search nodes from being filtered since these are special nodes that always must - // be allowed to be clicked on - nodes = _.filter(nodes, function(n) { - return !angular.isObject(n.metaData.listViewNode); - }); - - if (dialogOptions.filterAdvanced) { - - //filter either based on a method or an object - var filtered = angular.isFunction(dialogOptions.filter) - ? _.filter(nodes, dialogOptions.filter) - : _.where(nodes, dialogOptions.filter); - - angular.forEach(filtered, function (value, key) { - value.filtered = true; - if (dialogOptions.filterCssClass) { - if (!value.cssClasses) { - value.cssClasses = []; - } - value.cssClasses.push(dialogOptions.filterCssClass); - } - }); - } else { - var a = dialogOptions.filter.toLowerCase().replace(/\s/g, '').split(','); - angular.forEach(nodes, function (value, key) { - - var found = a.indexOf(value.metaData.contentType.toLowerCase()) >= 0; - - if (!dialogOptions.filterExclude && !found || dialogOptions.filterExclude && found) { - value.filtered = true; - - if (dialogOptions.filterCssClass) { - if (!value.cssClasses) { - value.cssClasses = []; - } - value.cssClasses.push(dialogOptions.filterCssClass); - } - } - }); - } - } - - $scope.multiSubmit = function (result) { - entityResource.getByIds(result, entityType).then(function (ents) { - $scope.submit(ents); - }); - }; - - /** method to select a search result */ - $scope.selectResult = function (evt, result) { - - if (result.filtered) { - return; - } - - result.selected = result.selected === true ? false : true; - - //since result = an entity, we'll pass it in so we don't have to go back to the server - select(result.name, result.id, result); - - //add/remove to our custom tracked list of selected search results - if (result.selected) { - $scope.searchInfo.selectedSearchResults.push(result); - } - else { - $scope.searchInfo.selectedSearchResults = _.reject($scope.searchInfo.selectedSearchResults, function(i) { - return i.id == result.id; - }); - } - - //ensure the tree node in the tree is checked/unchecked if it already exists there - if (tree) { - var found = treeService.getDescendantNode(tree.root, result.id); - if (found) { - found.selected = result.selected; - } - } - - }; - - $scope.hideSearch = function () { - - //Traverse the entire displayed tree and update each node to sync with the selected search results - if (tree) { - - //we need to ensure that any currently displayed nodes that get selected - // from the search get updated to have a check box! - function checkChildren(children) { - _.each(children, function (child) { - //check if the id is in the selection, if so ensure it's flagged as selected - var exists = _.find($scope.searchInfo.selectedSearchResults, function (selected) { - return child.id == selected.id; - }); - //if the curr node exists in selected search results, ensure it's checked - if (exists) { - child.selected = true; - } - //if the curr node does not exist in the selected search result, and the curr node is a child of a list view search result - else if (child.metaData.isSearchResult) { - //if this tree node is under a list view it means that the node was added - // to the tree dynamically under the list view that was searched, so we actually want to remove - // it all together from the tree - var listView = child.parent(); - listView.children = _.reject(listView.children, function(c) { - return c.id == child.id; - }); - } - - //check if the current node is a list view and if so, check if there's any new results - // that need to be added as child nodes to it based on search results selected - if (child.metaData.isContainer) { - - child.cssClasses = _.reject(child.cssClasses, function(c) { - return c === 'tree-node-slide-up-hide-active'; - }); - - var listViewResults = _.filter($scope.searchInfo.selectedSearchResults, function (i) { - return i.parentId == child.id; - }); - _.each(listViewResults, function (item) { - var childExists = _.find(child.children, function(c) { - return c.id == item.id; - }); - if (!childExists) { - var parent = child; - child.children.unshift({ - id: item.id, - name: item.name, - cssClass: "icon umb-tree-icon sprTree " + item.icon, - level: child.level + 1, - metaData: { - isSearchResult: true - }, - hasChildren: false, - parent: function () { - return parent; - } - }); - } - }); - } - - //recurse - if (child.children && child.children.length > 0) { - checkChildren(child.children); - } - }); - } - checkChildren(tree.root.children); - } - - - $scope.searchInfo.showSearch = false; - $scope.searchInfo.searchFromId = dialogOptions.startNodeId; - $scope.searchInfo.searchFromName = null; - $scope.searchInfo.results = []; - } - - $scope.onSearchResults = function(results) { - - //filter all items - this will mark an item as filtered - performFiltering(results); - - //now actually remove all filtered items so they are not even displayed - results = _.filter(results, function(item) { - return !item.filtered; - }); - - $scope.searchInfo.results = results; - - //sync with the curr selected results - _.each($scope.searchInfo.results, function (result) { - var exists = _.find($scope.dialogData.selection, function (selectedId) { - return result.id == selectedId; - }); - if (exists) { - result.selected = true; - } - }); - - $scope.searchInfo.showSearch = true; - }; - - $scope.onTreeInit = function () { - $scope.dialogTreeApi.callbacks.treeLoaded(treeLoadedHandler); - $scope.dialogTreeApi.callbacks.treeNodeExpanded(nodeExpandedHandler); - $scope.dialogTreeApi.callbacks.treeNodeSelect(nodeSelectHandler); - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html deleted file mode 100644 index 9d17148042..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/treepicker.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
-
- - - - -
-
- - - - -
diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js deleted file mode 100644 index e7444b8119..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.controller.js +++ /dev/null @@ -1,167 +0,0 @@ -angular.module("umbraco") - .controller("Umbraco.Dialogs.UserController", function ($scope, $location, $timeout, userService, historyService, eventsService, externalLoginInfo, authResource, currentUserResource, formHelper) { - - $scope.history = historyService.getCurrent(); - $scope.version = Umbraco.Sys.ServerVariables.application.version + " assembly: " + Umbraco.Sys.ServerVariables.application.assemblyVersion; - $scope.showPasswordFields = false; - $scope.changePasswordButtonState = "init"; - - $scope.externalLoginProviders = externalLoginInfo.providers; - $scope.externalLinkLoginFormAction = Umbraco.Sys.ServerVariables.umbracoUrls.externalLinkLoginsUrl; - var evts = []; - evts.push(eventsService.on("historyService.add", function (e, args) { - $scope.history = args.all; - })); - evts.push(eventsService.on("historyService.remove", function (e, args) { - $scope.history = args.all; - })); - evts.push(eventsService.on("historyService.removeAll", function (e, args) { - $scope.history = []; - })); - - $scope.logout = function () { - - //Add event listener for when there are pending changes on an editor which means our route was not successful - var pendingChangeEvent = eventsService.on("valFormManager.pendingChanges", function (e, args) { - //one time listener, remove the event - pendingChangeEvent(); - $scope.close(); - }); - - - //perform the path change, if it is successful then the promise will resolve otherwise it will fail - $scope.close(); - $location.path("/logout"); - }; - - $scope.gotoHistory = function (link) { - $location.path(link); - $scope.close(); - }; - - //Manually update the remaining timeout seconds - function updateTimeout() { - $timeout(function () { - if ($scope.remainingAuthSeconds > 0) { - $scope.remainingAuthSeconds--; - $scope.$digest(); - //recurse - updateTimeout(); - } - - }, 1000, false); // 1 second, do NOT execute a global digest - } - - function updateUserInfo() { - //get the user - userService.getCurrentUser().then(function (user) { - $scope.user = user; - if ($scope.user) { - $scope.remainingAuthSeconds = $scope.user.remainingAuthSeconds; - $scope.canEditProfile = _.indexOf($scope.user.allowedSections, "users") > -1; - //set the timer - updateTimeout(); - - authResource.getCurrentUserLinkedLogins().then(function(logins) { - //reset all to be un-linked - for (var provider in $scope.externalLoginProviders) { - $scope.externalLoginProviders[provider].linkedProviderKey = undefined; - } - - //set the linked logins - for (var login in logins) { - var found = _.find($scope.externalLoginProviders, function (i) { - return i.authType == login; - }); - if (found) { - found.linkedProviderKey = logins[login]; - } - } - }); - } - }); - } - - $scope.unlink = function (e, loginProvider, providerKey) { - var result = confirm("Are you sure you want to unlink this account?"); - if (!result) { - e.preventDefault(); - return; - } - - authResource.unlinkLogin(loginProvider, providerKey).then(function (a, b, c) { - updateUserInfo(); - }); - } - - updateUserInfo(); - - //remove all event handlers - $scope.$on('$destroy', function () { - for (var e = 0; e < evts.length; e++) { - evts[e](); - } - - }); - - /* ---------- UPDATE PASSWORD ---------- */ - - //create the initial model for change password property editor - $scope.changePasswordModel = { - alias: "_umb_password", - view: "changepassword", - config: {}, - value: {} - }; - - //go get the config for the membership provider and add it to the model - authResource.getMembershipProviderConfig().then(function(data) { - $scope.changePasswordModel.config = data; - //ensure the hasPassword config option is set to true (the user of course has a password already assigned) - //this will ensure the oldPassword is shown so they can change it - // disable reset password functionality beacuse it does not make sense for the current user. - $scope.changePasswordModel.config.hasPassword = true; - $scope.changePasswordModel.config.disableToggle = true; - $scope.changePasswordModel.config.enableReset = false; - }); - - $scope.changePassword = function() { - - if (formHelper.submitForm({ scope: $scope })) { - - $scope.changePasswordButtonState = "busy"; - - currentUserResource.changePassword($scope.changePasswordModel.value).then(function(data) { - - //if the password has been reset, then update our model - if (data.value) { - $scope.changePasswordModel.value.generatedPassword = data.value; - } - - formHelper.resetForm({ scope: $scope, notifications: data.notifications }); - - $scope.changePasswordButtonState = "success"; - - }, function (err) { - - formHelper.handleError(err); - - $scope.changePasswordButtonState = "error"; - - }); - - } - - }; - - $scope.togglePasswordFields = function() { - clearPasswordFields(); - $scope.showPasswordFields = !$scope.showPasswordFields; - } - - function clearPasswordFields() { - $scope.changePasswordModel.value.newPassword = ""; - $scope.changePasswordModel.confirm = ""; - } - - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html b/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html deleted file mode 100644 index 17278825e9..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/common/dialogs/user.html +++ /dev/null @@ -1,119 +0,0 @@ -
-
-
-
- -
-
-

{{user.name}}

- Umbraco version {{version}} -

- - : {{remainingAuthSeconds | timespan}} - -

- -
- -
-
- -
- -
- - - Edit - - - - - -
- -
- -
External login providers
- -
- -
- - -
- - -
- -
- -
-
- -
- -
- -
Change password
- -
- - - - - - - - - -
- -
- -
-
diff --git a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html index 8117952b59..d46c80ddc5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/buttons/umb-button-group.html @@ -5,15 +5,17 @@ alias="{{defaultButton.alias ? defaultButton.alias : 'groupPrimary' }}" type="button" action="defaultButton.handler()" - button-style="success" + button-style="{{buttonStyle}}" state="state" label="{{defaultButton.labelKey}}" label-key="{{defaultButton.labelKey}}" shortcut="{{defaultButton.hotKey}}" - shortcut-when-hidden="{{defaultButton.hotKeyWhenHidden}}"> + shortcut-when-hidden="{{defaultButton.hotKeyWhenHidden}}" + size="{{size}}" + icon="{{icon}}"> - + diff --git a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html index d2ef73106f..6501ec29b2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/components/content/edit.html @@ -76,6 +76,7 @@
- + button-style="success" + size="s" + disabled="healthCheckAction.providedValue.$invalid" + action="vm.executeAction(check, $parent.$index, action)" + label="{{action.name}}"> + diff --git a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html index 0ecaeb80df..24b32815e5 100644 --- a/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html +++ b/src/Umbraco.Web.UI.Client/src/views/dashboard/developer/redirecturls.html @@ -8,21 +8,22 @@ - + size="s" + action="vm.disableUrlTracker()" + label-key="redirectUrls_disableUrlTracker"> + - + size="s" + button-style="success" + action="vm.enableUrlTracker()" + label-key="redirectUrls_enableUrlTracker"> + @@ -76,8 +77,13 @@ - - + + diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html index 5ebebae426..4495ffc8a2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.html @@ -53,6 +53,7 @@ I accept terms of use - + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/installed.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packager/views/installed.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packages/views/installed.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html similarity index 91% rename from src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html rename to src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html index ca4f129398..a015748078 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/installed.html @@ -91,13 +91,15 @@ Confirm package uninstall - + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packages/views/repo.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html similarity index 93% rename from src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html rename to src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html index 7e352f27b0..00634c7922 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packages/views/repo.html @@ -153,13 +153,25 @@
- - + + + + + +
@@ -315,14 +327,15 @@ I accept terms of use - + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js index f21f78b8eb..35da2e8ea4 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.controller.js @@ -14,6 +14,34 @@ vm.page.menu.currentSection = appState.getSectionState("currentSection"); vm.page.menu.currentNode = null; + // insert buttons + vm.page.insertDefaultButton = { + labelKey: "general_insert", + handler: function() { + vm.openInsertOverlay(); + } + }; + vm.page.insertSubButtons = [ + { + labelKey: "template_insertPageField", + handler: function () { + vm.openPageFieldOverlay(); + } + }, + { + labelKey: "template_insertMacro", + handler: function () { + vm.openMacroOverlay() + } + }, + { + labelKey: "template_insertDictionaryItem", + handler: function () { + vm.openDictionaryItemOverlay(); + } + } + ]; + // bind functions to view model vm.save = save; vm.openPageFieldOverlay = openPageFieldOverlay; diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html index d692c6fd9e..c3877aa8d1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviewmacros/edit.html @@ -25,34 +25,22 @@
- - - + size="xs" + action="vm.openQueryBuilderOverlay()" + icon="icon-wand" + label-key="template_queryBuilder"> +
diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js index f0af6fc640..cb56fecbad 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.controller.js @@ -14,6 +14,34 @@ vm.page.menu.currentSection = appState.getSectionState("currentSection"); vm.page.menu.currentNode = null; + // insert buttons + vm.page.insertDefaultButton = { + labelKey: "general_insert", + handler: function() { + vm.openInsertOverlay(); + } + }; + vm.page.insertSubButtons = [ + { + labelKey: "template_insertPageField", + handler: function () { + vm.openPageFieldOverlay(); + } + }, + { + labelKey: "template_insertMacro", + handler: function () { + vm.openMacroOverlay() + } + }, + { + labelKey: "template_insertDictionaryItem", + handler: function () { + vm.openDictionaryItemOverlay(); + } + } + ]; + //Used to toggle the keyboard shortcut modal //From a custom keybinding in ace editor - that conflicts with our own to show the dialog vm.showKeyboardShortcut = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html index 3bbf735199..3a7b025597 100644 --- a/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/partialviews/edit.html @@ -23,47 +23,35 @@ -
+
-
- - -
-
- -
-
+
+
diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js deleted file mode 100644 index f32c188d63..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.controller.js +++ /dev/null @@ -1,97 +0,0 @@ -angular.module("umbraco") -.controller("Umbraco.PropertyEditors.GoogleMapsController", - function ($element, $rootScope, $scope, notificationsService, dialogService, assetsService, $log, $timeout) { - - assetsService.loadJs('https://www.google.com/jsapi', $scope) - .then(function () { - google.load("maps", "3", - { - callback: initMap, - other_params: "sensor=false" - }); - }); - - function initMap() { - //Google maps is available and all components are ready to use. - var valueArray = $scope.model.value.split(','); - var latLng = new google.maps.LatLng(valueArray[0], valueArray[1]); - var mapDiv = document.getElementById($scope.model.alias + '_map'); - var mapOptions = { - zoom: $scope.model.config.zoom, - center: latLng, - mapTypeId: google.maps.MapTypeId[$scope.model.config.mapType] - }; - var geocoder = new google.maps.Geocoder(); - var map = new google.maps.Map(mapDiv, mapOptions); - - var marker = new google.maps.Marker({ - map: map, - position: latLng, - draggable: true - }); - - google.maps.event.addListener(map, 'click', function (event) { - - dialogService.mediaPicker({ - callback: function (data) { - var image = data.selection[0].src; - - var latLng = event.latLng; - var marker = new google.maps.Marker({ - map: map, - icon: image, - position: latLng, - draggable: true - }); - - google.maps.event.addListener(marker, "dragend", function (e) { - var newLat = marker.getPosition().lat(); - var newLng = marker.getPosition().lng(); - - codeLatLng(marker.getPosition(), geocoder); - - //set the model value - $scope.model.vvalue = newLat + "," + newLng; - }); - - } - }); - }); - - var tabShown = function(e) { - google.maps.event.trigger(map, 'resize'); - }; - - //listen for tab changes - if (tabsCtrl != null) { - tabsCtrl.onTabShown(function (args) { - tabShown(); - }); - } - - $element.closest('.umb-panel.tabbable').on('shown', '.nav-tabs a', tabShown); - - $scope.$on('$destroy', function () { - $element.closest('.umb-panel.tabbable').off('shown', '.nav-tabs a', tabShown); - }); - } - - function codeLatLng(latLng, geocoder) { - geocoder.geocode({ 'latLng': latLng }, - function (results, status) { - if (status == google.maps.GeocoderStatus.OK) { - var location = results[0].formatted_address; - $rootScope.$apply(function () { - notificationsService.success("Peter just went to: ", location); - }); - } - }); - } - - //here we declare a special method which will be called whenever the value has changed from the server - //this is instead of doing a watch on the model.value = faster - $scope.model.onValueChanged = function (newVal, oldVal) { - //update the display val again if it has changed from the server - initMap(); - }; - }); diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html deleted file mode 100644 index b69bdcbfe5..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/googlemaps/googlemaps.html +++ /dev/null @@ -1,3 +0,0 @@ -
-
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js deleted file mode 100644 index 255abd85f4..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/embeddedcontent.controller.js +++ /dev/null @@ -1,27 +0,0 @@ -//this controller simply tells the dialogs service to open a mediaPicker window -//with a specified callback, this callback will receive an object with a selection on it -angular.module('umbraco').controller("Umbraco.PropertyEditors.EmbeddedContentController", - function($rootScope, $scope, $log){ - - $scope.showForm = false; - $scope.fakeData = []; - - $scope.create = function(){ - $scope.showForm = true; - $scope.fakeData = angular.copy($scope.model.config.fields); - }; - - $scope.show = function(){ - $scope.showCode = true; - }; - - $scope.add = function(){ - $scope.showForm = false; - if ( !($scope.model.value instanceof Array)) { - $scope.model.value = []; - } - - $scope.model.value.push(angular.copy($scope.fakeData)); - $scope.fakeData = []; - }; -}); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html deleted file mode 100644 index 113aeae349..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/test/test.html +++ /dev/null @@ -1,18 +0,0 @@ -
-
    -
  • - {{item[0].value}}... -
  • -
- -
- - -
- - - -
- json: {{model.value|json}} -
-
\ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js index 709299a927..92076ff605 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.controller.js @@ -15,6 +15,40 @@ vm.page.menu.currentSection = appState.getSectionState("currentSection"); vm.page.menu.currentNode = null; + // insert buttons + vm.page.insertDefaultButton = { + labelKey: "general_insert", + handler: function() { + vm.openInsertOverlay(); + } + }; + vm.page.insertSubButtons = [ + { + labelKey: "template_insertPageField", + handler: function () { + vm.openPageFieldOverlay(); + } + }, + { + labelKey: "template_insertPartialView", + handler: function () { + vm.openPartialOverlay(); + } + }, + { + labelKey: "template_insertDictionaryItem", + handler: function () { + vm.openDictionaryItemOverlay(); + } + }, + { + labelKey: "template_insertMacro", + handler: function () { + vm.openMacroOverlay() + } + } + ]; + //Used to toggle the keyboard shortcut modal //From a custom keybinding in ace editor - that conflicts with our own to show the dialog vm.showKeyboardShortcut = false; diff --git a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html index 25cfb7ea61..6cddc552e2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/templates/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/templates/edit.html @@ -20,7 +20,6 @@ - @@ -28,14 +27,14 @@
-
- +
+ - + @@ -52,57 +51,43 @@
- - - + size="xs" + action="vm.openQueryBuilderOverlay()" + icon="icon-wand" + label-key="template_queryBuilder"> + - + size="xs" + action="vm.openSectionsOverlay()" + icon="icon-indent" + label-key="template_insertSections"> +
- +
- diff --git a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html index 28103ea3f0..e75c376801 100644 --- a/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html +++ b/src/Umbraco.Web.UI.Client/src/views/users/views/users/users.html @@ -11,6 +11,7 @@ diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 4a4831f1c6..145b035e7f 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -88,8 +88,8 @@ - - + + diff --git a/src/Umbraco.Web.UI/Umbraco/Views/Preview/Index.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/Preview/Index.cshtml index 621d542edc..38f7203407 100644 --- a/src/Umbraco.Web.UI/Umbraco/Views/Preview/Index.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/Views/Preview/Index.cshtml @@ -8,10 +8,9 @@ Umbraco Canvas Designer - - +
@if (string.IsNullOrWhiteSpace(Model.PreviewExtendedHeaderView) == false) @@ -22,7 +21,7 @@
-
+
-
  • - - - - - -
  • -
    - -
    -
    -
    -

    Select

    -
    -
    -
      -
    • - {{configItem.name}} -
    • -
    -
    -
    -
    -
    -

    {{configItem.name}}

    -
    -
    -
    -

    - {{category}} - - -

    -
    -
    -
    {{item.name}}
    -
    -
    -
    -
    -
    -
    - -
    -
    -
    -
    -

    Styles saved and published

    +
    diff --git a/src/Umbraco.Web.UI/config/trees.Release.config b/src/Umbraco.Web.UI/config/trees.Release.config index 83b85f62f6..b02a908501 100644 --- a/src/Umbraco.Web.UI/config/trees.Release.config +++ b/src/Umbraco.Web.UI/config/trees.Release.config @@ -16,7 +16,7 @@ - + diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config index 3076936cd5..9660c0fdbd 100644 --- a/src/Umbraco.Web.UI/config/trees.config +++ b/src/Umbraco.Web.UI/config/trees.config @@ -17,7 +17,7 @@ - + diff --git a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config index 534a9e2640..9e8aa9c8d1 100644 --- a/src/Umbraco.Web.UI/config/umbracoSettings.Release.config +++ b/src/Umbraco.Web.UI/config/umbracoSettings.Release.config @@ -40,7 +40,7 @@ - In Preview Mode - click to end]]> + In Preview Mode - click to end]]> - In Preview Mode - click to end + In Preview Mode - click to end ]]> diff --git a/src/Umbraco.Web.UI/web.Template.config b/src/Umbraco.Web.UI/web.Template.config index 4c1a75f047..b20e6646a1 100644 --- a/src/Umbraco.Web.UI/web.Template.config +++ b/src/Umbraco.Web.UI/web.Template.config @@ -242,52 +242,72 @@ - + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + @@ -298,8 +318,8 @@ - - + + @@ -309,10 +329,6 @@ - - - - diff --git a/src/Umbraco.Web/CanvasDesignerUtility.cs b/src/Umbraco.Web/CanvasDesignerUtility.cs deleted file mode 100644 index 512626e4e4..0000000000 --- a/src/Umbraco.Web/CanvasDesignerUtility.cs +++ /dev/null @@ -1,282 +0,0 @@ -using System.Collections.Generic; -using System.Net; -using System.Net.Http; -using System.Text; -using System.Web.Http; -using AutoMapper; -using Umbraco.Web.Models.ContentEditing; -using Umbraco.Web.Mvc; -using umbraco; -using Umbraco.Web.WebApi; -using System; -using System.Net.Http.Headers; -using System.Web; -using System.IO; -using Umbraco.Core; -using Umbraco.Core.Models; -using Umbraco.Core.Services; -using System.Linq; -using System.Text.RegularExpressions; -using Umbraco.Web.Composing; - -namespace Umbraco.Web -{ - //TODO: This class needs to be overhauled: - // No statics that have dependencies! - // Make into a real class that accept the dependencies required. - // Remove all usages of singletons: HttpContext.Current, ApplicationContext.Current, UmbracoContext.Current, etc... - - internal static class CanvasDesignerUtility - { - - internal static string canvasdesignerStylePath = "/css/canvasdesigner/"; - internal static string resultLessPath = canvasdesignerStylePath + @"{0}.less"; - internal static string resultCssPath = canvasdesignerStylePath + @"{0}.css"; - internal static string frontBasePath = HttpContext.Current.Server.MapPath(@"\css\canvasdesigner\"); - - // get style box by tag - internal static String GetStyleBlock(string source, string name) - { - - string startTag = string.Format("/***start-{0}***/", name); - string endTag = string.Format("/***end-{0}***/", name); - - int indexStartTag = source.IndexOf(startTag); - int indexEndTag = source.IndexOf(endTag); - - if (indexStartTag >= 0 && indexEndTag >= 0) - return source.Substring(indexStartTag, indexEndTag - indexStartTag).Replace(startTag, "").Replace(endTag, ""); - else - return ""; - - } - - // Get less parameters from lessPath file, both general parameters and grid parameters - internal static string GetLessParameters(int pageId) - { - - // Load current page - var contentService = Current.Services.ContentService; - IContent content = contentService.GetById(pageId); - - // Get less file path from the page Id - string lessPath = GetStylesheetPath(content.Path.Split(','), true); - - string paramBlock = string.Empty; - if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(lessPath))) - { - using (System.IO.StreamReader sr = new System.IO.StreamReader(HttpContext.Current.Server.MapPath(lessPath))) - { - - string lessContent = sr.ReadToEnd(); - foreach (Match match in Regex.Matches(lessContent, string.Format("@([^;\n]*):([^;\n]*);"))) - { - paramBlock = paramBlock + match.Groups[0].Value + "\r\n"; - } - } - } - return paramBlock; - - } - - // Get inherited pageId with canvasdesigner - internal static int GetParentOrSelfTunedPageId(string[] path, bool preview) - { - - string styleCanvasdesigner = preview ? @"{0}{1}.less" : "{0}{1}.css"; - foreach (var page in path.OrderByDescending(r => path.IndexOf(r))) - { - string stylePath = HttpContext.Current.Server.MapPath(string.Format(styleCanvasdesigner, canvasdesignerStylePath, page)); - if (System.IO.File.Exists(stylePath)) - { - return int.Parse(page); - } - } - - if (preview) - return int.Parse(path[1]); - else - return -1; - } - - // Get stylesheet path for current page - internal static string GetStylesheetPath(string[] path, bool preview) - { - string styleCanvasdesigner = preview ? @"{0}{1}.less" : "{0}{1}.css"; - - int tunedPageId = GetParentOrSelfTunedPageId(path, preview); - - if (tunedPageId >0) - return string.Format(styleCanvasdesigner, canvasdesignerStylePath, tunedPageId); - else - return string.Empty; - } - - // Create new less file - internal static string CreateOrUpdateLessFile(int pageId, string configs) - { - - // Load current page - var contentService = Current.Services.ContentService; - IContent content = contentService.GetById(pageId); - - // Get less file path from the page Id - string lessPath = GetStylesheetPath(content.Path.Split(','), true); - - // If less file exist, Load its content - string lessContent = string.Empty; - if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(lessPath))) - { - using (System.IO.StreamReader sr = new System.IO.StreamReader(HttpContext.Current.Server.MapPath(lessPath))) - { - lessContent = sr.ReadToEnd(); - } - } - - // Parse the config file - // for each config read and add less script in global less - dynamic canvasdesignerConfigs = Newtonsoft.Json.Linq.JObject.Parse(configs.ToString()); - foreach (var configuration in canvasdesignerConfigs.configs) - { - if (configuration.editors != null) - { - foreach (var editorItem in configuration.editors) - { - - var type = (editorItem.type != null && !string.IsNullOrEmpty(editorItem.type.ToString())) ? editorItem.type.ToString() : string.Empty; - var alias = (editorItem.alias != null && !string.IsNullOrEmpty(editorItem.alias.ToString())) ? editorItem.alias.ToString() : string.Empty; - var schema = (configuration.schema != null && !string.IsNullOrEmpty(configuration.schema.ToString())) ? configuration.schema.ToString() : alias; - schema = (editorItem.schema != null && !string.IsNullOrEmpty(editorItem.schema.ToString())) ? editorItem.schema.ToString() : schema; - - if (string.IsNullOrEmpty(GetStyleBlock(lessContent, "lessParam-" + alias))) - { - - // read the less model file - var lessModelPath = string.Format("/Umbraco/assets/less/{0}.less", type); - var lessModel = string.Empty; - if (System.IO.File.Exists(HttpContext.Current.Server.MapPath(lessModelPath))) - { - using (System.IO.StreamReader sr = new System.IO.StreamReader(HttpContext.Current.Server.MapPath(lessModelPath))) - { - lessModel = sr.ReadToEnd(); - } - } - - lessContent = lessContent + Environment.NewLine + lessModel - .Replace("-ALIAS-", alias.ToLower()) - .Replace("-SCHEMA-", schema); - - foreach (var parameter in editorItem) - { - lessContent = lessContent.Replace("-" + parameter.Name.ToString().ToUpper() + "-", parameter.Value.ToString()); - } - - } - } - } - } - - //// Create front directory if necesary - if (!Directory.Exists(frontBasePath)) - Directory.CreateDirectory(frontBasePath); - - // Save less file - if (string.IsNullOrEmpty(lessPath)) lessPath = string.Format("{0}{1}.less", canvasdesignerStylePath, pageId); - using (System.IO.StreamWriter file = new System.IO.StreamWriter(HttpContext.Current.Server.MapPath(lessPath))) - { - file.Write(lessContent); - } - - return lessPath; - - } - - // Save and publish less style - internal static void SaveAndPublishStyle(string parameters, int pageId, bool inherited) - { - - // Get inherited tuned pageId and path - var contentService = Current.Services.ContentService; - IContent content = contentService.GetById(pageId); - int inheritedTunedPageId = CanvasDesignerUtility.GetParentOrSelfTunedPageId(content.Path.Split(','), true); - - // Load inherited Less content - string inheritedLessContent = string.Empty; - using (System.IO.StreamReader sr = new System.IO.StreamReader(HttpContext.Current.Server.MapPath(string.Format(resultLessPath, inheritedTunedPageId)))) - { - inheritedLessContent = sr.ReadToEnd(); - } - - // Update pageId if parameters have changed - if (inherited) pageId = inheritedTunedPageId; - - // Create front directory if necesary - if (!Directory.Exists(frontBasePath)) - Directory.CreateDirectory(frontBasePath); - - // Prepare parameters and gf block and replace with the new value - string newParamBlock = string.Empty; - string newGfBlock = string.Empty; - foreach (string parameter in parameters.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries)) - { - if (parameter.IndexOf("@import") < 0) - { - string name = parameter.Substring(0, parameter.IndexOf(":")); - string value = parameter.Substring(parameter.IndexOf(":") + 1); - if (string.IsNullOrEmpty(value)) value = "''"; - inheritedLessContent = Regex.Replace(inheritedLessContent, string.Format("{0}:([^;\n]*);", name), string.Format("{0}:{1};", name, value)); - } - else - { - newGfBlock += parameter + ";" + Environment.NewLine; - } - } - - // Save less file - using (System.IO.StreamWriter file = new System.IO.StreamWriter(HttpContext.Current.Server.MapPath(string.Format(resultLessPath, pageId)))) - { - file.Write(inheritedLessContent); - } - - // Compile the Less file - string compiledStyle = GetCssFromLessString(newGfBlock + inheritedLessContent, false, true, true).Replace("@import", "@IMPORT"); - - // Save compiled file - using (System.IO.StreamWriter file = new System.IO.StreamWriter(HttpContext.Current.Server.MapPath(string.Format(resultCssPath, pageId)))) - { - file.Write(compiledStyle); - } - - } - - // Delete canvasdesigner style - internal static void DeleteStyle(int pageId) - { - - // Get inherited tuned pageId and path - var contentService = Current.Services.ContentService; - IContent content = contentService.GetById(pageId); - int inheritedTunedPageId = CanvasDesignerUtility.GetParentOrSelfTunedPageId(content.Path.Split(','), true); - - // Path to the less and css files - string newResultLessPath = HttpContext.Current.Server.MapPath(string.Format(resultLessPath, inheritedTunedPageId)); - string newResultCssPath = HttpContext.Current.Server.MapPath(string.Format(resultCssPath, inheritedTunedPageId)); - - // Delete all style file for this page - System.IO.File.Delete(newResultLessPath); - System.IO.File.Delete(newResultCssPath); - - } - - // Compile and compress less style - private static string GetCssFromLessString(string css, Boolean cacheEnabled, Boolean minifyOutput, Boolean disableVariableRedefines) - { - var config = dotless.Core.configuration.DotlessConfiguration.GetDefaultWeb(); - config.DisableVariableRedefines = disableVariableRedefines; - config.CacheEnabled = cacheEnabled; - config.MinifyOutput = minifyOutput; - return dotless.Core.LessWeb.Parse(css, config); - } - - } -} diff --git a/src/Umbraco.Web/Editors/CanvasDesignerController.cs b/src/Umbraco.Web/Editors/CanvasDesignerController.cs deleted file mode 100644 index 13b270ebb4..0000000000 --- a/src/Umbraco.Web/Editors/CanvasDesignerController.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System.Collections.Generic; -using System.Net.Http; -using System.Web.Http; -using Umbraco.Web.WebApi; -using System; -using System.Net.Http.Headers; -using System.Web; - -namespace Umbraco.Web.Editors -{ - public class CanvasDesignerController : UmbracoApiController - { - [HttpGet] - public HttpResponseMessage GetGoogleFont() - { - - // Google Web Font API Key - var APIKey = "AIzaSyDx7Y58UckkgiETJ_riiTcj7gr_zeCapw4"; - - // Google Web Font JSON URL - var googleWebFontAPIURL = string.Format("https://www.googleapis.com/webfonts/v1/webfonts?key={0}", APIKey); - - var response = "{}"; - using (var client = new System.Net.WebClient()) - { - response = client.DownloadString(new Uri(googleWebFontAPIURL)); - } - - var resp = Request.CreateResponse(); - resp.Content = new StringContent(response); - resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - return resp; - - } - - [HttpGet] - public HttpResponseMessage Load() - { - - // Get style less url - var pageId = int.Parse(HttpContext.Current.Request["pageId"]); - - // Get all parameters - string paramBlock = CanvasDesignerUtility.GetLessParameters(pageId); - - // Prepare string parameter result - string[] paramLines = paramBlock.Trim().Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries); - IList parameters = new List(); - foreach (var line in paramLines) - { - if (!line.Contains("@import")) - parameters.Add("\"" + line.Replace(":", "\":\"").Replace(";", "\"").Replace("@", "").Replace(";", "")); - } - - // Response - var resp = Request.CreateResponse(); - resp.Content = new StringContent("{" + String.Join(",", parameters) + "}"); - resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - return resp; - } - - [HttpPost] - public HttpResponseMessage Save() - { - - // Get parameters - var parameters = HttpContext.Current.Request["parameters"]; - var pageId = int.Parse(HttpContext.Current.Request["pageId"]); - var inherited = Boolean.Parse(HttpContext.Current.Request["inherited"]); - - // Save and compile styles - CanvasDesignerUtility.SaveAndPublishStyle(parameters, pageId, inherited); - - var resp = Request.CreateResponse(); - resp.Content = new StringContent("ok"); - resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - return resp; - - } - - [HttpGet] - public HttpResponseMessage Delete() - { - - var pageId = HttpContext.Current.Request["pageId"]; - - CanvasDesignerUtility.DeleteStyle(int.Parse(pageId)); - - var resp = Request.CreateResponse(); - resp.Content = new StringContent("ok"); - resp.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json"); - return resp; - - } - - [HttpPost] - public string Init() - { - - // Get parameters - var config = HttpContext.Current.Request["config"]; - var pageId = int.Parse(HttpContext.Current.Request["pageId"]); - - return CanvasDesignerUtility.CreateOrUpdateLessFile(pageId, config); - - } - - } - -} diff --git a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs index 1615dec94e..1ebfcb2841 100644 --- a/src/Umbraco.Web/HtmlHelperRenderExtensions.cs +++ b/src/Umbraco.Web/HtmlHelperRenderExtensions.cs @@ -69,7 +69,6 @@ namespace Umbraco.Web var htmlBadge = String.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), - IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), UmbracoContext.Current.HttpContext.Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); return new MvcHtmlString(htmlBadge); } @@ -886,70 +885,7 @@ namespace Umbraco.Web } #endregion - - #region canvasdesigner - - public static IHtmlString EnableCanvasDesigner(this HtmlHelper html, - UrlHelper url, - UmbracoContext umbCtx) - { - return html.EnableCanvasDesigner(url, umbCtx, string.Empty, string.Empty); - } - - public static IHtmlString EnableCanvasDesigner(this HtmlHelper html, - UrlHelper url, - UmbracoContext umbCtx, string canvasdesignerConfigPath) - { - return html.EnableCanvasDesigner(url, umbCtx, canvasdesignerConfigPath, string.Empty); - } - - public static IHtmlString EnableCanvasDesigner(this HtmlHelper html, - UrlHelper url, - UmbracoContext umbCtx, string canvasdesignerConfigPath, string canvasdesignerPalettesPath) - { - - var umbracoPath = url.Content(SystemDirectories.Umbraco); - - string previewLink = @"" + - @"" + - @"" + - @"" + - @""; - - string noPreviewLinks = @""; - - // Get page value - int pageId = umbCtx.PublishedRequest.UmbracoPage.PageID; - string[] path = umbCtx.PublishedRequest.UmbracoPage.SplitPath; - string result = string.Empty; - string cssPath = CanvasDesignerUtility.GetStylesheetPath(path, false); - - if (umbCtx.InPreviewMode) - { - canvasdesignerConfigPath = string.IsNullOrEmpty(canvasdesignerConfigPath) == false - ? canvasdesignerConfigPath - : string.Format("{0}/js/canvasdesigner.config.js", umbracoPath); - canvasdesignerPalettesPath = string.IsNullOrEmpty(canvasdesignerPalettesPath) == false - ? canvasdesignerPalettesPath - : string.Format("{0}/js/canvasdesigner.palettes.js", umbracoPath); - - if (string.IsNullOrEmpty(cssPath) == false) - result = string.Format(noPreviewLinks, cssPath) + Environment.NewLine; - - result = result + string.Format(previewLink, umbracoPath, canvasdesignerConfigPath, canvasdesignerPalettesPath, pageId); - } - else - { - // Get css path for current page - if (string.IsNullOrEmpty(cssPath) == false) - result = string.Format(noPreviewLinks, cssPath); - } - - return new HtmlString(result); - - } - - #endregion + } } diff --git a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs index 6857c0ce46..f817b74120 100644 --- a/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs +++ b/src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs @@ -206,7 +206,6 @@ namespace Umbraco.Web.Mvc markupToInject = string.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), - IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); } else diff --git a/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs b/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs index 5ea4160aae..2558f18077 100644 --- a/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs +++ b/src/Umbraco.Web/Routing/RedirectTrackingComponent.cs @@ -22,6 +22,7 @@ namespace Umbraco.Web.Redirects /// recycle bin = moving to and from does nothing: to = the node is gone, where would we redirect? from = same /// [RuntimeLevel(MinLevel = RuntimeLevel.Run)] + [DisableComponent] // fixme - re-enable when we fix redirect tracking with variants public class RedirectTrackingComponent : UmbracoComponentBase, IUmbracoCoreComponent { private const string ContextKey1 = "Umbraco.Web.Redirects.RedirectTrackingEventHandler.1"; diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 7f1169b7ca..4d2c6fb850 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -61,7 +61,6 @@ - @@ -86,9 +85,7 @@ - - 4.8.0 - + @@ -605,7 +602,6 @@ - @@ -789,7 +785,6 @@ - @@ -1578,7 +1573,7 @@ copied from Microsoft.CSharp.targets because we have webservices, we need to SGEN but it's getting confused by us referencing System.ValueTuple which it cannot load - + Name="UmbGenerateSerializationAssemblies" Condition="'$(_SGenGenerateSerializationAssembliesConfig)' == 'On' or ('@(WebReferenceUrl)'!='' and '$(_SGenGenerateSerializationAssembliesConfig)' == 'Auto')" --> @@ -1598,4 +1593,4 @@ - \ No newline at end of file + diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index 5207e2ca47..577af22167 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -1051,51 +1051,7 @@ namespace Umbraco.Web } #endregion - - #region canvasdesigner - - [Obsolete("Use EnableCanvasDesigner on the HtmlHelper extensions instead")] - public IHtmlString EnableCanvasDesigner() - { - return EnableCanvasDesigner(string.Empty, string.Empty); - } - - [Obsolete("Use EnableCanvasDesigner on the HtmlHelper extensions instead")] - public IHtmlString EnableCanvasDesigner(string canvasdesignerConfigPath) - { - return EnableCanvasDesigner(canvasdesignerConfigPath, string.Empty); - } - - [Obsolete("Use EnableCanvasDesigner on the HtmlHelper extensions instead")] - public IHtmlString EnableCanvasDesigner(string canvasdesignerConfigPath, string canvasdesignerPalettesPath) - { - var html = CreateHtmlHelper(""); - var urlHelper = new UrlHelper(UmbracoContext.HttpContext.Request.RequestContext); - return html.EnableCanvasDesigner(urlHelper, UmbracoContext, canvasdesignerConfigPath, canvasdesignerPalettesPath); - } - - [Obsolete("This shouldn't need to be used but because the obsolete extension methods above don't have access to the current HtmlHelper, we need to create a fake one, unfortunately however this will not pertain the current views viewdata, tempdata or model state so should not be used")] - private HtmlHelper CreateHtmlHelper(object model) - { - var cc = new ControllerContext - { - RequestContext = UmbracoContext.HttpContext.Request.RequestContext - }; - var viewContext = new ViewContext(cc, new FakeView(), new ViewDataDictionary(model), new TempDataDictionary(), new StringWriter()); - var htmlHelper = new HtmlHelper(viewContext, new ViewPage()); - return htmlHelper; - } - - [Obsolete("This shouldn't need to be used but because the obsolete extension methods above don't have access to the current HtmlHelper, we need to create a fake one, unfortunately however this will not pertain the current views viewdata, tempdata or model state so should not be used")] - private class FakeView : IView - { - public void Render(ViewContext viewContext, TextWriter writer) - { - } - } - - #endregion - + /// /// This is used in methods like BeginUmbracoForm and SurfaceAction to generate an encrypted string which gets submitted in a request for which /// Umbraco can decrypt during the routing process in order to delegate the request to a specific MVC Controller. diff --git a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs index 80db3b5e0a..dcfe5fb5b3 100644 --- a/src/Umbraco.Web/umbraco.presentation/default.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/default.aspx.cs @@ -129,9 +129,8 @@ namespace umbraco if (pos > -1) { string htmlBadge = - String.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, + string.Format(UmbracoConfig.For.UmbracoSettings().Content.PreviewBadge, IOHelper.ResolveUrl(SystemDirectories.Umbraco), - IOHelper.ResolveUrl(SystemDirectories.UmbracoClient), Server.UrlEncode(UmbracoContext.Current.HttpContext.Request.Path)); text = text.Substring(0, pos) + htmlBadge + text.Substring(pos, text.Length - pos); diff --git a/src/umbraco.sln b/src/umbraco.sln index df09a5d6c7..02a5367e04 100644 --- a/src/umbraco.sln +++ b/src/umbraco.sln @@ -6,9 +6,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Web.UI", "Umbraco.W EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2849E9D4-3B4E-40A3-A309-F3CB4F0E125F}" ProjectSection(SolutionItems) = preProject + ..\build\build-bootstrap.ps1 = ..\build\build-bootstrap.ps1 ..\build\build.ps1 = ..\build\build.ps1 ..\build\BuildDocs.ps1 = ..\build\BuildDocs.ps1 - NuGet.Config = NuGet.Config + ..\NuGet.Config = ..\NuGet.Config ..\build\RevertToCleanInstall.bat = ..\build\RevertToCleanInstall.bat ..\build\RevertToEmptyInstall.bat = ..\build\RevertToEmptyInstall.bat SolutionInfo.cs = SolutionInfo.cs @@ -16,13 +17,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2849E9D4 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{FD962632-184C-4005-A5F3-E705D92FC645}" ProjectSection(SolutionItems) = preProject - ..\BUILD.md = ..\BUILD.md - ..\apidocs\docfx.filter.yml = ..\apidocs\docfx.filter.yml - ..\apidocs\docfx.json = ..\apidocs\docfx.json - ..\apidocs\index.md = ..\apidocs\index.md - ..\LICENSE.md = ..\LICENSE.md - ..\README.md = ..\README.md - ..\apidocs\toc.yml = ..\apidocs\toc.yml + ApiDocs\docfx.filter.yml = ApiDocs\docfx.filter.yml + ApiDocs\docfx.json = ApiDocs\docfx.json + ApiDocs\index.md = ApiDocs\index.md + ApiDocs\toc.yml = ApiDocs\toc.yml EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B5BD12C1-A454-435E-8A46-FF4A364C0382}" @@ -85,6 +83,16 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{5B03EF4E EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Umbraco.Tests.Benchmarks", "Umbraco.Tests.Benchmarks\Umbraco.Tests.Benchmarks.csproj", "{86DEB346-089F-4106-89C8-D852B9CF2A33}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "About", "About", "{420D2458-E404-4181-B05A-0FE99EC5C504}" + ProjectSection(SolutionItems) = preProject + ..\BUILD.md = ..\BUILD.md + ..\CODE_OF_CONDUCT.md = ..\CODE_OF_CONDUCT.md + ..\CONTRIBUTING.md = ..\CONTRIBUTING.md + ..\LICENSE.md = ..\LICENSE.md + ..\PULL_REQUEST_TEMPLATE.md = ..\PULL_REQUEST_TEMPLATE.md + ..\README.md = ..\README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU