diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index 83884f6950..36d53f4a8e 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -728,6 +728,7 @@ + diff --git a/src/Umbraco.Web.UI/config/ClientDependency.config b/src/Umbraco.Web.UI/config/ClientDependency.config index e4b2a98f77..acd5d07260 100644 --- a/src/Umbraco.Web.UI/config/ClientDependency.config +++ b/src/Umbraco.Web.UI/config/ClientDependency.config @@ -10,7 +10,7 @@ NOTES: * Compression/Combination/Minification is not enabled unless debug="false" is specified on the 'compiliation' element in the web.config * A new version will invalidate both client and server cache and create new persisted files --> - + - - - - - - - + + + + + diff --git a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master index caa5370259..828df214b4 100644 --- a/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master +++ b/src/Umbraco.Web.UI/umbraco/masterpages/umbracoPage.Master @@ -3,6 +3,7 @@ <%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> +<%@ Register TagPrefix="umbClient" Namespace="Umbraco.Web.UI.Bundles" Assembly="umbraco" %> @@ -10,16 +11,12 @@ - - - - - - - - - - + + + + + + diff --git a/src/Umbraco.Web.UI/umbraco/umbraco.aspx b/src/Umbraco.Web.UI/umbraco/umbraco.aspx index 649ac15855..efe4aa628f 100644 --- a/src/Umbraco.Web.UI/umbraco/umbraco.aspx +++ b/src/Umbraco.Web.UI/umbraco/umbraco.aspx @@ -9,7 +9,8 @@ <%@ Import Namespace="Umbraco.Web" %> <%@ Register TagPrefix="cc1" Namespace="umbraco.uicontrols" Assembly="controls" %> <%@ Register TagPrefix="uc1" TagName="quickSearch" Src="Search/QuickSearch.ascx" %> -<%@ Register TagPrefix="umb" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> +<%@ Register TagPrefix="cdf" Namespace="ClientDependency.Core.Controls" Assembly="ClientDependency.Core" %> +<%@ Register TagPrefix="umbClient" Namespace="Umbraco.Web.UI.Bundles" Assembly="umbraco" %> @@ -18,41 +19,18 @@ " /> - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/HistoryManager.js b/src/Umbraco.Web.UI/umbraco_client/Application/HistoryManager.js index bed8630cf5..5bab77a931 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/HistoryManager.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/HistoryManager.js @@ -23,7 +23,7 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls"); onNavigate: function(e) { var fragment = getHashFragment($.param.fragment()); if (fragment != "") { - jQuery(window.top).trigger("navigating", [fragment]); //raise event! + $(window.top).trigger("navigating", [fragment]); //raise event! } }, @@ -43,11 +43,11 @@ Umbraco.Sys.registerNamespace("Umbraco.Controls"); addEventHandler: function(fnName, fn) { /// Adds an event listener to the event name event - if (typeof (jQuery) != "undefined") jQuery(window.top).bind(fnName, fn); //if there's no jQuery, there is no events + if (typeof ($) != "undefined") $(window.top).bind(fnName, fn); //if there's no jQuery, there is no events }, removeEventHandler: function(fnName, fn) { /// Removes an event listener to the event name event - if (typeof (jQuery) != "undefined") jQuery(window.top).unbind(fnName, fn); //if there's no jQuery, there is no events + if (typeof ($) != "undefined") $(window.top).unbind(fnName, fn); //if there's no jQuery, there is no events } }; diff --git a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoUtils.js b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoUtils.js index e5dc8b96b5..3752d2e24e 100644 --- a/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoUtils.js +++ b/src/Umbraco.Web.UI/umbraco_client/Application/UmbracoUtils.js @@ -4,8 +4,8 @@ Umbraco.Sys.registerNamespace("Umbraco.Utils"); Umbraco.Utils.generateRandom = function() { /// Returns a random integer for use with URLs - day = new Date() - z = day.getTime() - y = (z - (parseInt(z / 1000, 10) * 1000)) / 10 - return y + var day = new Date(); + var z = day.getTime(); + var y = (z - (parseInt(z / 1000, 10) * 1000)) / 10; + return y; } \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs b/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs new file mode 100644 index 0000000000..afe70ad4d1 --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsApplicationLib.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The core libs that have no dependencies + /// + [ClientDependency(ClientDependencyType.Javascript, "Application/NamespaceManager.js", "UmbracoClient", Priority = 0, Group = 0)] + [ClientDependency(ClientDependencyType.Javascript, "Application/UmbracoUtils.js", "UmbracoClient", Priority = 1, Group = 0)] + [ClientDependency(ClientDependencyType.Javascript, "ui/json2.js", "UmbracoClient", Priority = 2, Group = 0)] + [ClientDependency(ClientDependencyType.Javascript, "ui/base2.js", "UmbracoClient", Priority = 3, Group = 0)] + [ClientDependency(ClientDependencyType.Javascript, "UI/knockout.js", "UmbracoClient", Priority = 4, Group = 0)] + [ClientDependency(ClientDependencyType.Javascript, "UI/knockout.mapping.js", "UmbracoClient", Priority = 5, Group = 0)] + public class JsApplicationLib : Control + { + } +} diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs new file mode 100644 index 0000000000..621ecd214c --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsJQueryCore.cs @@ -0,0 +1,14 @@ +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The core Jquery libs + /// + [ClientDependency(ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient", Priority = 0, Group = 1)] + [ClientDependency(ClientDependencyType.Javascript, "ui/jqueryui.js", "UmbracoClient", Priority = 1, Group = 1)] + public class JsJQueryCore : Control + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs b/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs new file mode 100644 index 0000000000..48ff2f38dc --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsJQueryPlugins.cs @@ -0,0 +1,18 @@ +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The core Jquery libs + /// + [ClientDependency(ClientDependencyType.Javascript, "Application/jQuery/jquery.ba-bbq.min.js", "UmbracoClient", Priority = 0, Group = 4)] + [ClientDependency(ClientDependencyType.Javascript, "ui/jQueryWresize.js", "UmbracoClient", Priority = 1, Group = 4)] + [ClientDependency(ClientDependencyType.Javascript, "modal/jquery.simplemodal.1.4.1.custom.js", "UmbracoClient", Priority = 2, Group = 4)] + [ClientDependency(ClientDependencyType.Javascript, "Application/jQuery/jquery.cookie.js", "UmbracoClient", Priority = 3, Group = 4)] + [ClientDependency(ClientDependencyType.Javascript, "Application/JQuery/jquery.metadata.min.js", "UmbracoClient", Priority = 4, Group = 4)] + [ClientDependency(ClientDependencyType.Javascript, "Application/jQuery/jquery.hotkeys.js", "UmbracoClient", Priority = 5, Group = 4)] + public class JsJQueryPlugins : Control + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs new file mode 100644 index 0000000000..17ae644c81 --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationCore.cs @@ -0,0 +1,16 @@ +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The core libs that require JQuery to be loaded + /// + [ClientDependency(ClientDependencyType.Javascript, "Application/Extensions.js", "UmbracoClient", Priority = 0, Group = 2)] + [ClientDependency(ClientDependencyType.Javascript, "Application/UmbracoApplicationActions.js", "UmbracoClient", Priority = 1, Group = 2)] + [ClientDependency(ClientDependencyType.Javascript, "Application/HistoryManager.js", "UmbracoClient", Priority = 2, Group = 2)] + [ClientDependency(ClientDependencyType.Javascript, "Application/UmbracoClientManager.js", "UmbracoClient", Priority = 3, Group = 3)] + public class JsUmbracoApplicationCore : Control + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs new file mode 100644 index 0000000000..c8bce7694a --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoApplicationUI.cs @@ -0,0 +1,17 @@ +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The UI Umbraco libs + /// + [ClientDependency(ClientDependencyType.Javascript, "ui/default.js", "UmbracoClient", Priority = 0, Group = 5)] + [ClientDependency(ClientDependencyType.Javascript, "js/guiFunctions.js", "UmbracoRoot", Priority = 1, Group = 5)] + [ClientDependency(ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient", Priority = 2, Group = 5)] + [ClientDependency(ClientDependencyType.Javascript, "js/UmbracoSpeechBubbleBackend.js", "UmbracoRoot", Priority = 3, Group = 5)] + [ClientDependency(ClientDependencyType.Javascript, "modal/modal.js", "UmbracoClient", Priority = 2, Group = 5)] + public class JsUmbracoApplicationUI : Control + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs b/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs new file mode 100644 index 0000000000..7af2046991 --- /dev/null +++ b/src/Umbraco.Web/UI/Bundles/JsUmbracoTree.cs @@ -0,0 +1,18 @@ +using System.Web.UI; +using ClientDependency.Core; + +namespace Umbraco.Web.UI.Bundles +{ + /// + /// The umb tree libs + /// + [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.js", "UmbracoClient", Priority = 0, Group = 10)] + [ClientDependency(ClientDependencyType.Javascript, "Tree/UmbracoContext.js", "UmbracoClient", Priority = 1, Group = 10)] + [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.contextmenu.js", "UmbracoClient", Priority = 2, Group = 10)] + [ClientDependency(ClientDependencyType.Javascript, "Tree/jquery.tree.checkbox.js", "UmbracoClient", Priority = 3, Group = 10)] + [ClientDependency(ClientDependencyType.Javascript, "Tree/NodeDefinition.js", "UmbracoClient", Priority = 4, Group = 10)] + [ClientDependency(ClientDependencyType.Javascript, "Tree/UmbracoTree.js", "UmbracoClient", Priority = 5, Group = 10)] + public class JsUmbracoTree : Control + { + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/UI/Controls/FolderBrowser.cs b/src/Umbraco.Web/UI/Controls/FolderBrowser.cs index 305cc702db..f662bd507e 100644 --- a/src/Umbraco.Web/UI/Controls/FolderBrowser.cs +++ b/src/Umbraco.Web/UI/Controls/FolderBrowser.cs @@ -4,17 +4,14 @@ using System.Text; using System.Web.UI; using System.Web.UI.WebControls; using ClientDependency.Core; +using Umbraco.Web.UI.Bundles; using umbraco.BasePages; using Umbraco.Core.IO; namespace Umbraco.Web.UI.Controls { [ClientDependency(ClientDependencyType.Css, "ContextMenu/Css/jquery.contextMenu.css", "UmbracoClient")] - [ClientDependency(ClientDependencyType.Css, "FolderBrowser/Css/folderbrowser.css", "UmbracoClient")] - [ClientDependency(ClientDependencyType.Javascript, "ui/jquery.js", "UmbracoClient", Priority = 1)] - [ClientDependency(ClientDependencyType.Javascript, "ui/base2.js", "UmbracoClient", Priority = 1)] - [ClientDependency(ClientDependencyType.Javascript, "ui/knockout.js", "UmbracoClient", Priority = 3)] - [ClientDependency(ClientDependencyType.Javascript, "ui/knockout.mapping.js", "UmbracoClient", Priority = 4)] + [ClientDependency(ClientDependencyType.Css, "FolderBrowser/Css/folderbrowser.css", "UmbracoClient")] [ClientDependency(ClientDependencyType.Javascript, "ContextMenu/Js/jquery.contextMenu.js", "UmbracoClient", Priority = 5)] [ClientDependency(ClientDependencyType.Javascript, "FileUploader/js/jquery.fileUploader.js", "UmbracoClient", Priority = 6)] [ClientDependency(ClientDependencyType.Javascript, "FolderBrowser/js/folderbrowser.js", "UmbracoClient", Priority = 10)] @@ -68,6 +65,10 @@ namespace Umbraco.Web.UI.Controls /// protected override void CreateChildControls() { + //Ensure the bundles are added + Controls.Add(new JsApplicationLib()); + Controls.Add(new JsJQueryCore()); + // Create the panel surround Panel = new Panel { diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index c4a714687f..89fac8613b 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -393,6 +393,12 @@ + + + + + +