Commit 660e744402511255c315a77560d14d0f5a089b7e
Name button "comment and close" when text is entered
Fix %kpqRL045LSgPQBUhmn15NfGNWV/y5bvYp8QresAYZF0=.sha256Charles Lehner committed on 9/8/2016, 4:17:03 AM
Parent: e1e22d57369317efe3d71bb9e04c9278106c52b1
Files changed
lib/forms.js | changed |
locale/en.json | changed |
locale/eo.json | changed |
lib/forms.js | |||
---|---|---|---|
@@ -58,8 +58,17 @@ | |||
58 | 58 … | } | |
59 | 59 … | } | |
60 | 60 … | }.toString() + ')()' | |
61 | 61 … | ||
62 … | +var issueCommentButtonScript = '(' + function () { | ||
63 … | + var btn = document.getElementById('comment-close-btn') | ||
64 … | + document.getElementById('post-text').onkeyup = function (e) { | ||
65 … | + btn.setAttribute('value', this.value | ||
66 … | + ? btn.getAttribute('data-value-withcomment') | ||
67 … | + : btn.getAttribute('data-value-nocomment')) | ||
68 … | + } | ||
69 … | +}.toString() + ')()' | ||
70 … | + | ||
62 | 71 … | forms.issueComment = function (req, issue, repo, branch, isAuthor, type) { | |
63 | 72 … | return '<section><form action="" method="post">' + | |
64 | 73 … | '<input type="hidden" name="action" value="comment">' + | |
65 | 74 … | '<input type="hidden" name="id" value="' + issue.id + '">' + | |
@@ -69,11 +78,19 @@ | |||
69 | 78 … | forms.post(req, repo) + | |
70 | 79 … | '<input type="submit" class="btn open" value="' + | |
71 | 80 … | req._t('issue.Comment') + '" />' + | |
72 | 81 … | (isAuthor ? | |
73 | - '<input type="submit" class="btn"' + | ||
82 … | + '<input id="comment-close-btn" type="submit" class="btn"' + | ||
74 | 83 … | ' name="' + (issue.open ? 'close' : 'open') + '"' + | |
75 | - ' value="' + req._t( | ||
76 | - issue.open ? 'issue.Close' : 'issue.Reopen', {type: type} | ||
77 | - ) + '"/>' : '') + | ||
84 … | + ' value="' + req._t(issue.open ? 'issue.Close' : 'issue.Reopen', | ||
85 … | + {type: type}) + '"' + | ||
86 … | + ' data-value-nocomment="' + req._t(issue.open ? | ||
87 … | + 'issue.Close' : 'issue.Reopen', | ||
88 … | + {type: type}) + '"' + | ||
89 … | + ' data-value-withcomment="' + req._t(issue.open ? | ||
90 … | + 'issue.CommentAndClose' : 'issue.CommentAndReopen', | ||
91 … | + {type: type}) + '"' + | ||
92 … | + '/>' + | ||
93 … | + '<script>' + issueCommentButtonScript + '</script>' | ||
94 … | + : '') + | ||
78 | 95 … | '</form></section>' | |
79 | 96 … | } |
locale/en.json | ||
---|---|---|
@@ -123,9 +123,11 @@ | ||
123 | 123 … | "MentionedIn": "%{name} mentioned this %{type} in %{post}", |
124 | 124 … | "Renamed": "%{author} renamed this %{type} to %{name}", |
125 | 125 … | "Comment": "Comment", |
126 | 126 … | "Close": "Close %{type}", |
127 | - "Reopen": "Reopen %{type}" | |
127 … | + "CommentAndClose": "Comment and Close", | |
128 … | + "Reopen": "Reopen %{type}", | |
129 … | + "CommentAndReopen": "Comment and Reopen" | |
128 | 130 … | }, |
129 | 131 … | "pullRequest": { |
130 | 132 … | "WantToMerge": "%{name} wants to merge commits into %{base} from %{head}", |
131 | 133 … | "Discussion": "Discussion", |
locale/eo.json | ||
---|---|---|
@@ -123,9 +123,11 @@ | ||
123 | 123 … | "MentionedIn": "%{name} menciis tiun %{type} en %{post}", |
124 | 124 … | "Renamed": "%{author} renomiĝis tiun %{type} al %{name}", |
125 | 125 … | "Comment": "Komenti", |
126 | 126 … | "Close": "Fermi %{type}", |
127 | - "Reopen": "Remalfermi %{type}" | |
127 … | + "CommentAndClose": "Komenti kaj Fermi", | |
128 … | + "Reopen": "Remalfermi %{type}", | |
129 … | + "CommandAndReopen": "Komenti kaj Remalfermi" | |
128 | 130 … | }, |
129 | 131 … | "pullRequest": { |
130 | 132 … | "WantToMerge": "%{name} volas kunfandi enmetoj en %{base} de %{head}", |
131 | 133 … | "Discussion": "Priparolado", |
Built with git-ssb-web