forked from Teknikode/Teknik
Browse Source
Changed method of routing so that on dev, you use the sub param instead of an additional directory.master
95 changed files with 5501 additions and 344 deletions
@ -1,140 +1,130 @@
@@ -1,140 +1,130 @@
|
||||
๏ปฟusing System.Web.Mvc; |
||||
๏ปฟusing System.Collections.Generic; |
||||
using System.Web.Mvc; |
||||
using System.Web.Routing; |
||||
|
||||
namespace Teknik |
||||
{ |
||||
public static class SubdomainRouteExtension |
||||
{ |
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string url, object defaults) |
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, List<string> subDomains, string url, object defaults) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new MvcRouteHandler()); |
||||
routes.Add(AddSubToName(subDomain, name), route); |
||||
routes.Add(name, route); |
||||
|
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string url, object defaults, object constraints) |
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, List<string> subDomains, string url, object defaults, object constraints) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(constraints), |
||||
new MvcRouteHandler()); |
||||
routes.Add(AddSubToName(subDomain, name), route); |
||||
routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, string subDomain, string area, string url, object defaults, string[] namespaces) |
||||
public static SubdomainRoute MapSubdomainRoute(this RouteCollection routes, string name, List<string> subDomains, string area, string url, object defaults, string[] namespaces) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(new { }), |
||||
new RouteValueDictionary(new { Area = area, Namespaces = namespaces }), |
||||
new MvcRouteHandler()); |
||||
routes.Add(AddSubToName(subDomain, name), route); |
||||
routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, object defaults) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(new {}), |
||||
new RouteValueDictionary(new {Area = context.AreaName}), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults, object constraints) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, object defaults, object constraints) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(constraints), |
||||
new RouteValueDictionary(new {Area = context.AreaName}), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, object defaults, string[] namespaces) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, object defaults, string[] namespaces) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(new {}), |
||||
new RouteValueDictionary(new { Area = context.AreaName, Namespaces = namespaces }), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, string area, object defaults) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(new { }), |
||||
new RouteValueDictionary(new { Area = area }), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults, object constraints) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, string area, object defaults, object constraints) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(constraints), |
||||
new RouteValueDictionary(new { Area = area }), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, string subDomain, string url, string area, object defaults, string[] namespaces) |
||||
public static SubdomainRoute MapSubdomainRoute(this AreaRegistrationContext context, string name, List<string> subDomains, string url, string area, object defaults, string[] namespaces) |
||||
{ |
||||
SubdomainRoute route = new SubdomainRoute( |
||||
subDomain, |
||||
subDomains, |
||||
url, |
||||
new RouteValueDictionary(defaults), |
||||
new RouteValueDictionary(new { }), |
||||
new RouteValueDictionary(new { Area = area, Namespaces = namespaces }), |
||||
new MvcRouteHandler()); |
||||
|
||||
context.Routes.Add(AddSubToName(subDomain, name), route); |
||||
context.Routes.Add(name, route); |
||||
return route; |
||||
} |
||||
|
||||
private static string AddSubToName(string sub, string name) |
||||
{ |
||||
string newName = name; |
||||
if (!string.IsNullOrEmpty(sub)) |
||||
{ |
||||
newName = sub + "." + name; |
||||
} |
||||
|
||||
return newName; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Web; |
||||
using System.Web.Mvc; |
||||
using Teknik.Controllers; |
||||
|
||||
namespace Teknik.Areas.Paste.Controllers |
||||
{ |
||||
public class PasteController : DefaultController |
||||
{ |
||||
// GET: Paste/Paste
|
||||
public ActionResult Index() |
||||
{ |
||||
return View(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace Teknik.Areas.Paste.Models |
||||
{ |
||||
public class Paste |
||||
{ |
||||
|
||||
} |
||||
} |
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
๏ปฟusing System.Collections.Generic; |
||||
using System.Web.Mvc; |
||||
using System.Web.Optimization; |
||||
|
||||
namespace Teknik.Areas.Paste |
||||
{ |
||||
public class PasteAreaRegistration : AreaRegistration |
||||
{ |
||||
public override string AreaName |
||||
{ |
||||
get |
||||
{ |
||||
return "Paste"; |
||||
} |
||||
} |
||||
|
||||
public override void RegisterArea(AreaRegistrationContext context) |
||||
{ |
||||
context.MapSubdomainRoute( |
||||
"Paste.Index", // Route name
|
||||
new List<string>() { "dev", "paste", "p" }, |
||||
"", // URL with parameters
|
||||
new { controller = "Paste", action = "Index" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.PasteController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Paste.View", // Route name
|
||||
new List<string>() { "dev", "paste", "p" }, |
||||
"{id}", // URL with parameters
|
||||
new { controller = "Paste", action = "View" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.PasteController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Paste.Simple", // Route name
|
||||
new List<string>() { "dev", "paste", "p" }, |
||||
"Simple/{id}", // URL with parameters
|
||||
new { controller = "Paste", action = "Simple" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.PasteController).Namespace } |
||||
); |
||||
context.MapSubdomainRoute( |
||||
"Paste.Raw", // Route name
|
||||
new List<string>() { "dev", "paste", "p" }, |
||||
"Raw/{id}", // URL with parameters
|
||||
new { controller = "Paste", action = "Raw" }, // Parameter defaults
|
||||
new[] { typeof(Controllers.PasteController).Namespace } |
||||
); |
||||
|
||||
// Register Script Bundles
|
||||
BundleTable.Bundles.Add(new ScriptBundle("~/bundles/paste").Include( |
||||
"~/Scripts/Highlight/highlight.pack.js")); |
||||
// Register Style Bundles
|
||||
BundleTable.Bundles.Add(new StyleBundle("~/Content/paste").Include( |
||||
"~/Content/Highlight/default.css")); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,13 @@
@@ -0,0 +1,13 @@
|
||||
๏ปฟusing System; |
||||
using System.Collections.Generic; |
||||
using System.Linq; |
||||
using System.Text; |
||||
using System.Threading.Tasks; |
||||
using Teknik.ViewModels; |
||||
|
||||
namespace Teknik.Areas.Paste.ViewModels |
||||
{ |
||||
public class PasteViewModel : ViewModelBase |
||||
{ |
||||
} |
||||
} |
@ -0,0 +1,4 @@
@@ -0,0 +1,4 @@
|
||||
๏ปฟ@model Teknik.Areas.Paste.ViewModels.PasteViewModel |
||||
|
||||
@Styles.Render("~/Content/paste"); |
||||
@Scripts.Render("~/bundles/paste"); |
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
๏ปฟ@{ |
||||
Layout = "~/Views/Shared/_Layout.cshtml"; |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
๏ปฟ<?xml version="1.0"?> |
||||
|
||||
<configuration> |
||||
<configSections> |
||||
<sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> |
||||
<section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> |
||||
<section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> |
||||
</sectionGroup> |
||||
</configSections> |
||||
|
||||
<system.web.webPages.razor> |
||||
<host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> |
||||
<pages pageBaseType="System.Web.Mvc.WebViewPage"> |
||||
<namespaces> |
||||
<add namespace="System.Web.Mvc" /> |
||||
<add namespace="System.Web.Mvc.Ajax" /> |
||||
<add namespace="System.Web.Mvc.Html" /> |
||||
<add namespace="System.Web.Routing" /> |
||||
<add namespace="System.Web.Optimization" /> |
||||
<add namespace="Teknik" /> |
||||
|
||||
</namespaces> |
||||
</pages> |
||||
</system.web.webPages.razor> |
||||
|
||||
<appSettings> |
||||
<add key="webpages:Enabled" value="false" /> |
||||
</appSettings> |
||||
|
||||
<system.webServer> |
||||
<handlers> |
||||
<remove name="BlockViewHandler"/> |
||||
<add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> |
||||
</handlers> |
||||
</system.webServer> |
||||
</configuration> |
@ -0,0 +1,108 @@
@@ -0,0 +1,108 @@
|
||||
/*! |
||||
* Agate by Taufik Nurrohman <https://github.com/tovic> |
||||
* ---------------------------------------------------- |
||||
* |
||||
* #ade5fc |
||||
* #a2fca2 |
||||
* #c6b4f0 |
||||
* #d36363 |
||||
* #fcc28c |
||||
* #fc9b9b |
||||
* #ffa |
||||
* #fff |
||||
* #333 |
||||
* #62c8f3 |
||||
* #888 |
||||
* |
||||
*/ |
||||
|
||||
.hljs { |
||||
display: block; |
||||
overflow-x: auto; |
||||
padding: 0.5em; |
||||
background: #333; |
||||
color: white; |
||||
} |
||||
|
||||
.hljs-name, |
||||
.hljs-strong { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hljs-code, |
||||
.hljs-emphasis { |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hljs-tag { |
||||
color: #62c8f3; |
||||
} |
||||
|
||||
.hljs-variable, |
||||
.hljs-template-variable, |
||||
.hljs-selector-id, |
||||
.hljs-selector-class { |
||||
color: #ade5fc; |
||||
} |
||||
|
||||
.hljs-string, |
||||
.hljs-bullet { |
||||
color: #a2fca2; |
||||
} |
||||
|
||||
.hljs-type, |
||||
.hljs-title, |
||||
.hljs-section, |
||||
.hljs-attribute, |
||||
.hljs-quote, |
||||
.hljs-built_in, |
||||
.hljs-builtin-name { |
||||
color: #ffa; |
||||
} |
||||
|
||||
.hljs-number, |
||||
.hljs-symbol, |
||||
.hljs-bullet { |
||||
color: #d36363; |
||||
} |
||||
|
||||
.hljs-keyword, |
||||
.hljs-selector-tag, |
||||
.hljs-literal { |
||||
color: #fcc28c; |
||||
} |
||||
|
||||
.hljs-comment, |
||||
.hljs-deletion, |
||||
.hljs-code { |
||||
color: #888; |
||||
} |
||||
|
||||
.hljs-regexp, |
||||
.hljs-link { |
||||
color: #c6b4f0; |
||||
} |
||||
|
||||
.hljs-meta { |
||||
color: #fc9b9b; |
||||
} |
||||
|
||||
.hljs-deletion { |
||||
background-color: #fc9b9b; |
||||
color: #333; |
||||
} |
||||
|
||||
.hljs-addition { |
||||
background-color: #a2fca2; |
||||
color: #333; |
||||
} |
||||
|
||||
.hljs a { |
||||
color: inherit; |
||||
} |
||||
|
||||
.hljs a:focus, |
||||
.hljs a:hover { |
||||
color: inherit; |
||||
text-decoration: underline; |
||||
} |
@ -0,0 +1,66 @@
@@ -0,0 +1,66 @@
|
||||
/* |
||||
Date: 24 Fev 2015 |
||||
Author: Pedro Oliveira <kanytu@gmail . com> |
||||
*/ |
||||
|
||||
.hljs { |
||||
color: #a9b7c6; |
||||
background: #282b2e; |
||||
display: block; |
||||
overflow-x: auto; |
||||
padding: 0.5em; |
||||
} |
||||
|
||||
.hljs-number, |
||||
.hljs-literal, |
||||
.hljs-symbol, |
||||
.hljs-bullet { |
||||
color: #6897BB; |
||||
} |
||||
|
||||
.hljs-keyword, |
||||
.hljs-selector-tag, |
||||
.hljs-deletion { |
||||
color: #cc7832; |
||||
} |
||||
|
||||
.hljs-variable, |
||||
.hljs-template-variable, |
||||
.hljs-link { |
||||
color: #629755; |
||||
} |
||||
|
||||
.hljs-comment, |
||||
.hljs-quote { |
||||
color: #808080; |
||||
} |
||||
|
||||
.hljs-meta { |
||||
color: #bbb529; |
||||
} |
||||
|
||||
.hljs-string, |
||||
.hljs-attribute, |
||||
.hljs-addition { |
||||
color: #6A8759; |
||||
} |
||||
|
||||
.hljs-section, |
||||
.hljs-title, |
||||
.hljs-type { |
||||
color: #ffc66d; |
||||
} |
||||
|
||||
.hljs-name, |
||||
.hljs-selector-id, |
||||
.hljs-selector-class { |
||||
color: #e8bf6a; |
||||
} |
||||
|
||||
.hljs-emphasis { |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hljs-strong { |
||||
font-weight: bold; |
||||
} |
@ -0,0 +1,88 @@
@@ -0,0 +1,88 @@
|
||||
/* |
||||
|
||||
Arduinoยฎ Light Theme - Stefania Mellai <s.mellai@arduino.cc> |
||||
|
||||
*/ |
||||
|
||||
.hljs { |
||||
display: block; |
||||
overflow-x: auto; |
||||
padding: 0.5em; |
||||
background: #FFFFFF; |
||||
} |
||||
|
||||
.hljs, |
||||
.hljs-subst { |
||||
color: #434f54; |
||||
} |
||||
|
||||
.hljs-keyword, |
||||
.hljs-attribute, |
||||
.hljs-selector-tag, |
||||
.hljs-doctag, |
||||
.hljs-name { |
||||
color: #00979D; |
||||
} |
||||
|
||||
.hljs-built_in, |
||||
.hljs-literal, |
||||
.hljs-bullet, |
||||
.hljs-code, |
||||
.hljs-addition { |
||||
color: #D35400; |
||||
} |
||||
|
||||
.hljs-regexp, |
||||
.hljs-symbol, |
||||
.hljs-variable, |
||||
.hljs-template-variable, |
||||
.hljs-link, |
||||
.hljs-selector-attr, |
||||
.hljs-selector-pseudo { |
||||
color: #00979D; |
||||
} |
||||
|
||||
.hljs-type, |
||||
.hljs-string, |
||||
.hljs-selector-id, |
||||
.hljs-selector-class, |
||||
.hljs-quote, |
||||
.hljs-template-tag, |
||||
.hljs-deletion { |
||||
color: #005C5F; |
||||
} |
||||
|
||||
.hljs-title, |
||||
.hljs-section { |
||||
color: #880000; |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hljs-comment { |
||||
color: rgba(149,165,166,.8); |
||||
} |
||||
|
||||
.hljs-meta-keyword { |
||||
color: #728E00; |
||||
} |
||||
|
||||
.hljs-meta { |
||||
color: #728E00; |
||||
color: #434f54; |
||||
} |
||||
|
||||
.hljs-emphasis { |
||||
font-style: italic; |
||||
} |
||||
|
||||
.hljs-strong { |
||||
font-weight: bold; |
||||
} |
||||
|
||||
.hljs-function { |
||||
color: #728E00; |
||||
} |
||||
|
||||
.hljs-number { |
||||
color: #8A7B52; |
||||
} |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
/* |
||||
Date: 17.V.2011 |
||||
Author: pumbur <pumbur@pumbur.net> |
||||
*/ |
||||
|
||||
.hljs { |
||||
display: block; |
||||
overflow-x: auto; |
||||
padding: 0.5em; |
||||
background: #222; |
||||
} |
||||
|
||||
.hljs, |
||||
.hljs-subst { |
||||
color: #aaa; |
||||
} |
||||
|
||||
.hljs-section { |
||||
color: #fff; |
||||
} |
||||
|
||||
.hljs-comment, |
||||
.hljs-quote, |
||||
.hljs-meta { |
||||
color: #444; |
||||
} |
||||
|
||||
.hljs-string, |
||||
.hljs-symbol, |
||||
.hljs-bullet, |
||||
.hljs-regexp { |
||||
color: #ffcc33; |
||||
} |
||||
|
||||
.hljs-number, |
||||
.hljs-addition { |
||||
color: #00cc66; |
||||
} |
||||
|
||||
.hljs-built_in, |
||||
.hljs-builtin-name, |
||||
.hljs-literal, |
||||
.hljs-type, |
||||
.hljs-template-variable, |
||||
.hljs-attribute, |
||||
.hljs-link { |
||||
color: #32aaee; |
||||
} |
||||
|
||||
.hljs-keyword, |
||||
.hljs-selector-tag, |
||||
.hljs-name, |