diff --git a/.hgtags b/.hgtags index 2151195c67..7b87f63320 100644 --- a/.hgtags +++ b/.hgtags @@ -8,3 +8,9 @@ d03fcffb8834a9583a56813bb44b6abbd9f042cc Release-4.6.0 1809f7b2593270c192cd47bdcfdb392100686f79 4.7.2 488779dec0ceb1d2874bcef906241b919325c904 4.8.0-beta 096f20bb0575d6199f20fcb3147b63554e765a74 Release-4.8.0 +8f8a203857886b373148af29edd57460a42940be Release-4.8.1 +de73e687ddf6086ed52b6554676c1632865d07f2 Release-4.9.0 +de73e687ddf6086ed52b6554676c1632865d07f2 Release-4.9.0 +0000000000000000000000000000000000000000 Release-4.9.0 +0000000000000000000000000000000000000000 Release-4.9.0 +09f5a69cf19ebf7ddd9501e5258bee1e6a125391 Release-4.9.0 diff --git a/src/Umbraco.Core/Media/IEmbedProvider.cs b/src/Umbraco.Core/Media/IEmbedProvider.cs index f785d867b3..73232d4637 100644 --- a/src/Umbraco.Core/Media/IEmbedProvider.cs +++ b/src/Umbraco.Core/Media/IEmbedProvider.cs @@ -1,6 +1,6 @@ namespace Umbraco.Core.Media { - internal interface IEmbedProvider + public interface IEmbedProvider { bool SupportsDimensions { get; } diff --git a/src/Umbraco.Core/Media/IEmbedSettingProvider.cs b/src/Umbraco.Core/Media/IEmbedSettingProvider.cs index 903c5479b5..ab1979184b 100644 --- a/src/Umbraco.Core/Media/IEmbedSettingProvider.cs +++ b/src/Umbraco.Core/Media/IEmbedSettingProvider.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Media { - internal interface IEmbedSettingProvider + public interface IEmbedSettingProvider { object GetSetting(XmlNode settingNode); } diff --git a/src/Umbraco.Core/Media/ProviderSetting.cs b/src/Umbraco.Core/Media/ProviderSetting.cs index c19fcadecb..bfd06203d4 100644 --- a/src/Umbraco.Core/Media/ProviderSetting.cs +++ b/src/Umbraco.Core/Media/ProviderSetting.cs @@ -2,7 +2,7 @@ namespace Umbraco.Core.Media { - internal class ProviderSetting : Attribute + public class ProviderSetting : Attribute { } } \ No newline at end of file diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index ebe6e0b199..8f5ef4950a 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -273,11 +273,11 @@ FileSystemProviders.config - + Designer - - embed.config + + EmbeddedMedia.config xsltExtensions.config diff --git a/src/Umbraco.Web.UI/config/embed.Release.config b/src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config similarity index 100% rename from src/Umbraco.Web.UI/config/embed.Release.config rename to src/Umbraco.Web.UI/config/EmbeddedMedia.Release.config diff --git a/src/Umbraco.Web.UI/config/embed.config b/src/Umbraco.Web.UI/config/EmbeddedMedia.config similarity index 100% rename from src/Umbraco.Web.UI/config/embed.config rename to src/Umbraco.Web.UI/config/EmbeddedMedia.config diff --git a/src/Umbraco.Web.UI/umbraco_client/CodeArea/javascript.js b/src/Umbraco.Web.UI/umbraco_client/CodeArea/javascript.js index 9b5c0e4402..6d37c171be 100644 --- a/src/Umbraco.Web.UI/umbraco_client/CodeArea/javascript.js +++ b/src/Umbraco.Web.UI/umbraco_client/CodeArea/javascript.js @@ -10,16 +10,18 @@ function resizeTextArea(textEditor, offsetX, offsetY) { var currentHandle = null, currentLine; function updateLineInfo(cm) { + var line = cm.getCursor().line, handle = cm.getLineHandle(line); if (handle == currentHandle && line == currentLine) return; if (currentHandle) { cm.setLineClass(currentHandle, null, null); - cm.clearMarker(currentHandle); + // cm.clearMarker(currentHandle); } + currentHandle = handle; currentLine = line; cm.setLineClass(currentHandle, null, "activeline"); - cm.setMarker(currentHandle, String(line + 1)); + //cm.setMarker(currentHandle, String(line + 1)); } diff --git a/src/umbraco.businesslogic/StateHelper.cs b/src/umbraco.businesslogic/StateHelper.cs index 9bf45c0cfa..d2f78e8ed9 100644 --- a/src/umbraco.businesslogic/StateHelper.cs +++ b/src/umbraco.businesslogic/StateHelper.cs @@ -8,36 +8,9 @@ namespace umbraco.BusinessLogic /// /// The StateHelper class provides general helper methods for handling sessions, context, viewstate and cookies. /// - public class StateHelper + public class StateHelper { - - private static HttpContextBase _customHttpContext; - - /// - /// Gets/sets the HttpContext object, this is generally used for unit testing. By default this will - /// use the HttpContext.Current - /// - internal static HttpContextBase HttpContext - { - get - { - if (_customHttpContext == null && System.Web.HttpContext.Current != null) - { - //return the current HttpContxt, do NOT store this in the _customHttpContext field - //as it will persist across reqeusts! - return new HttpContextWrapper(System.Web.HttpContext.Current); - } - - if (_customHttpContext == null && System.Web.HttpContext.Current == null) - { - throw new NullReferenceException("The HttpContext property has not been set or the object execution is not running inside of an HttpContext"); - } - return _customHttpContext; - } - set { _customHttpContext = value; } - } - - #region Session Helpers + #region Session Helpers /// /// Gets the session value. @@ -45,10 +18,10 @@ namespace umbraco.BusinessLogic /// /// The key. /// - public static T GetSessionValue(string key) - { - return GetSessionValue(HttpContext, key); - } + public static T GetSessionValue(string key) + { + return GetSessionValue(HttpContext.Current, key); + } /// /// Gets the session value. @@ -57,38 +30,25 @@ namespace umbraco.BusinessLogic /// The context. /// The key. /// - [Obsolete("Use the GetSessionValue accepting an HttpContextBase instead")] - public static T GetSessionValue(HttpContext context, string key) + public static T GetSessionValue(HttpContext context, string key) { - return GetSessionValue(new HttpContextWrapper(context), key); + if (context == null) + return default(T); + object o = context.Session[key]; + if (o == null) + return default(T); + return (T)o; } - /// - /// Gets the session value. - /// - /// - /// The context. - /// The key. - /// - public static T GetSessionValue(HttpContextBase context, string key) - { - if (context == null) - return default(T); - object o = context.Session[key]; - if (o == null) - return default(T); - return (T)o; - } - /// /// Sets a session value. /// /// The key. /// The value. - public static void SetSessionValue(string key, object value) - { - SetSessionValue(HttpContext, key, value); - } + public static void SetSessionValue(string key, object value) + { + SetSessionValue(HttpContext.Current, key, value); + } /// /// Sets the session value. @@ -96,79 +56,54 @@ namespace umbraco.BusinessLogic /// The context. /// The key. /// The value. - [Obsolete("Use the SetSessionValue accepting an HttpContextBase instead")] - public static void SetSessionValue(HttpContext context, string key, object value) - { - SetSessionValue(new HttpContextWrapper(context), key, value); - } - - /// - /// Sets the session value. - /// - /// The context. - /// The key. - /// The value. - public static void SetSessionValue(HttpContextBase context, string key, object value) - { - if (context == null) - return; - context.Session[key] = value; - } - - #endregion - - #region Context Helpers - - /// - /// Gets the context value. - /// - /// - /// The key. - /// - public static T GetContextValue(string key) - { - return GetContextValue(HttpContext, key); - } - - /// - /// Gets the context value. - /// - /// - /// The context. - /// The key. - /// - [Obsolete("Use the GetContextValue accepting an HttpContextBase instead")] - public static T GetContextValue(HttpContext context, string key) + public static void SetSessionValue(HttpContext context, string key, object value) { - return GetContextValue(new HttpContextWrapper(context), key); + if (context == null) + return; + context.Session[key] = value; } - /// - /// Gets the context value. - /// - /// - /// The context. - /// The key. - /// - public static T GetContextValue(HttpContextBase context, string key) - { - if (context == null) - return default(T); - object o = context.Items[key]; - if (o == null) - return default(T); - return (T)o; - } + #endregion + + #region Context Helpers + + /// + /// Gets the context value. + /// + /// + /// The key. + /// + public static T GetContextValue(string key) + { + return GetContextValue(HttpContext.Current, key); + } + + /// + /// Gets the context value. + /// + /// + /// The context. + /// The key. + /// + public static T GetContextValue(HttpContext context, string key) + { + if (context == null) + return default(T); + object o = context.Items[key]; + if (o == null) + return default(T); + return (T)o; + } /// /// Sets the context value. /// /// The key. /// The value. - public static void SetContextValue(string key, object value) - { - SetContextValue(HttpContext, key, value); - } + public static void SetContextValue(string key, object value) + { + SetContextValue(HttpContext.Current, key, value); + } /// /// Sets the context value. @@ -176,49 +111,37 @@ namespace umbraco.BusinessLogic /// The context. /// The key. /// The value. - [Obsolete("Use the SetContextValue accepting an HttpContextBase instead")] - public static void SetContextValue(HttpContext context, string key, object value) - { - SetContextValue(new HttpContextWrapper(context), key, value); - } + public static void SetContextValue(HttpContext context, string key, object value) + { + if (context == null) + return; + context.Items[key] = value; + } - /// - /// Sets the context value. - /// - /// The context. - /// The key. - /// The value. - public static void SetContextValue(HttpContextBase context, string key, object value) - { - if (context == null) - return; - context.Items[key] = value; - } + #endregion - #endregion - - #region ViewState Helpers + #region ViewState Helpers /// /// Gets the state bag. /// /// - private static StateBag GetStateBag() - { - //if (HttpContext.Current == null) - // return null; + private static StateBag GetStateBag() + { + if (HttpContext.Current == null) + return null; - var page = HttpContext.CurrentHandler as Page; - if (page == null) - return null; + Page page = HttpContext.Current.CurrentHandler as Page; + if (page == null) + return null; - var pageType = typeof(Page); - var viewState = pageType.GetProperty("ViewState", BindingFlags.GetProperty | BindingFlags.Instance); - if (viewState == null) - return null; + Type pageType = typeof(Page); + PropertyInfo viewState = pageType.GetProperty("ViewState", BindingFlags.GetProperty | BindingFlags.Instance); + if (viewState == null) + return null; - return viewState.GetValue(page, null) as StateBag; - } + return viewState.GetValue(page, null) as StateBag; + } /// /// Gets the view state value. @@ -226,10 +149,10 @@ namespace umbraco.BusinessLogic /// /// The key. /// - public static T GetViewStateValue(string key) - { - return GetViewStateValue(GetStateBag(), key); - } + public static T GetViewStateValue(string key) + { + return GetViewStateValue(GetStateBag(), key); + } /// /// Gets a view-state value. @@ -238,25 +161,25 @@ namespace umbraco.BusinessLogic /// The bag. /// The key. /// - public static T GetViewStateValue(StateBag bag, string key) - { - if (bag == null) - return default(T); - object o = bag[key]; - if (o == null) - return default(T); - return (T)o; - } + public static T GetViewStateValue(StateBag bag, string key) + { + if (bag == null) + return default(T); + object o = bag[key]; + if (o == null) + return default(T); + return (T)o; + } /// /// Sets the view state value. /// /// The key. /// The value. - public static void SetViewStateValue(string key, object value) - { - SetViewStateValue(GetStateBag(), key, value); - } + public static void SetViewStateValue(string key, object value) + { + SetViewStateValue(GetStateBag(), key, value); + } /// /// Sets the view state value. @@ -264,15 +187,15 @@ namespace umbraco.BusinessLogic /// The bag. /// The key. /// The value. - public static void SetViewStateValue(StateBag bag, string key, object value) - { - if (bag != null) - bag[key] = value; - } + public static void SetViewStateValue(StateBag bag, string key, object value) + { + if (bag != null) + bag[key] = value; + } - #endregion + #endregion - #region Cookie Helpers + #region Cookie Helpers /// /// Determines whether a cookie has a value with a specified key. @@ -294,13 +217,13 @@ namespace umbraco.BusinessLogic /// /// The key. /// - public static string GetCookieValue(string key) - { - if (!Cookies.HasCookies) - return null; - var cookie = HttpContext.Request.Cookies[key]; - return cookie == null ? null : cookie.Value; - } + public static string GetCookieValue(string key) + { + if (!Cookies.HasCookies) + return null; + var cookie = HttpContext.Current.Request.Cookies[key]; + return cookie == null ? null : cookie.Value; + } /// /// Sets the cookie value. @@ -309,7 +232,7 @@ namespace umbraco.BusinessLogic /// The value. public static void SetCookieValue(string key, string value) { - SetCookieValue(key, value, 30d); // default Umbraco expires is 30 days + SetCookieValue(key, value, 30d); // default Umbraco expires is 30 days } /// @@ -320,196 +243,192 @@ namespace umbraco.BusinessLogic /// How long the cookie should be present in the browser public static void SetCookieValue(string key, string value, double daysToPersist) { - if (!Cookies.HasCookies) - return; - var context = HttpContext; + if (!Cookies.HasCookies) + return; + var context = HttpContext.Current; - HttpCookie cookie = new HttpCookie(key, value); - cookie.Expires = DateTime.Now.AddDays(daysToPersist); - context.Response.Cookies.Set(cookie); + HttpCookie cookie = new HttpCookie(key, value); + cookie.Expires = DateTime.Now.AddDays(daysToPersist); + context.Response.Cookies.Set(cookie); - cookie = context.Request.Cookies[key]; - if (cookie != null) - cookie.Value = value; - } + cookie = context.Request.Cookies[key]; + if (cookie != null) + cookie.Value = value; + } - // zb-00004 #29956 : refactor cookies names & handling - public static class Cookies - { - /* - * helper class to manage cookies - * - * beware! SetValue(string value) does _not_ set expires, unless the cookie has been - * configured to have one. This allows us to have cookies w/out an expires timespan. - * However, default behavior in Umbraco was to set expires to 30days by default. This - * must now be managed in the Cookie constructor or by using an overriden SetValue(...). - * - * we currently reproduce this by configuring each cookie with a 30d expires, but does - * that actually make sense? shouldn't some cookie have _no_ expires? - */ - static readonly Cookie _preview = new Cookie("UMB_PREVIEW", 30d); // was "PreviewSet" - static readonly Cookie _userContext = new Cookie("UMB_UCONTEXT", 30d); // was "UserContext" - static readonly Cookie _member = new Cookie("UMB_MEMBER", 30d); // was "umbracoMember" + // zb-00004 #29956 : refactor cookies names & handling + public static class Cookies + { + /* + * helper class to manage cookies + * + * beware! SetValue(string value) does _not_ set expires, unless the cookie has been + * configured to have one. This allows us to have cookies w/out an expires timespan. + * However, default behavior in Umbraco was to set expires to 30days by default. This + * must now be managed in the Cookie constructor or by using an overriden SetValue(...). + * + * we currently reproduce this by configuring each cookie with a 30d expires, but does + * that actually make sense? shouldn't some cookie have _no_ expires? + */ + static readonly Cookie _preview = new Cookie("UMB_PREVIEW", 30d); // was "PreviewSet" + static readonly Cookie _userContext = new Cookie("UMB_UCONTEXT", 30d); // was "UserContext" + static readonly Cookie _member = new Cookie("UMB_MEMBER", 30d); // was "umbracoMember" - public static Cookie Preview { get { return _preview; } } - public static Cookie UserContext { get { return _userContext; } } - public static Cookie Member { get { return _member; } } + public static Cookie Preview { get { return _preview; } } + public static Cookie UserContext { get { return _userContext; } } + public static Cookie Member { get { return _member; } } - public static bool HasCookies - { - get - { - var context = HttpContext; - // although just checking context should be enough?! - // but in some (replaced) umbraco code, everything is checked... - return context != null - && context.Request != null & context.Request.Cookies != null - && context.Response != null && context.Response.Cookies != null; - } - } + public static bool HasCookies + { + get + { + System.Web.HttpContext context = HttpContext.Current; + // although just checking context should be enough?! + // but in some (replaced) umbraco code, everything is checked... + return context != null + && context.Request != null & context.Request.Cookies != null + && context.Response != null && context.Response.Cookies != null; + } + } - public static void ClearAll() - { - HttpContext.Response.Cookies.Clear(); - } + public static void ClearAll() + { + HttpContext.Current.Response.Cookies.Clear(); + } - public class Cookie - { - const string cookiesExtensionConfigKey = "umbracoCookiesExtension"; + public class Cookie + { + const string cookiesExtensionConfigKey = "umbracoCookiesExtension"; - static readonly string _ext; - TimeSpan _expires; - string _key; + static readonly string _ext; + TimeSpan _expires; + string _key; - static Cookie() - { - var appSettings = System.Configuration.ConfigurationManager.AppSettings; - _ext = appSettings[cookiesExtensionConfigKey] == null ? "" : "_" + (string)appSettings[cookiesExtensionConfigKey]; - } + static Cookie() + { + var appSettings = System.Configuration.ConfigurationManager.AppSettings; + _ext = appSettings[cookiesExtensionConfigKey] == null ? "" : "_" + (string)appSettings[cookiesExtensionConfigKey]; + } - public Cookie(string key) - : this(key, TimeSpan.Zero, true) - { } + public Cookie(string key) + : this(key, TimeSpan.Zero, true) + { } - public Cookie(string key, double days) - : this(key, TimeSpan.FromDays(days), true) - { } + public Cookie(string key, double days) + : this(key, TimeSpan.FromDays(days), true) + { } - public Cookie(string key, TimeSpan expires) - : this(key, expires, true) - { } + public Cookie(string key, TimeSpan expires) + : this(key, expires, true) + { } - public Cookie(string key, bool appendExtension) - : this(key, TimeSpan.Zero, appendExtension) - { } + public Cookie(string key, bool appendExtension) + : this(key, TimeSpan.Zero, appendExtension) + { } - public Cookie(string key, double days, bool appendExtension) - : this(key, TimeSpan.FromDays(days), appendExtension) - { } + public Cookie(string key, double days, bool appendExtension) + : this(key, TimeSpan.FromDays(days), appendExtension) + { } - public Cookie(string key, TimeSpan expires, bool appendExtension) - { - _key = appendExtension ? key + _ext : key; - _expires = expires; - } + public Cookie(string key, TimeSpan expires, bool appendExtension) + { + _key = appendExtension ? key + _ext : key; + _expires = expires; + } - public string Key - { - get { return _key; } - } + public string Key + { + get { return _key; } + } - public bool HasValue - { - get { return RequestCookie != null; } - } + public bool HasValue + { + get { return RequestCookie != null; } + } - public string GetValue() - { - return RequestCookie == null ? null : RequestCookie.Value; - } + public string GetValue() + { + return RequestCookie == null ? null : RequestCookie.Value; + } + + public void SetValue(string value) + { + SetValueWithDate(value, DateTime.Now + _expires); + } + + public void SetValue(string value, double days) + { + SetValue(value, DateTime.Now.AddDays(days)); + } + + public void SetValue(string value, TimeSpan expires) + { + SetValue(value, DateTime.Now + expires); + } + + public void SetValue(string value, DateTime expires) + { + SetValueWithDate(value, expires); + } + + private void SetValueWithDate(string value, DateTime expires) + { + HttpCookie cookie = new HttpCookie(_key, value); - public void SetValue(string value) - { - HttpCookie cookie = new HttpCookie(_key, value); if (GlobalSettings.UseSSL) cookie.Secure = true; - if (!TimeSpan.Zero.Equals(_expires)) - cookie.Expires = DateTime.Now + _expires; - ResponseCookie = cookie; - // original Umbraco code also does this - // so we can GetValue() back what we previously set - cookie = RequestCookie; - if (cookie != null) - cookie.Value = value; - } - - public void SetValue(string value, double days) - { - SetValue(value, DateTime.Now.AddDays(days)); - } - - public void SetValue(string value, TimeSpan expires) - { - SetValue(value, DateTime.Now + expires); - } - - public void SetValue(string value, DateTime expires) - { - HttpCookie cookie = new HttpCookie(_key, value); - if (GlobalSettings.UseSSL) - cookie.Secure = true; cookie.Expires = expires; - ResponseCookie = cookie; + ResponseCookie = cookie; - // original Umbraco code also does this - // so we can GetValue() back what we previously set - cookie = RequestCookie; - if (cookie != null) - cookie.Value = value; - } + // original Umbraco code also does this + // so we can GetValue() back what we previously set + cookie = RequestCookie; + if (cookie != null) + cookie.Value = value; + } - public void Clear() - { - if (RequestCookie != null || ResponseCookie != null) - { - HttpCookie cookie = new HttpCookie(_key); - cookie.Expires = DateTime.Now.AddDays(-1); - ResponseCookie = cookie; - } - } + public void Clear() + { + if (RequestCookie != null || ResponseCookie != null) + { + HttpCookie cookie = new HttpCookie(_key); + cookie.Expires = DateTime.Now.AddDays(-1); + ResponseCookie = cookie; + } + } - public void Remove() - { - // beware! will not clear browser's cookie - // you probably want to use .Clear() - HttpContext.Response.Cookies.Remove(_key); - } + public void Remove() + { + // beware! will not clear browser's cookie + // you probably want to use .Clear() + HttpContext.Current.Response.Cookies.Remove(_key); + } - public HttpCookie RequestCookie - { - get - { - return HttpContext.Request.Cookies[_key]; - } - } + public HttpCookie RequestCookie + { + get + { + return HttpContext.Current.Request.Cookies[_key]; + } + } - public HttpCookie ResponseCookie - { - get - { - return HttpContext.Response.Cookies[_key]; - } - set - { - // .Set() ensures the uniqueness of cookies in the cookie collection - // ie it is the same as .Remove() + .Add() -- .Add() allows duplicates - HttpContext.Response.Cookies.Set(value); - } - } - } - } + public HttpCookie ResponseCookie + { + get + { + return HttpContext.Current.Response.Cookies[_key]; + } + set + { + // .Set() ensures the uniqueness of cookies in the cookie collection + // ie it is the same as .Remove() + .Add() -- .Add() allows duplicates + HttpContext.Current.Response.Cookies.Set(value); + } + } + } + } #endregion - } + } } diff --git a/src/umbraco.controls/CodeArea.cs b/src/umbraco.controls/CodeArea.cs index cd28223241..a6adc8e4d6 100644 --- a/src/umbraco.controls/CodeArea.cs +++ b/src/umbraco.controls/CodeArea.cs @@ -62,7 +62,7 @@ namespace umbraco.uicontrols public EditorType CodeBase { get; set; } public string ClientSaveMethod { get; set; } - public enum EditorType { JavaScript, Css, Python, XML, HTML, Razor, HtmlMixed} + public enum EditorType { JavaScript, Css, Python, XML, HTML, Razor, HtmlMixed } protected override void OnInit(EventArgs e) { @@ -72,8 +72,8 @@ namespace umbraco.uicontrols if (CodeMirrorEnabled) { ClientDependencyLoader.Instance.RegisterDependency(0, "CodeMirror/js/lib/codemirror.js", "UmbracoClient", ClientDependencyType.Javascript); - - + + ClientDependencyLoader.Instance.RegisterDependency(2, "CodeMirror/js/mode/" + CodeBase.ToString().ToLower() + "/" + CodeBase.ToString().ToLower() + ".js", "UmbracoClient", ClientDependencyType.Javascript); if (CodeBase == EditorType.HtmlMixed) { @@ -82,19 +82,21 @@ namespace umbraco.uicontrols ClientDependencyLoader.Instance.RegisterDependency(1, "CodeMirror/js/mode/css/css.js", "UmbracoClient", ClientDependencyType.Javascript); } - + ClientDependencyLoader.Instance.RegisterDependency(2, "CodeMirror/js/lib/codemirror.css", "UmbracoClient", ClientDependencyType.Css); ClientDependencyLoader.Instance.RegisterDependency(3, "CodeArea/styles.css", "UmbracoClient", ClientDependencyType.Css); - if (AutoSuggest && HttpContext.Current.Request.Browser.Browser != "IE") - { - ClientDependencyLoader.Instance.RegisterDependency(3, "CodeMirror/js/lib/util/simple-hint-customized.js", "UmbracoClient", ClientDependencyType.Javascript); - - ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hint.js", "UmbracoClient", ClientDependencyType.Javascript); - ClientDependencyLoader.Instance.RegisterDependency(5, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hints.js", "UmbracoClient", ClientDependencyType.Javascript); - - ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/simple-hint.css", "UmbracoClient", ClientDependencyType.Css); - } + + + //if (AutoSuggest && HttpContext.Current.Request.Browser.Browser != "IE") + //{ + // ClientDependencyLoader.Instance.RegisterDependency(3, "CodeMirror/js/lib/util/simple-hint-customized.js", "UmbracoClient", ClientDependencyType.Javascript); + + // ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hint.js", "UmbracoClient", ClientDependencyType.Javascript); + // ClientDependencyLoader.Instance.RegisterDependency(5, "CodeMirror/js/lib/util/" + CodeBase.ToString().ToLower() + "-hints.js", "UmbracoClient", ClientDependencyType.Javascript); + + // ClientDependencyLoader.Instance.RegisterDependency(4, "CodeMirror/js/lib/util/simple-hint.css", "UmbracoClient", ClientDependencyType.Css); + //} } } @@ -137,7 +139,7 @@ namespace umbraco.uicontrols EnsureChildControls(); var jsEventCode = ""; - + if (!CodeMirrorEnabled) { @@ -167,8 +169,6 @@ namespace umbraco.uicontrols OffSetX += 20; } - - jsEventCode += @" //create the editor @@ -181,11 +181,11 @@ namespace umbraco.uicontrols jQuery(window).resize(function(){ resizeTextArea(m_textEditor, " + OffSetX.ToString() + "," + OffSetY.ToString() + @"); }); jQuery(document).ready(function(){ resizeTextArea(m_textEditor, " + OffSetX.ToString() + "," + OffSetY.ToString() + @"); });"; - /* - if (!UmbracoSettings.ScriptDisableEditor && HttpContext.Current.Request.Browser.Browser == "IE") - { - jsEventCode += "jQuery('

" + ui.Text("codemirroriewarning").Replace("'", "\\'") + "

').insertAfter('#" + this.ClientID + "');"; - }*/ + /* + if (!UmbracoSettings.ScriptDisableEditor && HttpContext.Current.Request.Browser.Browser == "IE") + { + jsEventCode += "jQuery('

" + ui.Text("codemirroriewarning").Replace("'", "\\'") + "

').insertAfter('#" + this.ClientID + "');"; + }*/ } @@ -209,15 +209,16 @@ namespace umbraco.uicontrols var extraKeys = ""; var editorMimetype = ""; - if (AutoSuggest) - { - extraKeys = @", - extraKeys: { - ""'@'"": function(cm) { CodeMirror.{lang}Hint(cm, '@'); }, - ""'.'"": function(cm) { CodeMirror.{lang}Hint(cm, '.'); }, - ""Ctrl-Space"": function(cm) { CodeMirror.{lang}Hint(cm, ''); } - }".Replace("{lang}", CodeBase.ToString().ToLower()); - } +// if (AutoSuggest && HttpContext.Current.Request.Browser.Browser != "IE") +// { +// extraKeys = @", +// extraKeys: { +// ""'@'"": function(cm) { CodeMirror.{lang}Hint(cm, '@'); }, +// ""'.'"": function(cm) { CodeMirror.{lang}Hint(cm, '.'); }, +// ""Ctrl-Space"": function(cm) { CodeMirror.{lang}Hint(cm, ''); } +// }".Replace("{lang}", CodeBase.ToString().ToLower()); +// } + if (!string.IsNullOrEmpty(EditorMimeType)) editorMimetype = @", @@ -235,18 +236,17 @@ namespace umbraco.uicontrols indentUnit: 4, indentWithTabs: true, enterMode: ""keep"", - textWrapping: false" + - editorMimetype + @", - gutter: true, onCursorActivity: updateLineInfo, - onChange: updateLineInfo" + + lineWrapping: false" + + editorMimetype + @", + lineNumbers: true" + extraKeys + @" }); - - updateLineInfo(codeEditor); + + updateLineInfo(codeEditor); "; - + /* string[] parserFiles = new string[] { "tokenizejavascript.js", "parsejavascript.js" }; string[] cssFile = new string[] { "jscolors.css", "umbracoCustom.css" }; diff --git a/src/umbraco.presentation/web.Template.PeterGregory-PC.Debug.config b/src/umbraco.presentation/web.Template.PeterGregory-PC.Debug.config new file mode 100644 index 0000000000..34466b5f80 --- /dev/null +++ b/src/umbraco.presentation/web.Template.PeterGregory-PC.Debug.config @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/umbraco.webservices/media/mediaService.cs b/src/umbraco.webservices/media/mediaService.cs index 3a321a6688..062082ee93 100644 --- a/src/umbraco.webservices/media/mediaService.cs +++ b/src/umbraco.webservices/media/mediaService.cs @@ -199,7 +199,7 @@ namespace umbraco.webservices.media //todo cache embed doc var xmlConfig = new XmlDocument(); - xmlConfig.Load(GlobalSettings.FullpathToRoot + Path.DirectorySeparatorChar + "config" + Path.DirectorySeparatorChar + "Embed.config"); + xmlConfig.Load(GlobalSettings.FullpathToRoot + Path.DirectorySeparatorChar + "config" + Path.DirectorySeparatorChar + "EmbeddedMedia.config"); foreach (XmlNode node in xmlConfig.SelectNodes("//provider")) {