From 6cfd2eb15169af1c01651e0f086139bfaa017110 Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Wed, 27 Dec 2017 11:27:52 -0800 Subject: add name field when replying to github repos --- views/new-post.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'views/new-post.php') diff --git a/views/new-post.php b/views/new-post.php index a9fae60..5995ba7 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -36,6 +36,11 @@ + +
280
@@ -312,7 +317,7 @@ function restoreNoteState() { function expandReplySection() { $("#expand-reply").click(); - $("#note_in_reply_to").change(); + $("#note_in_reply_to").change(); } function activateTokenField() { @@ -550,10 +555,18 @@ $(function(){ if(reply_to == "") { $(".reply-section").addClass("hidden"); $(".reply-context").addClass("hidden"); + $("#note-name").addClass("hidden"); + $("#note_content").siblings("label").text("Content"); $("#expand-reply").removeClass("hidden"); return; } + if($("#note_in_reply_to").val().match(/^https:\/\/github\.com\/([^\/]+)\/([^\/]+)$/)) { + // Add the "name" field for issues + $("#note-name").removeClass("hidden"); + $("#note_content").siblings("label").text("Description"); + } + $(".reply-section .loading").removeClass("hidden"); $.get("/reply/preview", {url:reply_to}, function(data){ @@ -650,6 +663,10 @@ $(function(){ var doMultipart = false; var hasAltText = false; + if(v=$("#note-name").val()) { + formData.append("name", v); + entry['name'] = [v]; + } if(v=$("#note_content").val()) { formData.append("content", v); entry['content'] = [v]; -- cgit v1.2.3