git ssb

30+

cel / git-ssb-web



Commit 660e744402511255c315a77560d14d0f5a089b7e

Name button "comment and close" when text is entered

Fix %kpqRL045LSgPQBUhmn15NfGNWV/y5bvYp8QresAYZF0=.sha256
Charles Lehner committed on 9/8/2016, 4:17:03 AM
Parent: e1e22d57369317efe3d71bb9e04c9278106c52b1

Files changed

lib/forms.jschanged
locale/en.jsonchanged
locale/eo.jsonchanged
lib/forms.jsView
@@ -58,8 +58,17 @@
5858 }
5959 }
6060 }.toString() + ')()'
6161
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 +
6271 forms.issueComment = function (req, issue, repo, branch, isAuthor, type) {
6372 return '<section><form action="" method="post">' +
6473 '<input type="hidden" name="action" value="comment">' +
6574 '<input type="hidden" name="id" value="' + issue.id + '">' +
@@ -69,11 +78,19 @@
6978 forms.post(req, repo) +
7079 '<input type="submit" class="btn open" value="' +
7180 req._t('issue.Comment') + '" />' +
7281 (isAuthor ?
73- '<input type="submit" class="btn"' +
82 + '<input id="comment-close-btn" type="submit" class="btn"' +
7483 ' 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 + : '') +
7895 '</form></section>'
7996 }
locale/en.jsonView
@@ -123,9 +123,11 @@
123123 "MentionedIn": "%{name} mentioned this %{type} in %{post}",
124124 "Renamed": "%{author} renamed this %{type} to %{name}",
125125 "Comment": "Comment",
126126 "Close": "Close %{type}",
127- "Reopen": "Reopen %{type}"
127 + "CommentAndClose": "Comment and Close",
128 + "Reopen": "Reopen %{type}",
129 + "CommentAndReopen": "Comment and Reopen"
128130 },
129131 "pullRequest": {
130132 "WantToMerge": "%{name} wants to merge commits into %{base} from %{head}",
131133 "Discussion": "Discussion",
locale/eo.jsonView
@@ -123,9 +123,11 @@
123123 "MentionedIn": "%{name} menciis tiun %{type} en %{post}",
124124 "Renamed": "%{author} renomiĝis tiun %{type} al %{name}",
125125 "Comment": "Komenti",
126126 "Close": "Fermi %{type}",
127- "Reopen": "Remalfermi %{type}"
127 + "CommentAndClose": "Komenti kaj Fermi",
128 + "Reopen": "Remalfermi %{type}",
129 + "CommandAndReopen": "Komenti kaj Remalfermi"
128130 },
129131 "pullRequest": {
130132 "WantToMerge": "%{name} volas kunfandi enmetoj en %{base} de %{head}",
131133 "Discussion": "Priparolado",

Built with git-ssb-web