diff --git a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js index e3f86a4b14..4da21ac281 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/assets.service.js @@ -90,17 +90,21 @@ angular.module('umbraco.services') var t = timeout || 5000; var a = attributes || undefined; - yepnope.injectCss(path, function () { - - if (!scope) { - deferred.resolve(true); - }else{ - angularHelper.safeApply(scope, function () { - deferred.resolve(true); - }); - } - - },a,t); + yepnope({ + forceCSS: true, + load: path, + timeout: t, + attrs: a, + callback: function (url, result, key) { + if (!scope) { + deferred.resolve(true); + }else{ + angularHelper.safeApply(scope, function () { + deferred.resolve(true); + }); + } + } + }); return deferred.promise; }, @@ -124,6 +128,26 @@ angular.module('umbraco.services') var t = timeout || 5000; var a = attributes || undefined; + + yepnope({ + forceJS: true, + load: path, + timeout: t, + attrs: a, + callback: function (url, result, key) { + + if (!scope) { + deferred.resolve(true); + }else{ + angularHelper.safeApply(scope, function () { + deferred.resolve(true); + }); + } + } + }); + + +/* yepnope.injectJs(path, function () { if (!scope) { @@ -135,6 +159,7 @@ angular.module('umbraco.services') } },a,t); +*/ return deferred.promise; }, diff --git a/src/Umbraco.Web.UI.Client/src/loader.js b/src/Umbraco.Web.UI.Client/src/loader.js index 54bf9e0413..9695ae0b59 100644 --- a/src/Umbraco.Web.UI.Client/src/loader.js +++ b/src/Umbraco.Web.UI.Client/src/loader.js @@ -1,3 +1,16 @@ +//global no-cache filter, this is enabled when we're in debug mode +//in live mode we use client dependency and don't turn this thing on +yepnope.addFilter(function (resourceObj) { + var url = resourceObj.url; + if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){ + return resourceObj; + } + + resourceObj.url = resourceObj.url + "?umb__rnd=" + (new Date).getTime(); + return resourceObj; +}); + + yepnope({ load: [ diff --git a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs index 5fd974b641..962354c575 100644 --- a/src/Umbraco.Web.UI/Properties/Settings.Designer.cs +++ b/src/Umbraco.Web.UI/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34003 +// Runtime Version:4.0.30319.18408 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -22,5 +22,14 @@ namespace Umbraco.Web.UI.Properties { return defaultInstance; } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("http://our.umbraco.org/umbraco/webservices/api/repository.asmx")] + public string Umbraco_Web_UI_org_umbraco_our_Repository { + get { + return ((string)(this["Umbraco_Web_UI_org_umbraco_our_Repository"])); + } + } } } diff --git a/src/Umbraco.Web.UI/Properties/Settings.settings b/src/Umbraco.Web.UI/Properties/Settings.settings index 2bd17f050c..5df40e9fea 100644 --- a/src/Umbraco.Web.UI/Properties/Settings.settings +++ b/src/Umbraco.Web.UI/Properties/Settings.settings @@ -1,5 +1,9 @@  - + - + + + http://our.umbraco.org/umbraco/webservices/api/repository.asmx + + \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml index 48925499d1..d7ce3ddb63 100644 --- a/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/Views/Default.cshtml @@ -8,6 +8,11 @@ @inherits System.Web.Mvc.WebViewPage @{ Layout = null; + + var applicationJs = Url.Action("Application", "BackOffice"); + if (GlobalSettings.DebugMode) { + applicationJs = applicationJs + "?umb__rnd=" + System.DateTime.Now.Ticks; + } } @@ -56,7 +61,7 @@ @*And finally we can load in our angular app*@ - + diff --git a/src/Umbraco.Web/Editors/SectionController.cs b/src/Umbraco.Web/Editors/SectionController.cs index f44be31eb1..a4bb0d9384 100644 --- a/src/Umbraco.Web/Editors/SectionController.cs +++ b/src/Umbraco.Web/Editors/SectionController.cs @@ -16,8 +16,8 @@ namespace Umbraco.Web.Editors { public IEnumerable
GetSections() { - return Services.SectionService.GetAllowedSections(UmbracoUser.Id) - .Select(Mapper.Map); + var sections = Services.SectionService.GetAllowedSections(UmbracoUser.Id); + return sections.Select(Mapper.Map); } } } \ No newline at end of file diff --git a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs index 51c780cfc2..4ba41d931a 100644 --- a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs @@ -41,8 +41,15 @@ namespace Umbraco.Web.UI.JavaScript public string GetJavascriptInitialization(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null) { var result = GetJavascriptInitializationArray(httpContext, umbracoInit, additionalJsFiles); + var noCache = ""; + + if (httpContext.IsDebuggingEnabled) + { + noCache = Resources.JsNoCache; + } return ParseMain( + noCache, result.ToString(), IOHelper.ResolveUrl(SystemDirectories.Umbraco)); } diff --git a/src/Umbraco.Web/UI/JavaScript/Main.js b/src/Umbraco.Web/UI/JavaScript/Main.js index c346fedb51..06d5cb79e8 100644 --- a/src/Umbraco.Web/UI/JavaScript/Main.js +++ b/src/Umbraco.Web/UI/JavaScript/Main.js @@ -1,3 +1,4 @@ +"##JsNoCache##" yepnope({ load: [ 'lib/jquery/jquery-2.0.3.min.js', diff --git a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs index e10fc651a0..8ed5d7332c 100644 --- a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs +++ b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18046 +// Runtime Version:4.0.30319.18408 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -62,23 +62,23 @@ namespace Umbraco.Web.UI.JavaScript { /// /// Looks up a localized string similar to [ - /// 'lib/jquery/jquery-1.8.2.min.js', - /// 'lib/jquery/jquery.cookie.js', - /// 'lib/angular/angular.min.js', - /// 'lib/bootstrap/js/bootstrap.js', - /// 'lib/underscore/underscore.js', - /// 'lib/umbraco/Extensions.js', + /// 'lib/jquery/jquery-ui-1.10.3.custom.min.js', /// - /// 'js/app.js', + /// /* + /// 'lib/jquery/jquery-ui-1.10.3.custom.min.js', + /// 'lib/jquery/jquery.ui.core.min.js', + /// 'lib/jquery/jquery.ui.widget.min.js', + /// 'lib/jquery/jquery.ui.mouse.min.js', + /// 'lib/jquery/jquery.ui.sortable.min.js', + /// */ /// - /// 'js/umbraco.resources.js', - /// 'js/umbraco.directives.js', - /// 'js/umbraco.filters.js', - /// 'js/umbraco.services.js', - /// 'js/umbraco.security.js', - /// 'js/umbraco.controllers.js', - /// 'js/routes.js' - ///]. + /// 'lib/angular/1.1.5/angular-cookies.min.js', + /// 'lib/angular/1.1.5/angular-mobile.js', + /// 'lib/angular/1.1.5/angular-sanitize.min.js', + /// + /// 'lib/angular/angular-ui-sortable.js', + /// + /// 'lib/jquery/jquery.u [rest of string was truncated]";. /// internal static string JsInitialize { get { @@ -87,18 +87,41 @@ namespace Umbraco.Web.UI.JavaScript { } /// - /// Looks up a localized string similar to yepnope({ - /// - /// load: "##JsInitialize##", - /// - /// complete: function () { - /// jQuery(document).ready(function () { - /// angular.bootstrap(document, ['umbraco']); - /// }); - /// + /// Looks up a localized string similar to yepnope.addFilter(function (resourceObj) { + /// var url = resourceObj.url; + /// if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){ + /// return resourceObj; /// } + /// + /// resourceObj.url = resourceObj.url + "?umb__rnd=" + (new Date).getTime(); + /// return resourceObj; ///});. /// + internal static string JsNoCache { + get { + return ResourceManager.GetString("JsNoCache", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "##JsNoCache##" + ///yepnope({ + /// load: [ + /// 'lib/jquery/jquery-2.0.3.min.js', + /// 'lib/angular/1.1.5/angular.min.js', + /// 'lib/underscore/underscore.js', + /// ], + /// complete: function () { + /// yepnope({ + /// load: "##JsInitialize##", + /// complete: function () { + /// + /// //we need to set the legacy UmbClientMgr path + /// UmbClientMgr.setUmbracoPath('"##UmbracoPath##"'); + /// + /// jQuery(document).ready(function () { + /// [rest of string was truncated]";. + /// internal static string Main { get { return ResourceManager.GetString("Main", resourceCulture); diff --git a/src/Umbraco.Web/UI/JavaScript/Resources.resx b/src/Umbraco.Web/UI/JavaScript/Resources.resx index a3e54b6805..40f04a0f90 100644 --- a/src/Umbraco.Web/UI/JavaScript/Resources.resx +++ b/src/Umbraco.Web/UI/JavaScript/Resources.resx @@ -121,6 +121,17 @@ jsinitialize.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 + + yepnope.addFilter(function (resourceObj) { + var url = resourceObj.url; + if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){ + return resourceObj; + } + + resourceObj.url = resourceObj.url + "?umb__rnd=" + (new Date).getTime(); + return resourceObj; +}); + Main.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index fff22e99dc..cb99c25451 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1997,6 +1997,7 @@ ResXFileCodeGenerator Resources.Designer.cs + Designer ResXFileCodeGenerator