diff --git a/src/Umbraco.Web.UI.Client/gruntFile.js b/src/Umbraco.Web.UI.Client/gruntFile.js index 65249b8dfa..316a1442f6 100644 --- a/src/Umbraco.Web.UI.Client/gruntFile.js +++ b/src/Umbraco.Web.UI.Client/gruntFile.js @@ -121,9 +121,7 @@ module.exports = function (grunt) { uSky: { files: [ { dest: '<%= distdir %>/views/uSky', src: '**/*.html', expand: true, cwd: 'src/usky' }, - { dest: '<%= distdir %>/assets/uSky', src: 'uSkyTuning.lessParameters.less', expand: true, cwd: 'src/usky' }, - { dest: '<%= distdir %>/assets/uSky', src: 'uSkyTuning.dynamicStyles.less', expand: true, cwd: 'src/usky' }, - { dest: '<%= distdir %>/assets/uSky', src: 'uSkyTuning.baseStyles.css', expand: true, cwd: 'src/usky' } + { dest: '<%= distdir %>/assets/less', src: 'uSkyTuning.lessParameters.less', expand: true, cwd: 'src/usky' }, ] }, @@ -195,6 +193,10 @@ module.exports = function (grunt) { footer: "\n\n})();" } }, + uSkyLess: { + src: ['src/uSky/uSkyTuning.lessParameters.less', 'src/uSky/uSkyTuning.baseStyles.less', 'src/uSky/uSkyTuning.dynamicStyles.less'], + dest: '<%= distdir %>/assets/less/uSkyTuning.style.less', + }, controllers: { src:['src/controllers/**/*.controller.js','src/views/**/*.controller.js'], dest: '<%= distdir %>/js/umbraco.controllers.js', @@ -283,7 +285,7 @@ module.exports = function (grunt) { }, uSkyTuning: { files: { - '<%= distdir %>/assets/uSky/uSkyTuning.panelStyles.css': + '<%= distdir %>/assets/css/uSkyTuning.panelStyles.css': ['src/less/uSkyTuning.panelStyles.less'] }, options: { diff --git a/src/Umbraco.Web.UI.Client/src/uSky/lib/angular-slider.js b/src/Umbraco.Web.UI.Client/src/uSky/lib/slider.directive.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/uSky/lib/angular-slider.js rename to src/Umbraco.Web.UI.Client/src/uSky/lib/slider.directive.js diff --git a/src/Umbraco.Web.UI.Client/src/uSky/lib/angular-spectrum.js b/src/Umbraco.Web.UI.Client/src/uSky/lib/spectrum.directive.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/uSky/lib/angular-spectrum.js rename to src/Umbraco.Web.UI.Client/src/uSky/lib/spectrum.directive.js diff --git a/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.baseStyles.css b/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.baseStyles.less similarity index 100% rename from src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.baseStyles.css rename to src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.baseStyles.less diff --git a/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.dynamicStyles.less b/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.dynamicStyles.less index e50a340dd8..c9e4b535b1 100644 --- a/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.dynamicStyles.less +++ b/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.dynamicStyles.less @@ -1,195 +1,9 @@ -/***************************************************************/ -/* INIT VARIABLE */ + +/***************************************************************/ +/* IMPORTE LESS PARAMETERS */ /***************************************************************/ -@backgroundBodyColor:''; -@backgroundBodyGradientColor:''; -@backgroundBodyImageOrPattern:''; -@backgroundBodyPosition:top center; -@backgroundBodyCover:false; -@backgroundBodyRepeat:repeat; -@backgroundBodyAttachment:fixed; -@backgroundMainColumnColor:rgb(13, 77, 182); -@backgroundMainColumnGradientColor:rgb(225, 40, 40); -@backgroundMainColumnImageOrPattern:''; -@backgroundMainColumnPosition:''; -@backgroundMainColumnCover:true; -@backgroundMainColumnRepeat:''; -@backgroundMainColumnAttachment:fixed; -@backgroundHeaderColor:rgb(51, 51, 51); -@backgroundHeaderGradientColor:rgb(55, 45, 45); -@backgroundHeaderImageOrPattern:''; -@backgroundHeaderPosition:''; -@backgroundHeaderCover:true; -@backgroundHeaderRepeat:''; -@backgroundHeaderAttachment:fixed; -@backgroundFooterColor:rgb(196, 221, 20); -@backgroundFooterGradientColor:rgb(32, 28, 28); -@backgroundFooterImageOrPattern:''; -@backgroundFooterPosition:center; -@backgroundFooterCover:true; -@backgroundFooterRepeat:''; -@backgroundFooterAttachment:fixed; -@stylingMainColumnBoxed:boxed; -@stylingHeaderTopMargin:24; -@stylingMainColumnTopMargin:39; -@stylingFooterTopMargin:0; -@stylingFooterBottompMargin:0; -@stylingMainColumnRadius:0; -@stylingMainColumnShadow:27; -@stylingHeaderTopBorderSize:1; -@stylingHeaderBottomBorderSize:0; -@stylingHeaderTopBorderColor:rgba(255, 253, 253, 0.15); -@stylingHeaderBottomBorderColor:''; -@stylingHeaderMinHeight:0; -@stylingHeaderLogoTopMargin:14; -@stylingNavDisplay:float-right; -@stylingNavBackgroundColor:''; -@stylingNavBackgroundDdl:''; -@stylingNavBackgroundActiveColor:rgb(211, 84, 0); -@stylingNavMarginTop:-39; -@stylingNavRadius:5; -@stylingNavRadiusOnlyTop:true; -@stylingNavItemTopBorderActiveSize:0; -@stylingNavItemBottomBorderActiveSize:0; -@stylingNavItemTopBorderActiveColor:''; -@stylingNavItemBottomBorderActiveColor:''; -@stySocialDisplay:block-right; -@stySocialBackgroundColor:rgba(255, 255, 255, 0.09); -@stySocialTopMargin:0; -@stySocialBorderTopSize:0; -@stySocialBorderBottomSize:0; -@stySocialBorderTopColor:''; -@stySocialBorderBottomColor:''; -@stylingBoxesBackgroundColor:''; -@stylingBoxesMinHeight:0; -@stylingBoxesRadius:0; -@stylingBoxesBorderSize:0; -@stylingBoxesBorderColor:''; -@stylingThumbnailsBackgroundColor:''; -@stylingThumbnailsMinHeight:0; -@stylingThumbnailsRadius:0; -@stylingThumbnailsBorderSize:0; -@stylingThumbnailsBorderColor:''; -@FontBodyColor:''; -@FontBodySize:12; -@FontBodyLineHeight:12; -@FontBodyFamily:Arial, Helvetica; -@FontBodyFamily_weight:normal; -@FontBodyFamily_style:normal; -@FontBodyFamily_type:safe; -@FontNavFontColor:rgba(255, 255, 255, 0.78); -@FontNavFontActiveColor:rgb(255, 255, 255); -@FontNavSize:16; -@FontNavLineHeight:43; -@FontNavFamily:Arial, Helvetica; -@FontNavFamily_weight:normal; -@FontNavFamily_style:normal; -@FontNavFamily_type:safe; -@FontSocialFontColor:rgba(255, 255, 255, 0.73); -@FontSocialFontColorHover:rgb(248, 242, 242); -@FontSocialFontSize:12; -@FontSocialLineHeight:34; -@FontSocialFamily:Arial, Helvetica; -@FontSocialFamily_weight:normal; -@FontSocialFamily_style:normal; -@FontSocialFamily_type:safe; -@FontH1Color:''; -@FontH1Size:24; -@FontH1LineHeight:24; -@FontH1TopMargin:5; -@FontH1BottomMargin:10; -@FontH1Family:Arial, Helvetica; -@FontH1Family_weight:normal; -@FontH1Family_style:normal; -@FontH1Family_type:safe; -@FontH2Color:''; -@FontH2Size:18; -@FontH2LineHeight:18; -@FontH2TopMargin:5; -@FontH2BottomMargin:10; -@FontH2Family:Arial, Helvetica; -@FontH2Family_weight:normal; -@FontH2Family_style:normal; -@FontH2Family_type:safe; -@FontH3Color:''; -@FontH3Size:16; -@FontH3LineHeight:16; -@FontH3TopMargin:5; -@FontH3BottomMargin:10; -@FontH3Family:Arial, Helvetica; -@FontH3Family_weight:normal; -@FontH3Family_style:normal; -@FontH3Family_type:safe; -@FontH4Color:''; -@FontH4Size:14; -@FontH4LineHeight:14; -@FontH4TopMargin:5; -@FontH4BottomMargin:10; -@FontH4Family:Arial, Helvetica; -@FontH4Family_weight:normal; -@FontH4Family_style:normal; -@FontH4Family_type:safe; -@FontH5Color:''; -@FontH5Size:12; -@FontH5LineHeight:12; -@FontH5TopMargin:5; -@FontH5BottomMargin:10; -@FontH5Family:Arial, Helvetica; -@FontH5Family_weight:normal; -@FontH5Family_style:normal; -@FontH5Family_type:safe; -@FontH6Color:''; -@FontH6Size:12; -@FontH6LineHeight:12; -@FontH6TopMargin:5; -@FontH6BottomMargin:10; -@FontH6Family:Arial, Helvetica; -@FontH6Family_weight:normal; -@FontH6Family_style:normal; -@FontH6Family_type:safe; -@FontMediumColor:''; -@FontMediumSize:18; -@FontMediumLineHeight:18; -@FontMediumTopMargin:5; -@FontMediumBottomMargin:10; -@FontMediumFamily:Arial, Helvetica; -@FontMediumFamily_weight:normal; -@FontMediumFamily_style:normal; -@FontMediumFamily_type:safe; -@FontHighlightedColor:rgb(255, 255, 255); -@FontHighlightedBackgroundColor:rgb(0, 0, 0); -@FontHighlightedFamily:Arial, Helvetica; -@FontHighlightedFamily_weight:normal; -@FontHighlightedFamily_style:normal; -@FontHighlightedFamily_type:safe; -@FontBigColor:''; -@FontBigSize:26; -@FontBigLineHeight:26; -@FontBigTopMargin:5; -@FontBigBottomMargin:10; -@FontBigFamily:Arial, Helvetica; -@FontBigFamily_weight:normal; -@FontBigFamily_style:normal; -@FontBigFamily_type:safe; -@FontButtonColor:rgb(253, 253, 253); -@FontButtonBackgroundColor:rgb(0, 0, 0); -@FontButtonColorHover:rgb(241, 228, 228); -@FontButtonBackgroundColorHover:rgba(0, 0, 0, 0.54); -@FontButtonSize:24; -@FontButtonLineHeight:24; -@FontButtonPadding:10; -@FontButtonFamily:Arial, Helvetica; -@FontButtonFamily_weight:normal; -@FontButtonFamily_style:normal; -@FontButtonFamily_type:safe; -@FontColor2Color:rgb(253, 0, 0); -@FontColor3Color:rgb(0, 104, 4); -@FontColor4Color:rgb(0, 22, 135); -@FontLinkColor:rgb(239, 9, 9); -@FontLinkColorHover:rgb(244, 158, 158); - -@import "/Umbraco/assets/uSky/uSkyTuning.lessParameters.less"; +@import "/Umbraco/assets/less/uSkyTuning.lessParameters.less"; /***************************************************************/ /* FONT */ @@ -809,20 +623,6 @@ body { .condition5; } -/*@media (max-width: 768px) { - - .logo { - .condition () when (@stylingNavDisplay = float-right) { - float: left; - } - - .condition () when (@stylingNavDisplay = float-left) { - float: right; - } - } - -}*/ - @media (min-width: 768px) { .nav-row { diff --git a/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.lessParameters.less b/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.lessParameters.less index 8496e85dad..8cd225a445 100644 --- a/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.lessParameters.less +++ b/src/Umbraco.Web.UI.Client/src/uSky/uSkyTuning.lessParameters.less @@ -1,4 +1,5 @@ -@backgroundBodyColor:rgb(239, 239, 239); +@import url('http://fonts.googleapis.com/css?family=Open Sans:300'); +@backgroundBodyColor:rgb(244, 234, 234); @backgroundBodyGradientColor:''; @backgroundBodyImageOrPattern:''; @backgroundBodyPosition:top center; @@ -26,7 +27,7 @@ @backgroundFooterCover:true; @backgroundFooterRepeat:''; @backgroundFooterAttachment:fixed; -@stylingMainColumnBoxed:wide; +@stylingMainColumnBoxed:boxed; @stylingHeaderTopMargin:21; @stylingMainColumnTopMargin:0; @stylingFooterTopMargin:0; @@ -39,7 +40,7 @@ @stylingHeaderBottomBorderColor:rgb(230, 126, 34); @stylingHeaderMinHeight:0; @stylingHeaderLogoTopMargin:14; -@stylingNavDisplay:float-right; +@stylingNavDisplay:block-right; @stylingNavBackgroundColor:''; @stylingNavBackgroundDdl:rgba(97, 97, 97, 0.85); @stylingNavBackgroundActiveColor:rgb(230, 126, 34); @@ -76,7 +77,7 @@ @FontBodyFamily_type:google; @FontNavFontColor:rgba(255, 255, 255, 0.84); @FontNavFontActiveColor:rgb(255, 255, 255); -@FontNavSize:16; +@FontNavSize:18; @FontNavLineHeight:43; @FontNavFamily:Open Sans; @FontNavFamily_weight:300; @@ -183,4 +184,4 @@ @FontColor3Color:rgba(253, 251, 251, 0.91); @FontColor4Color:rgb(170, 170, 170); @FontLinkColor:rgb(230, 126, 34); -@FontLinkColorHover:rgba(230, 126, 34, 0.84); \ No newline at end of file +@FontLinkColorHover:rgba(230, 126, 34, 0.84); diff --git a/src/Umbraco.Web.UI/Umbraco/js/uSkyTuning.loader.js b/src/Umbraco.Web.UI/Umbraco/js/uSkyTuning.loader.js new file mode 100644 index 0000000000..b651069538 --- /dev/null +++ b/src/Umbraco.Web.UI/Umbraco/js/uSkyTuning.loader.js @@ -0,0 +1,15 @@ +LazyLoad.js([ + '/Umbraco/lib/jquery/jquery-2.0.3.min.js', + '/Umbraco/lib/jquery/jquery-ui-1.10.4.custom.min.js', + '/Umbraco/lib/Less/less-1.7.0.min.js', + '/Umbraco/lib/angular/1.1.5/angular.min.js', + '/Umbraco/lib/angular-bootstrap/ui-bootstrap-tpls-0.10.0.min.js', + '/Umbraco/lib/spectrum/spectrum.js', + 'http://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js', + '/umbraco/js/umbraco.uSkyTuning.js' +], function () { + jQuery(document).ready(function () { + angular.bootstrap(document, ['umbraco.uSkyTuning']); + }); +} +); \ No newline at end of file diff --git a/src/Umbraco.Web/Editors/uSkyTuningController.cs b/src/Umbraco.Web/Editors/uSkyTuningController.cs index 63ca50d4ff..c8f844773b 100644 --- a/src/Umbraco.Web/Editors/uSkyTuningController.cs +++ b/src/Umbraco.Web/Editors/uSkyTuningController.cs @@ -19,12 +19,10 @@ namespace Umbraco.Web.Editors public class uSkyTuningController : UmbracoApiController { - static string basePath = HttpContext.Current.Server.MapPath(@"\Umbraco\assets\uSky\"); - static string resultCssPath = HttpContext.Current.Server.MapPath(@"\Css\uSkyTunning.style.css"); - static string baseStylePath = basePath + @"uSkyTuning.baseStyles.css"; - static string dynamicLessPath = basePath + @"uSkyTuning.dynamicStyles.less"; - static string tuningParametersPath = basePath + @"uSkyTuning.lessParameters.less"; - static string tuningGoogleFontPath = basePath + @"uSkyTuning.googleFont.css"; + static string basePath = HttpContext.Current.Server.MapPath(@"\Umbraco\assets\less\"); + static string resultCssPath = HttpContext.Current.Server.MapPath(@"\Css\uSkyTuning.style.css"); + static string uSkyTuningStylePath = basePath + @"uSkyTuning.style.less"; + static string uSkyTuningParametersPath = basePath + @"uSkyTuning.lessParameters.less"; [HttpGet] public HttpResponseMessage GetGoogleFont() @@ -58,11 +56,11 @@ namespace Umbraco.Web.Editors if (!Directory.Exists(basePath)) Directory.CreateDirectory(basePath); - if (!File.Exists(tuningParametersPath)) - File.Create(tuningParametersPath); + if (!File.Exists(uSkyTuningParametersPath)) + File.Create(uSkyTuningParametersPath); IList parameters = new List(); - using (System.IO.StreamReader sr = new System.IO.StreamReader(tuningParametersPath)) + using (System.IO.StreamReader sr = new System.IO.StreamReader(uSkyTuningParametersPath)) { String line; while ((line = sr.ReadLine()) != null) @@ -87,11 +85,8 @@ namespace Umbraco.Web.Editors if (!Directory.Exists(basePath)) Directory.CreateDirectory(basePath); - if (!File.Exists(tuningParametersPath)) - File.Create(tuningParametersPath); - - if (!File.Exists(tuningGoogleFontPath)) - File.Create(tuningGoogleFontPath); + if (!File.Exists(uSkyTuningParametersPath)) + File.Create(uSkyTuningParametersPath); if (!File.Exists(resultCssPath)) File.Create(resultCssPath); @@ -100,7 +95,7 @@ namespace Umbraco.Web.Editors // Update less parameter file string gaImportList = string.Empty; - using (System.IO.StreamWriter file = new System.IO.StreamWriter(tuningParametersPath)) + using (System.IO.StreamWriter file = new System.IO.StreamWriter(uSkyTuningParametersPath)) { foreach (string parameters in result.Trim().Split(';')) { @@ -116,22 +111,15 @@ namespace Umbraco.Web.Editors } } - // Read base style file - string baseStyleString = string.Empty; - using (System.IO.StreamReader sr = new System.IO.StreamReader(baseStylePath)) + // Read uSkyTuning style file + string uSkyTuningStyleString = string.Empty; + using (System.IO.StreamReader sr = new System.IO.StreamReader(uSkyTuningStylePath)) { - baseStyleString = sr.ReadToEnd(); - } - - // Read the Less file - string dynamicLessString = string.Empty; - using (System.IO.StreamReader sr = new System.IO.StreamReader(dynamicLessPath)) - { - dynamicLessString = sr.ReadToEnd(); + uSkyTuningStyleString = sr.ReadToEnd(); } // Compile the Less file - string compiledStyle = GetCssFromLessString(baseStyleString + dynamicLessString, false, true, true); + string compiledStyle = GetCssFromLessString(uSkyTuningStyleString, false, true, true); // Save compiled file using (System.IO.StreamWriter file = new System.IO.StreamWriter(resultCssPath))