/// <summary> /// Registering the scripts for ZoneEditor. /// </summary> /// <param name="event">The event.</param> private void RegisteringScriptsHandler(IScriptsRegisteringEvent @event) { if (@event.Sender.GetType() == typeof(ZoneEditor)) { var scriptRootPath = "~/" + FrontendManager.VirtualPathBuilder.GetVirtualPath(this.GetType().Assembly); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Mvc/Scripts/Angular/angular.min.js"))); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Mvc/Scripts/Angular/angular-route.min.js"))); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Mvc/Scripts/Angular/angular-sanitize.min.js"))); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Mvc/Scripts/Bootstrap/js/ui-bootstrap-tpls.min.js"))); ////var references = PageManager.GetScriptReferences(ScriptRef.KendoAll); ////foreach (var scriptRef in references) ////{ //// @event.Scripts.Add(scriptRef); ////} @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Designers/Scripts/page-editor-services.js"))); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Designers/Scripts/page-editor.js"))); @event.Scripts.Add(new ScriptReference(scriptRootPath + UrlHelpers.AppendVersion("Mvc/Scripts/LABjs/LAB.min.js"))); var currentPackage = new PackageManager().GetCurrentPackage(); if (!currentPackage.IsNullOrEmpty()) { var sb = new StringBuilder(); sb.AppendLine(@"Sys.Net.WebRequestManager.add_invokingRequest(function (executor, args) {"); sb.AppendLine("var url = args.get_webRequest().get_url();"); sb.AppendLine("if (url.indexOf('?') == -1)"); sb.AppendLine(" url += '?package=' + encodeURIComponent(sf_package);"); sb.AppendLine("else"); sb.AppendLine(" url += '&package=' + encodeURIComponent(sf_package); "); sb.AppendLine("args.get_webRequest().set_url(url); "); sb.AppendLine("});"); var packageVar = "var sf_package = '{0}';".Arrange(currentPackage); ((ZoneEditor)@event.Sender).Page.ClientScript.RegisterStartupScript( @event.Sender.GetType(), "sf_package", packageVar + sb, addScriptTags: true); } } }