Parcourir la source

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

tags/2.0.6
Teknikode il y a 3 ans
Parent
révision
9ba0bbbee3

+ 1
- 1
Teknik/Areas/API/Controllers/APIv1Controller.cs Voir le fichier

@@ -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
{

+ 5
- 4
Teknik/Areas/Help/Views/Help/API/v1/Paste.cshtml Voir le fichier

@@ -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>

+ 1
- 1
Teknik/Areas/Paste/PasteHelper.cs Voir le fichier

@@ -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();

Chargement…
Annuler
Enregistrer