This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = false, Inherited = true)] | |
public class DebugBundlingAttribute : ActionFilterAttribute | |
{ | |
private const string DEBUG_MODE_SESSION_KEY = "BundlingDebugMode"; | |
public bool PersistPerSession { get; set; } | |
public DebugBundlingAttribute() | |
{ | |
PersistPerSession = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var appJs = new ScriptBundle("~/assets/app-js") | |
.Include( | |
"~/assets/scripts/main.js" | |
); | |
appJs.Transforms.Clear(); | |
appJs.Transforms.Add(new ConfigurableJsMinify | |
{ | |
CodeSettings = new CodeSettings | |
{ | |
EvalTreatment = EvalTreatment.MakeImmediateSafe, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs") | |
port = process.argv[2] || 8888, | |
mimeTypes = { | |
"html": "text/html", | |
"jpeg": "image/jpeg", | |
"jpg": "image/jpeg", | |
"png": "image/png", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes.MapContentRoute( | |
name: "Search", | |
url: "{language}/{node}/{event}/{location}/{action}", | |
defaults: new { action = "Index", @event = UrlParameter.Optional, location = UrlParameter.Optional }, | |
parameters: new MapContentRouteParameters { | |
Constraints = new { node = new ContentTypeConstraint<SearchPage>(matchInheritedTypes: true) } | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web.Mvc; | |
namespace Project.Core.Mvc.Routing { | |
/* | |
// Example of using the modelbinder: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using System.Web.Routing; | |
using EPiServer.Web.Routing; | |
using EPiServer.Web.Routing.Segments; | |
namespace Project.Core.Mvc.Routing { | |
public static class SegmentRouteCollectionExtensions { | |
public static ContentRoute MapContentRouteWithSegments(this RouteCollection routes, string name, string url, object defaults, params ISegment[] segments) { | |
return routes.MapContentRouteWithSegments(name, url, defaults, null, segments); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clipboard = {}; | |
Clipboard.utilities = {}; | |
Clipboard.utilities.createTextArea = function(value) { | |
var txt = document.createElement('textarea'); | |
txt.style.position = "absolute"; | |
txt.style.left = "-100%"; | |
if (value != null) | |
txt.value = value; |