From 4092bb27b778090da3b5896a348533cb943f098a Mon Sep 17 00:00:00 2001 From: Uncled1023 Date: Fri, 22 Jun 2018 23:57:32 -0700 Subject: [PATCH] Added prism.js as a syntax highlighter --- .../Areas/Help/Views/Help/API/v1/Paste.cshtml | 6 +- Teknik/Areas/Paste/Views/Paste/Full.cshtml | 28 +- Teknik/Areas/Paste/Views/Paste/Index.cshtml | 1 - Teknik/Areas/Paste/Views/Paste/Simple.cshtml | 34 +- .../Areas/Vault/Views/Vault/PasteItem.cshtml | 43 +- Teknik/Content/lib/Prism/prism-atom-dark.css | 146 + Teknik/Content/lib/Prism/prism-coy.css | 227 + Teknik/Content/lib/Prism/prism-ghcolors.css | 119 + .../Content/lib/Prism/prism-line-numbers.css | 70 + Teknik/Content/lib/Prism/prism-vs.css | 157 + Teknik/Scripts/Paste/ViewPaste.js | 18 - Teknik/Scripts/lib/Prism/prism.js | 8333 +++++++++++++++++ Teknik/bundleconfig.json | 25 +- Utilities/HighlightHelper.cs | 169 + 14 files changed, 9260 insertions(+), 116 deletions(-) create mode 100644 Teknik/Content/lib/Prism/prism-atom-dark.css create mode 100644 Teknik/Content/lib/Prism/prism-coy.css create mode 100644 Teknik/Content/lib/Prism/prism-ghcolors.css create mode 100644 Teknik/Content/lib/Prism/prism-line-numbers.css create mode 100644 Teknik/Content/lib/Prism/prism-vs.css create mode 100644 Teknik/Scripts/lib/Prism/prism.js diff --git a/Teknik/Areas/Help/Views/Help/API/v1/Paste.cshtml b/Teknik/Areas/Help/Views/Help/API/v1/Paste.cshtml index edd7c48..d30c13c 100644 --- a/Teknik/Areas/Help/Views/Help/API/v1/Paste.cshtml +++ b/Teknik/Areas/Help/Views/Help/API/v1/Paste.cshtml @@ -99,10 +99,10 @@
This can be one of the following: diff --git a/Teknik/Areas/Paste/Views/Paste/Full.cshtml b/Teknik/Areas/Paste/Views/Paste/Full.cshtml index 7f8529f..30ff2aa 100644 --- a/Teknik/Areas/Paste/Views/Paste/Full.cshtml +++ b/Teknik/Areas/Paste/Views/Paste/Full.cshtml @@ -2,40 +2,20 @@ @using Teknik.Areas.Vault.Models - - @{ string format = Model.Syntax; string formatName = "Text"; - bool useFormat = true; - bool autoDetect = false; - if (string.IsNullOrEmpty(format)) - { - useFormat = false; - } - else if (format == "auto-detect") - { - formatName = "Auto Detect"; - autoDetect = true; - } - else if (!HighlightHelper.Languages.ContainsKey(format)) - { - useFormat = false; - } - else + if (HighlightHelper.Languages.ContainsKey(format)) { formatName = HighlightHelper.Languages[format]; } } + +
@@ -68,7 +48,7 @@
-
@Model.Content
+
@Model.Content
diff --git a/Teknik/Areas/Paste/Views/Paste/Index.cshtml b/Teknik/Areas/Paste/Views/Paste/Index.cshtml index 2ce38d8..d8ccb3d 100644 --- a/Teknik/Areas/Paste/Views/Paste/Index.cshtml +++ b/Teknik/Areas/Paste/Views/Paste/Index.cshtml @@ -29,7 +29,6 @@