1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed Paste API help page and changed default values for Paste API

This commit is contained in:
Uncled1023 2016-11-17 11:49:07 -08:00
parent d0c8ed567c
commit 9ba0bbbee3
3 changed files with 7 additions and 6 deletions

View File

@ -162,7 +162,7 @@ namespace Teknik.Areas.API.Controllers
[HttpPost]
[AllowAnonymous]
[TrackPageView]
public ActionResult Paste(string code, string title = "", string syntax = "auto", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false, bool doNotTrack = false)
public ActionResult Paste(string code, string title = "", string syntax = "text", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false, bool doNotTrack = false)
{
try
{

View File

@ -1,6 +1,7 @@
@model Teknik.Areas.Help.ViewModels.HelpViewModel
@using Teknik.Helpers
@using Teknik.Pygments
@Styles.Render("~/Content/help");
@ -59,16 +60,16 @@
<code>string</code>
</td>
<td>
auto-detect
text
</td>
<td>
The syntax of the pasted code.
<br />
This can be one of the following:
<select name="format" class="selectpicker">
@foreach (KeyValuePair<string, string> format in Constants.HIGHLIGHTFORMATS)
@foreach (Highlighter.Lexer format in Highlighter.Lexers.OrderBy(l => l.Name))
{
<option value="@format.Value">@format.Key</option>
<option value="@format.Aliases.FirstOrDefault()">@format.Name</option>
}
</select>
</td>
@ -146,7 +147,7 @@
</tbody>
</table>
<h4>Response</h4>
<pre><code>{"result":{"id":<var>id</var>, "url":"<var>url</var>", "title":"<var>title</var>", "syntax":"<var>auto-detect</var>", "expiration":"<var>datetime</var>", "password":"<var>password</var>"}}</code></pre>
<pre><code>{"result":{"id":<var>id</var>, "url":"<var>url</var>", "title":"<var>title</var>", "syntax":"<var>text</var>", "expiration":"<var>datetime</var>", "password":"<var>password</var>"}}</code></pre>
<table>
<thead>
<tr>

View File

@ -11,7 +11,7 @@ namespace Teknik.Areas.Paste
{
public static class PasteHelper
{
public static Models.Paste CreatePaste(string content, string title = "", string syntax = "auto-detect", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false)
public static Models.Paste CreatePaste(string content, string title = "", string syntax = "text", string expireUnit = "never", int expireLength = 1, string password = "", bool hide = false)
{
TeknikEntities db = new TeknikEntities();
Config config = Config.Load();