diff --git a/src/Umbraco.Web/Routing/Segments/BrowserWidthProvider.cs b/src/Umbraco.Web/Routing/Segments/BrowserWidthProvider.cs deleted file mode 100644 index fb9fffb4dc..0000000000 --- a/src/Umbraco.Web/Routing/Segments/BrowserWidthProvider.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Web; -using Newtonsoft.Json; -using Umbraco.Core; -using Umbraco.Web.Models.Segments; - -namespace Umbraco.Web.Routing.Segments -{ - [DisplayName("Browser width provider")] - [Description("A provider that relies on JavaScript to ensure that the screen width is set as a segment on a request")] - public class BrowserWidthProvider : ConfigurableSegmentProvider - { - /// - /// Performs a custom match/comparison - /// - /// - /// - /// - /// - /// - /// = 100 - /// <= 100 - /// - /// does not support not equals. - /// ]]> - /// - public override bool IsMatch(string matchStatement, Uri cleanedRequestUrl, HttpRequestBase httpRequest) - { - if (matchStatement == null) throw new ArgumentNullException("matchStatement"); - if (cleanedRequestUrl == null) throw new ArgumentNullException("cleanedRequestUrl"); - if (httpRequest == null) throw new ArgumentNullException("httpRequest"); - - var val = GetCurrentValue(cleanedRequestUrl, httpRequest) as int?; - if (val == null) return false; - - matchStatement = matchStatement.Replace(" ", ""); - - var first = matchStatement[0]; - var second = matchStatement[1]; - - switch (first) - { - case '=': - var a = matchStatement.TrimStart('=').TryConvertTo(); - if (a == false) return false; - return val == a.Result; - case '>': - if (second == '=') - { - var b = matchStatement.TrimStart('>', '=').TryConvertTo(); - if (b == false) return false; - return val >= b.Result; - } - var c = matchStatement.TrimStart('>').TryConvertTo(); - if (c == false) return false; - return val > c.Result; - case '<': - if (second == '=') - { - var d = matchStatement.TrimStart('<', '=').TryConvertTo(); - if (d == false) return false; - return val <= d.Result; - } - var e = matchStatement.TrimStart('<').TryConvertTo(); - if (e == false) return false; - return val < e.Result; - default: - //we'll assume it means equal - var f = matchStatement.TryConvertTo(); - if (f == false) return false; - return val == f.Result; - } - } - - public override object GetCurrentValue(Uri cleanedRequestUrl, HttpRequestBase httpRequest) - { - var cookie = httpRequest.Cookies["__ubw__"]; - if (cookie == null) return null; - - var val = cookie.Value.TryConvertTo(); - if (val == false) return null; - - return val.Result; - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index fae92660be..d495897e3f 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -471,7 +471,6 @@ -