diff --git a/src/Umbraco.Tests/AngularIntegration/JsInitializationTests.cs b/src/Umbraco.Tests/AngularIntegration/JsInitializationTests.cs index 391b4ac525..6ce23fb216 100644 --- a/src/Umbraco.Tests/AngularIntegration/JsInitializationTests.cs +++ b/src/Umbraco.Tests/AngularIntegration/JsInitializationTests.cs @@ -24,11 +24,9 @@ namespace Umbraco.Tests.AngularIntegration [Test] public void Parse_Main() { - var noCache = Resources.JsNoCache; - noCache = noCache.Replace("##rnd##", "(new Date).getTime()"); - var result = JsInitialization.ParseMain(new[] { noCache, "[World]", "Hello" }); + var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" }); - Assert.AreEqual(noCache + @" + Assert.AreEqual(@" yepnope({ load: [ 'lib/jquery/jquery-2.0.3.min.js', diff --git a/src/Umbraco.Web.UI.Client/README.md b/src/Umbraco.Web.UI.Client/README.md index 99e9ae1b01..6001d65271 100644 --- a/src/Umbraco.Web.UI.Client/README.md +++ b/src/Umbraco.Web.UI.Client/README.md @@ -1,12 +1,12 @@ #Belle -Umbraco 7 UI, codename "Belle" Built on AngularJS, RequireJS and Twitter Bootstrap +Umbraco 7 UI, codename "Belle" Built on AngularJS, bower, Lazyload.js and Twitter Bootstrap ##Introduction Slides from the initial demonstration of Belle done at the Umbraco DK Fest can be found here: -http://rawgithub.com/umbraco/Belle/master/Presentation/index.html +http://rawgithub.com/umbraco/Umbraco.Web.Ui.Client/build/master/Presentation/index.html ##Running the site with mocked data @@ -63,23 +63,23 @@ after building Belle files are located in /build/belle, with all files following conventions: ###Folders -- */belle/lib:* Dependencies -- */belle/js:* Application javascript files -- */belle/views/common/:* Main application views -- */belle/views/[sectioname]/pagename Editors html -- */belle/views/propertyeditors:* Property Editors html +- */Umbraco.Web.Ui.Client/build/lib:* Dependencies +- */Umbraco.Web.Ui.Client/build/js:* Application javascript files +- */Umbraco.Web.Ui.Client/build/views/common/:* Main application views +- */Umbraco.Web.Ui.Client/build/views/[sectioname]/pagename Editors html +- */Umbraco.Web.Ui.Client/build/views/propertyeditors:* Property Editors html ###Files -- */belle/js/app.js:* Main umbraco application / modules -- */belle/js/loader.js:* yepnope configuration for dependencies -- */belle/js/routes.js:* Application routes -- */belle/js/umbraco.controllers.js:* Application controllers -- */belle/js/umbraco.services.js:* Application services -- */belle/js/umbraco.filters.js:* Application filters -- */belle/js/umbraco.directives.js:* Application directives -- */belle/js/umbraco.resources.js:* Application resources, like content, media, users, members etc -- */belle/js/umbraco.mocks.js:* Fake Application resources, for running the app without a server +- */Umbraco.Web.Ui.Client/build/js/app.js:* Main umbraco application / modules +- */Umbraco.Web.Ui.Client/build/js/loader.js:* lazyload configuration for dependencies +- */Umbraco.Web.Ui.Client/build/js/routes.js:* Application routes +- */Umbraco.Web.Ui.Client/build/js/umbraco.controllers.js:* Application controllers +- */Umbraco.Web.Ui.Client/build/js/umbraco.services.js:* Application services +- */Umbraco.Web.Ui.Client/build/js/umbraco.filters.js:* Application filters +- */Umbraco.Web.Ui.Client/build/js/umbraco.directives.js:* Application directives +- */Umbraco.Web.Ui.Client/build/js/umbraco.resources.js:* Application resources, like content, media, users, members etc +- */Umbraco.Web.Ui.Client/build/js/umbraco.mocks.js:* Fake Application resources, for running the app without a server ##Getting started The current app is built, following conventions from angularJs and bootstrap. To get started with the applicaton you will need to atleast know the basics of these frameworks diff --git a/src/Umbraco.Web.UI.Client/docs/src/api/index.ngdoc b/src/Umbraco.Web.UI.Client/docs/src/api/index.ngdoc index 4dc281a29b..a7cf500744 100644 --- a/src/Umbraco.Web.UI.Client/docs/src/api/index.ngdoc +++ b/src/Umbraco.Web.UI.Client/docs/src/api/index.ngdoc @@ -4,7 +4,7 @@ #Belle -Umbraco 7 UI, codename "Belle" Built on AngularJS, YepNope and Twitter Bootstrap +Umbraco 7 UI, codename "Belle" Built on AngularJS, Lazyload.js and Twitter Bootstrap ##Introduction Slides from the initial demonstration of Belle done at the Umbraco DK Fest can be found here: diff --git a/src/Umbraco.Web.UI.Client/docs/src/tutorials/Source-Code-Structure.ngdoc b/src/Umbraco.Web.UI.Client/docs/src/tutorials/Source-Code-Structure.ngdoc index bd7032ecef..9c7f5698d2 100644 --- a/src/Umbraco.Web.UI.Client/docs/src/tutorials/Source-Code-Structure.ngdoc +++ b/src/Umbraco.Web.UI.Client/docs/src/tutorials/Source-Code-Structure.ngdoc @@ -70,7 +70,7 @@ Folder containing various sample projects on how to use the external api, good f The central application script, which handles what modules to inject, app.js is for production, app.dev.js is for testing ###loader.js -yepnope.js based loader for async loading javascript files, this file specifies what files to load on application start +lazyload.js based loader for async loading javascript files, this file specifies what files to load on application start ###routes.js Routing setup for /umbraco/ pages, by default it contains a mvc-like convention based pattern, which means that we not very often need to modify this. diff --git a/src/Umbraco.Web.UI.Client/lib/lazyload/empty.js b/src/Umbraco.Web.UI.Client/lib/lazyload/empty.js new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Umbraco.Web.UI.Client/lib/yepnope/empty.js b/src/Umbraco.Web.UI.Client/lib/yepnope/empty.js deleted file mode 100644 index a459db6331..0000000000 --- a/src/Umbraco.Web.UI.Client/lib/yepnope/empty.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() { - //this is empty for mock sesions -})(); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js b/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js deleted file mode 100644 index da934c045a..0000000000 --- a/src/Umbraco.Web.UI.Client/lib/yepnope/yepnope.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*yepnope1.5.x|WTFPL*/ -(function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f
- + diff --git a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js index fd68af3673..d7d5786246 100644 --- a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js +++ b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js @@ -25,7 +25,7 @@ module.exports = function(karma) { 'lib/underscore/underscore.js', 'lib/umbraco/Extensions.js', - 'lib/yepnope/yepnope.min.js', + 'lib/lazyload/lazyload.min.js', 'test/config/app.unit.js', @@ -94,15 +94,8 @@ module.exports = function(karma) { // CLI --report-slower-than 500 reportSlowerThan: 500, - // compile coffee scripts - preprocessors: { - '**/*.coffee': 'coffee' - }, - plugins: [ 'karma-jasmine', - 'karma-chrome-launcher', - 'karma-firefox-launcher', 'karma-phantomjs-launcher' ] }); diff --git a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml index f55dd6a96f..2e920de45e 100644 --- a/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml +++ b/src/Umbraco.Web.UI/Umbraco/Views/AuthorizeUpgrade.cshtml @@ -54,7 +54,7 @@ @*And finally we can load in our angular app*@ - + diff --git a/src/Umbraco.Web.UI/Umbraco/js/install.loader.js b/src/Umbraco.Web.UI/Umbraco/js/install.loader.js index c7b4bb0473..a9699283fa 100644 --- a/src/Umbraco.Web.UI/Umbraco/js/install.loader.js +++ b/src/Umbraco.Web.UI/Umbraco/js/install.loader.js @@ -1,8 +1,5 @@ -yepnope({ - - load: [ +LazyLoad.js( [ 'lib/jquery/jquery-2.0.3.min.js', - /* 1.1.5 */ 'lib/angular/1.1.5/angular.min.js', 'lib/angular/1.1.5/angular-cookies.min.js', @@ -11,12 +8,9 @@ yepnope({ 'lib/angular/1.1.5/angular-sanitize.min.js', 'lib/underscore/underscore.js', 'js/umbraco.installer.js' - ], - - complete: function () { + ], function () { jQuery(document).ready(function () { - angular.bootstrap(document, ['ngSanitize', 'umbraco.install']); }); } -}); \ No newline at end of file +); \ No newline at end of file diff --git a/src/Umbraco.Web.UI/umbraco/Install/Views/Index.cshtml b/src/Umbraco.Web.UI/umbraco/Install/Views/Index.cshtml index 1374130c12..5673ceff68 100644 --- a/src/Umbraco.Web.UI/umbraco/Install/Views/Index.cshtml +++ b/src/Umbraco.Web.UI/umbraco/Install/Views/Index.cshtml @@ -54,7 +54,7 @@ "umbracoBaseUrl": "@ViewBag.UmbracoBaseFolder" }; - + diff --git a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs index 776129484c..ff52a6b65d 100644 --- a/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs +++ b/src/Umbraco.Web/UI/JavaScript/JsInitialization.cs @@ -45,24 +45,13 @@ namespace Umbraco.Web.UI.JavaScript public string GetJavascriptInitialization(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null) { var result = GetJavascriptInitializationArray(httpContext, umbracoInit, additionalJsFiles); - var noCache = Resources.JsNoCache; - - //if debugging, add timestamp, if in production we tell yepNope to append umb+cdf version - //this is needed even tho cdf does this on its serverside merged js - //as assetsService.load() also need to append these versions to ensure cache bursting on updates + pack installs - if (httpContext.IsDebuggingEnabled) - noCache = noCache.Replace("##rnd##", "(new Date).getTime()"); - else - { - //create a unique hash code of the current umb version and the current cdf version - var versionHash = UrlHelperExtensions.GetCacheBustHash(); - var version = "'" + versionHash + "'"; - noCache = noCache.Replace("##rnd##", version); - } + //create a unique hash code of the current umb version and the current cdf version + var versionHash = UrlHelperExtensions.GetCacheBustHash(); + var version = "'" + versionHash + "'"; - return ParseMain( - result.ToString(), - IOHelper.ResolveUrl(SystemDirectories.Umbraco)); + return ParseMain( + result.ToString(), + IOHelper.ResolveUrl(SystemDirectories.Umbraco)); } public JArray GetJavascriptInitializationArray(HttpContextBase httpContext, JArray umbracoInit, JArray additionalJsFiles = null) diff --git a/src/Umbraco.Web/UI/JavaScript/JsNoCache.js b/src/Umbraco.Web/UI/JavaScript/JsNoCache.js deleted file mode 100644 index 9cb7d38dc5..0000000000 --- a/src/Umbraco.Web/UI/JavaScript/JsNoCache.js +++ /dev/null @@ -1,15 +0,0 @@ -yepnope.addFilter(function (resourceObj) { - var url = resourceObj.url.toLowerCase(); - var rnd = ##rnd##; - var op = "?"; - if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0 || url.indexOf("dependencyhandler.axd") > 0) { - - return resourceObj; - } - if(url.indexOf("?") > 0){ - op = "&"; - } - - resourceObj.url = resourceObj.url + op + "umb__rnd=" + rnd; - return resourceObj; -}); \ No newline at end of file diff --git a/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs b/src/Umbraco.Web/UI/JavaScript/Resources.Designer.cs index 626bd8d54d..3b8bfd9385 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.34011 +// Runtime Version:4.0.30319.18444 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -62,15 +62,11 @@ namespace Umbraco.Web.UI.JavaScript { /// /// Looks up a localized string similar to [ - /// 'lib/jquery/jquery-ui-1.10.3.custom.min.js', + /// 'lib/jquery/jquery-2.0.3.min.js', + /// 'lib/angular/1.1.5/angular.min.js', + /// 'lib/underscore/underscore.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', - /// */ /// /// 'lib/angular/1.1.5/angular-cookies.min.js', /// 'lib/angular/1.1.5/angular-mobile.js', @@ -78,7 +74,9 @@ namespace Umbraco.Web.UI.JavaScript { /// /// 'lib/angular/angular-ui-sortable.js', /// - /// 'lib/jquery/jquery.u [rest of string was truncated]";. + /// 'lib/jquery/jquery.upload/js/jquery.fileupload.js', + /// 'lib/jquery/jquery.upload/js/load-image.min.js', + /// 'lib/jquery/jquery.upload/js/ [rest of string was truncated]";. /// internal static string JsInitialize { get { @@ -87,46 +85,15 @@ namespace Umbraco.Web.UI.JavaScript { } /// - /// Looks up a localized string similar to yepnope.addFilter(function (resourceObj) { - /// var url = resourceObj.url; - /// var rnd = ##rnd##; - /// var _op = "?"; - /// if(url.indexOf("lib/") === 0 || url.indexOf("js/umbraco.") === 0){ - /// return resourceObj; - /// } - /// if(url.indexOf("?") > 0){ - /// _op = "&"; - /// } + /// Looks up a localized string similar to LazyLoad.js("##JsInitialize##", function () { + /// //we need to set the legacy UmbClientMgr path + /// UmbClientMgr.setUmbracoPath('"##UmbracoPath##"'); /// - /// resourceObj.url = resourceObj.url + _op + "umb__rnd=" + rnd; - /// return resourceObj; + /// jQuery(document).ready(function () { + /// angular.bootstrap(document, ['umbraco']); + /// }); ///});. /// - 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 3c99af3c60..a3e54b6805 100644 --- a/src/Umbraco.Web/UI/JavaScript/Resources.resx +++ b/src/Umbraco.Web/UI/JavaScript/Resources.resx @@ -121,9 +121,6 @@ jsinitialize.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - jsnocache.js;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 - 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 0277324e27..5a18e0b5cf 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -1840,7 +1840,6 @@ -