/// <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 + "Mvc/Scripts/Angular/angular.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular-route.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Bootstrap/js/ui-bootstrap-tpls-0.11.0.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor-services.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Kendo/angular-kendo.js")); var currentPackage = new PackageManager().GetCurrentPackage(); if (!currentPackage.IsNullOrEmpty()) { var packageVar = "var sf_package = '{0}';".Arrange(currentPackage); ((ZoneEditor)@event.Sender).Page.ClientScript.RegisterStartupScript(@event.Sender.GetType(), "sf_package", packageVar + @"Sys.Net.WebRequestManager.add_invokingRequest(function (executor, args) { var url = args.get_webRequest().get_url(); if (url.indexOf('?') == -1) url += '?package=' + encodeURIComponent(sf_package); else url += '&package=' + encodeURIComponent(sf_package); args.get_webRequest().set_url(url); });", addScriptTags: true); } } }
/// <summary> /// Registering the scripts for ZoneEditor. /// </summary> /// <param name="event">The event.</param> private void RegisteringScriptsHandler(IScriptsRegisteringEvent @event) { var packagesManager = new PackagesManager(); if (@event.Sender.GetType() == typeof(ZoneEditor)) { var scriptRootPath = "~/" + MvcIntegrationManager.GetVirtualPathBuilder().GetVirtualPath(this.GetType().Assembly); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular-route.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Bootstrap/js/ui-bootstrap-tpls-0.10.0.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/ModalDialogModule.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/ControlPropertyServices.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Kendo/angular-kendo.js")); var currentPackage = packagesManager.GetCurrentPackage(); if (!currentPackage.IsNullOrEmpty()) { var packageVar = "var sf_package = '{0}';".Arrange(currentPackage); ((ZoneEditor)@event.Sender).Page.ClientScript.RegisterStartupScript(@event.Sender.GetType(), "sf_package", packageVar + @"Sys.Net.WebRequestManager.add_invokingRequest(function (executor, args) { var url = args.get_webRequest().get_url(); if (url.indexOf('?') == -1) url += '?package=' + encodeURIComponent(sf_package); else url += '&package=' + encodeURIComponent(sf_package); args.get_webRequest().set_url(url); });", addScriptTags: true); } } }
private static void RegisteringFormScriptsHandler(IScriptsRegisteringEvent @event) { var zoneEditor = @event.Sender as ZoneEditor; if (zoneEditor != null && zoneEditor.MediaType == DesignMediaType.Form) { @event.Scripts.Add(new ScriptReference(string.Format("~/Frontend-Assembly/{0}/Mvc/Scripts/Form/form.js", typeof(Initializer).Assembly.GetName().Name))); } }
private static void RegisteringFormScriptsHandler(IScriptsRegisteringEvent @event) { var zoneEditor = @event.Sender as ZoneEditor; if (zoneEditor != null && zoneEditor.MediaType == DesignMediaType.Form) { @event.Scripts.Add(new ScriptReference(string.Format("~/Frontend-Assembly/{0}/Mvc/Scripts/Form/form.js", typeof(Initializer).Assembly.GetName().Name))); } }
/// <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 + "Mvc/Scripts/Angular/angular.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular-route.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "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 + "Designers/Scripts/page-editor-services.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "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); var zoneEditor = @event.Sender as ZoneEditor; if (zoneEditor != null) { var urlhelper = new UrlHelper(HttpContext.Current.Request.RequestContext); var url = urlhelper.Content("~/ResourcePackages/{0}/assets/dist/css/styles.min.css".Arrange(currentPackage)); var packageStyleMarkup = "<link rel=\"stylesheet\" type=\"text/css\" href=\"{0}\">".Arrange(url); var packageStyleLiteralControl = new LiteralControl(packageStyleMarkup); zoneEditor.Page.Header.Controls.Add(packageStyleLiteralControl); } } } }
/// <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 + "Mvc/Scripts/Angular/angular.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular-route.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "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 + "Designers/Scripts/page-editor-services.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "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); var zoneEditor = @event.Sender as ZoneEditor; if (zoneEditor != null) { var urlhelper = new UrlHelper(HttpContext.Current.Request.RequestContext); var url = urlhelper.Content("~/ResourcePackages/{0}/assets/dist/css/styles.min.css".Arrange(currentPackage)); var packageStyleMarkup = "<link rel=\"stylesheet\" type=\"text/css\" href=\"{0}\">".Arrange(url); var packageStyleLiteralControl = new LiteralControl(packageStyleMarkup); zoneEditor.Page.Header.Controls.Add(packageStyleLiteralControl); } } } }
/// <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 + "Mvc/Scripts/Angular/angular.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Angular/angular-route.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Bootstrap/js/ui-bootstrap-tpls-0.11.0.min.js")); ////var references = PageManager.GetScriptReferences(ScriptRef.KendoAll); ////foreach (var scriptRef in references) ////{ //// @event.Scripts.Add(scriptRef); ////} @event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Kendo/kendo.all.min.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor-services.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "Designers/Scripts/page-editor.js")); ////@event.Scripts.Add(new ScriptReference(scriptRootPath + "Mvc/Scripts/Kendo/angular-kendo.js")); @event.Scripts.Add(new ScriptReference(scriptRootPath + "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); } } }