Skip to content
Permalink
Browse files

Say さようなら to webgrease and hello to Grunt

  • Loading branch information...
Chris S
Chris S committed Nov 30, 2015
1 parent b79b318 commit 3cc31cc2e306fe89a889bb8c21e74cd42759296e
Showing with 33,831 additions and 2,955 deletions.
  1. +10 −1 .gitignore
  2. +1 −7 lib/Configs/web.config
  3. +0 −10 src/Roadkill.Core/Extensions/HtmlHelperLinkExtensions.cs
  4. +12 −46 src/Roadkill.Core/Extensions/UrlHelperExtensions.cs
  5. +10 −1 src/Roadkill.Core/Mvc/Controllers/ConfigurationTesterController.cs
  6. +3 −3 src/Roadkill.Core/Properties/AssemblyInfo.cs
  7. +0 −5 src/Roadkill.Core/Roadkill.Core.csproj
  8. +0 −7 src/Roadkill.Core/RoadkillApplication.cs
  9. +0 −1 src/Roadkill.Core/packages.config
  10. +1 −0 src/Roadkill.Tests/Smoke/CanaryTests.cs
  11. +1 −0 src/Roadkill.Tests/Smoke/DemoSiteTests.cs
  12. +0 −14 src/Roadkill.Tests/Unit/Extensions/UrlHelperExtensionsTests.cs
  13. +1 −3 src/Roadkill.Tests/Unit/Mvc/Controllers/ConfigurationTesterControllerTests.cs
  14. +2 −2 src/Roadkill.Tests/Unit/Services/LocalFileServiceTests.cs
  15. +9 −1 src/Roadkill.Tests/app.config
  16. BIN src/Roadkill.Web/App_Data/roadkill-acceptancetests.sdf
  17. BIN src/Roadkill.Web/App_Data/roadkill152.sdf
  18. 0 src/Roadkill.Web/Assets/CSS/{apihelp.css → _apihelp.scss}
  19. +26 −26 src/Roadkill.Web/Assets/CSS/{htmldiff.css → _htmldiff.scss}
  20. +2,561 −2,561 src/Roadkill.Web/Assets/CSS/{jquery-ui-bootstrap.css → _jquery-ui-bootstrap.scss}
  21. +36 −36 src/Roadkill.Web/Assets/CSS/{jquery.fileupload.css → _jquery.fileupload.scss}
  22. 0 src/Roadkill.Web/Assets/CSS/{tagmanager.css → _tagmanager.scss}
  23. 0 src/Roadkill.Web/Assets/CSS/{toastr.css → _toastr.scss}
  24. BIN src/Roadkill.Web/Assets/CSS/images/ui-bg_glass_75_ffffff_1x400.png
  25. +10 −163 src/Roadkill.Web/Assets/CSS/roadkill.css
  26. +2 −42 src/Roadkill.Web/Assets/CSS/roadkill.installer.css
  27. +44 −0 src/Roadkill.Web/Assets/CSS/roadkill.installer.scss
  28. +170 −0 src/Roadkill.Web/Assets/CSS/roadkill.scss
  29. +30,834 −0 src/Roadkill.Web/Assets/Scripts/roadkill.js
  30. +11 −16 src/Roadkill.Web/Roadkill.Web.csproj
  31. +0 −1 src/Roadkill.Web/Views/Install/Layout.cshtml
  32. +67 −0 src/Roadkill.Web/gruntfile.js
  33. +19 −0 src/Roadkill.Web/package.json
  34. +0 −2 src/Roadkill.Web/packages.config
  35. +1 −7 src/Roadkill.Web/web.config
@@ -94,4 +94,13 @@ src/Roadkill.Web/App_Data/Export/
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
#!**/packages/repositories.config

# Grunt
node_modules/
bower_components/
.sass-cache/

# Ignore Roadkill CSS/JS files as they're generated on build
roadkill.min.js
**/Assets/CSS/*.css
@@ -50,8 +50,7 @@
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="System.Web.Optimization" />


<add namespace="Roadkill.Core" />
<add namespace="Roadkill.Core.Mvc.ViewModels" />
<add namespace="Roadkill.Core.Mvc.Controllers" />
@@ -84,7 +83,6 @@
<add namespace="System.Web.Routing" />
<add namespace="System.Linq" />
<add namespace="System.Collections.Generic" />
<add namespace="System.Web.Optimization" />
<add namespace="System.Web.Http" />
<add namespace="System.Web.Http.Description" />

@@ -160,10 +158,6 @@
<assemblyIdentity name="System.Web" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.6.0.0" newVersion="1.6.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
@@ -1,20 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Roadkill.Core.Localization;
using System.Globalization;
using StructureMap;
using Roadkill.Core.Configuration;
using ControllerBase = Roadkill.Core.Mvc.Controllers.ControllerBase;
using Roadkill.Core.Services;
using Roadkill.Core.Mvc.ViewModels;
using System.Web.Optimization;
using System.Web;
using Roadkill.Core.Plugins.Text.BuiltIn;
using Roadkill.Core.Mvc;
using Roadkill.Core.DI;

namespace Roadkill.Core.Extensions
@@ -1,27 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text;
using System.Web.Mvc;
using System.Web.Mvc.Html;
using Roadkill.Core.Converters;
using System.Web;
using System.Text.RegularExpressions;
using Recaptcha;
using System.Web.UI;
using System.IO;
using Roadkill.Core.Configuration;
using Roadkill.Core.Services;
using StructureMap;
using ControllerBase = Roadkill.Core.Mvc.Controllers.ControllerBase;
using Roadkill.Core.Attachments;
using Roadkill.Core.Mvc.ViewModels;
using Roadkill.Core.Localization;
using Roadkill.Core.DI;
using System.Linq.Expressions;
using Roadkill.Core.Mvc.Controllers;
using System.Web.Optimization;
using Roadkill.Core.Mvc;

namespace Roadkill.Core.Extensions
{
@@ -53,7 +32,7 @@ public static MvcHtmlString CssLink(this UrlHelper helper, string relativePath)
path = "~/Assets/CSS/" + relativePath;

path = helper.Content(path);
string html = string.Format("<link href=\"{0}?version={1}\" rel=\"stylesheet\" type=\"text/css\" />", path, ApplicationSettings.ProductVersion);
string html = $"<link href=\"{path}?version={ApplicationSettings.ProductVersion}\" rel=\"stylesheet\" type=\"text/css\" />";

return MvcHtmlString.Create(html);
}
@@ -70,7 +49,7 @@ public static MvcHtmlString ScriptLink(this UrlHelper helper, string relativePat
path = "~/Assets/Scripts/" + relativePath;

path = helper.Content(path);
string html = string.Format("<script type=\"text/javascript\" language=\"javascript\" src=\"{0}?version={1}\"></script>", path, ApplicationSettings.ProductVersion);
string html = $"<script type=\"text/javascript\" language=\"javascript\" src=\"{path}?version={ApplicationSettings.ProductVersion}\"></script>";

return MvcHtmlString.Create(html);
}
@@ -80,34 +59,27 @@ public static MvcHtmlString ScriptLink(this UrlHelper helper, string relativePat
/// </summary>
public static MvcHtmlString InstallerScriptLink(this UrlHelper helper, string filename)
{
string path = helper.Content("~/Assets/Scripts/roadkill/installer/" + filename);
string html = string.Format("<script type=\"text/javascript\" language=\"javascript\" src=\"{0}?version={1}\"></script>", path, ApplicationSettings.ProductVersion);

return MvcHtmlString.Create(html);
return ScriptLink(helper, "~/Assets/Scripts/roadkill/installer/" + filename);
}

/// <summary>
/// Provides a CSS tag for the Bootstrap framework.
/// </summary>
public static MvcHtmlString BootstrapCSS(this UrlHelper helper)
{
string path = helper.Content("~/Assets/bootstrap/css/bootstrap.min.css");
string html = string.Format("<link href=\"{0}?version={1}\" rel=\"stylesheet\" type=\"text/css\" />", path, ApplicationSettings.ProductVersion);

return MvcHtmlString.Create(html);
return CssLink(helper, "~/Assets/bootstrap/css/bootstrap.min.css");
}

/// <summary>
/// Provides a Javascript script tag for the Bootstrap framework.
/// </summary>
public static MvcHtmlString BootstrapJS(this UrlHelper helper)
{
string bootStrapPath = helper.Content("~/Assets/bootstrap/js/bootstrap.min.js");
string respondPath = helper.Content("~/Assets/bootstrap/js/respond.min.js");
string html = ScriptLink(helper, "~/Assets/bootstrap/js/bootstrap.min.js").ToHtmlString();
html += "\n";

html += ScriptLink(helper, "~/Assets/bootstrap/js/respond.min.js").ToHtmlString();

string html = string.Format("<script type=\"text/javascript\" language=\"javascript\" src=\"{0}?version={1}\"></script>", bootStrapPath, ApplicationSettings.ProductVersion);
html += string.Format("\n<script type=\"text/javascript\" language=\"javascript\" src=\"{0}?version={1}\"></script>", respondPath, ApplicationSettings.ProductVersion);

return MvcHtmlString.Create(html);
}

@@ -117,14 +89,9 @@ public static MvcHtmlString BootstrapJS(this UrlHelper helper)
public static MvcHtmlString JsBundle(this UrlHelper helper)
{
StringBuilder builder = new StringBuilder();
string mainJs = Scripts.Render("~/Assets/Scripts/" + Bundles.JsFilename).ToHtmlString();
mainJs = mainJs.Replace("\r\n", ""); // remove these newlines, the newlines are done in the view
builder.AppendLine(mainJs);

string jsVars = "";
jsVars = ScriptLink(helper, "~/home/globaljsvars").ToHtmlString();
jsVars = jsVars.Replace("\r\n", ""); // more cleanup to tidy the HTML up
builder.Append(jsVars, 2);
builder.AppendLine(ScriptLink(helper, "~/Assets/Scripts/roadkill.min.js").ToHtmlString());
builder.AppendLine(ScriptLink(helper, "~/home/globaljsvars").ToHtmlString());

return MvcHtmlString.Create(builder.ToString());
}
@@ -134,8 +101,7 @@ public static MvcHtmlString JsBundle(this UrlHelper helper)
/// </summary>
public static MvcHtmlString CssBundle(this UrlHelper helper)
{
string html = Styles.Render("~/Assets/CSS/" + Bundles.CssFilename).ToHtmlString();
html = html.Replace("\r\n", ""); // done in the view
string html = CssLink(helper, "~/Assets/CSS/roadkill.css").ToHtmlString();
return MvcHtmlString.Create(html);
}
}
@@ -26,13 +26,22 @@ public class ConfigurationTesterController : Controller // Don't inherit from Co
private IUserContext _userContext;
private ConfigReaderWriter _configReaderWriter;
private IActiveDirectoryProvider _activeDirectoryProvider;
private readonly UserServiceBase _userService;

public ConfigurationTesterController(ApplicationSettings appSettings, IUserContext userContext, ConfigReaderWriter configReaderWriter, IActiveDirectoryProvider activeDirectoryProvider)
public ConfigurationTesterController(ApplicationSettings appSettings, IUserContext userContext, ConfigReaderWriter configReaderWriter, IActiveDirectoryProvider activeDirectoryProvider, UserServiceBase userService)
{
_applicationSettings = appSettings;
_userContext = userContext;
_configReaderWriter = configReaderWriter;
_activeDirectoryProvider = activeDirectoryProvider;
_userService = userService;
}

protected override void OnActionExecuting(ActionExecutingContext filterContext)
{
_userContext.CurrentUser = _userService.GetLoggedInUserName(HttpContext);
ViewBag.Context = _userContext;
ViewBag.Config = _applicationSettings;
}

/// <summary>
@@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("C.Small")]
[assembly: AssemblyProduct("Roadkill.Core")]
[assembly: AssemblyCopyright("Copyright © C.Small 2013")]
[assembly: AssemblyCopyright("Copyright © C.Small 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

@@ -33,6 +33,6 @@
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.*")]
[assembly: AssemblyFileVersion("2.0.300")]
[assembly: AssemblyInformationalVersion("2.0.300")]// Do not include spaces (as it's used by the Bundles)
[assembly: AssemblyFileVersion("2.0.400")]
[assembly: AssemblyInformationalVersion("2.0.400")]// Do not include spaces (as it's used by the CSS/Javascript tags as ?v=)
[assembly: InternalsVisibleTo("Roadkill.Tests")]
@@ -288,10 +288,6 @@
<HintPath>..\..\packages\Microsoft.AspNet.Mvc.5.2.3\lib\net45\System.Web.Mvc.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Optimization, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.Web.Optimization.1.1.3\lib\net40\System.Web.Optimization.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.AspNet.Razor.3.2.3\lib\net45\System.Web.Razor.dll</HintPath>
<Private>True</Private>
@@ -386,7 +382,6 @@
<Compile Include="Mvc\WebApi\SearchController.cs" />
<Compile Include="Mvc\WebApi\PagesController.cs" />
<Compile Include="Mvc\Controllers\SiteSettings\PluginSettingsController.cs" />
<Compile Include="Mvc\Setup\Bundles.cs" />
<Compile Include="Mvc\Setup\ExtendedRazorViewEngine.cs" />
<Compile Include="Mvc\Controllers\FileManagerController.cs" />
<Compile Include="Mvc\Setup\Routing.cs" />
@@ -2,16 +2,10 @@
using System.Web.Mvc;
using System.Web.Routing;
using System;
using Roadkill.Core.Attachments;
using StructureMap;
using Roadkill.Core.Configuration;
using Roadkill.Core.Converters;
using System.Web.Optimization;
using Roadkill.Core.Logging;
using Roadkill.Core.Mvc;
using System.IO;
using Roadkill.Core.DI;
using Roadkill.Core.Mvc;
using System.Web.Http;

namespace Roadkill.Core
@@ -47,7 +41,6 @@ protected void Application_Start()
// Register routes and JS/CSS bundles
Routing.RegisterApi(GlobalConfiguration.Configuration);
Routing.Register(RouteTable.Routes);
Bundles.Register();

// Custom view engine registration (to add new search paths)
ExtendedRazorViewEngine.Register();
@@ -10,7 +10,6 @@
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Mvc.FixedDisplayModes" version="5.0.0" targetFramework="net45" />
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net45" />
@@ -31,6 +31,7 @@ public void Can_Reach_Homepage()
}

[Test]
[Ignore("Moving to swagger")]
public void WebApi_Help_Page_Has_Known_Text()
{
// Arrange
@@ -12,6 +12,7 @@ namespace Roadkill.Tests.Acceptance.Smoke
/// </summary>
[TestFixture]
[Category("Smoke")]
[Explicit]
public class DemoSiteTests : AcceptanceTestBase
{
[SetUp]
@@ -141,19 +141,5 @@ public void BootstrapJS_Should_Return_Expected_Html()
// Assert
Assert.That(actualHtml, Is.EqualTo(expectedHtml), actualHtml);
}

[Test]
[Ignore]
public void JsBundle_Should_Should_Return_Expected_Html()
{
// System.Web.Optimization.Scripts can't be tested (it uses HttpContext internally)
}

[Test]
[Ignore]
public void CssBundle_Should_Return_Expected_Html()
{
// System.Web.Optimization.Styles can't be tested (it uses HttpContext internally)
}
}
}
@@ -33,7 +33,6 @@ public class ConfigurationTesterControllerTests
private ApplicationSettings _applicationSettings;
private IUserContext _context;
private UserServiceMock _userService;
private SettingsService _settingsService;
private ConfigReaderWriterStub _configReaderWriter;
private ActiveDirectoryProviderMock _activeDirectoryProviderMock;

@@ -48,12 +47,11 @@ public void Setup()
_applicationSettings.Installed = false;

_context = _container.UserContext;
_settingsService = _container.SettingsService;
_userService = _container.UserService;
_configReaderWriter = new ConfigReaderWriterStub();
_activeDirectoryProviderMock = new ActiveDirectoryProviderMock();

_configTesterController = new ConfigurationTesterController(_applicationSettings, _context, _configReaderWriter, _activeDirectoryProviderMock);
_configTesterController = new ConfigurationTesterController(_applicationSettings, _context, _configReaderWriter, _activeDirectoryProviderMock, _userService);
}

[Test]
@@ -50,11 +50,11 @@ public void Setup()
}
catch (IOException e)
{
Assert.Fail("Unable to delete the attachments folder " + _applicationSettings.AttachmentsFolder + ", does it have a lock/explorer window open, or Mercurial open?" + e.ToString());
Assert.Fail("Unable to delete the attachments folder " + _applicationSettings.AttachmentsFolder + ", does it have a lock/explorer window open?" + e);
}
catch (ArgumentException e)
{
Assert.Fail("Unable to delete the attachments folder " + _applicationSettings.AttachmentsFolder + ", is EasyMercurial open?" + e.ToString());
Assert.Fail("Unable to delete the attachments folder " + _applicationSettings.AttachmentsFolder + ", is EasyMercurial open?" + e);
}
}

@@ -38,7 +38,7 @@
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.7.4.0" newVersion="6.7.4.0" />
<bindingRedirect oldVersion="0.0.0.0-6.9.8.0" newVersion="6.9.8.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Data.SQLite" publicKeyToken="db937bc2d44ff139" culture="neutral" />
@@ -52,6 +52,14 @@
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="NLog" publicKeyToken="5120e14c03d0593c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Antlr3.Runtime" publicKeyToken="eb42632606e9261f" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.5.0.2" newVersion="3.5.0.2" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Binary file not shown.
Binary file not shown.
File renamed without changes.
Oops, something went wrong.

0 comments on commit 3cc31cc

Please sign in to comment.
You can’t perform that action at this time.