index.jsView |
---|
107 | 107 | ]) |
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
| 111 | +function nameForm(isPublic, id, name, inputId, title, header) { |
| 112 | + return '<form class="petname" action="" method="post">' + |
| 113 | + (isPublic ? '' : |
| 114 | + '<input name="name" id="' + inputId + '" class="name" value="' + |
| 115 | + escapeHTML(name) + '" />' + |
| 116 | + '<input type="hidden" name="action" value="name">' + |
| 117 | + '<input type="hidden" name="id" value="' + |
| 118 | + escapeHTML(id) + '">' + |
| 119 | + '<label class="name-toggle" for="' + inputId + '" ' + |
| 120 | + 'title="' + title + '"><i>โ</i></label>' + |
| 121 | + '<input class="name-btn" type="submit" value="Rename">') + |
| 122 | + header + |
| 123 | + '</form>' |
| 124 | +} |
| 125 | + |
111 | 126 | function readNext(fn) { |
112 | 127 | var next |
113 | 128 | return function (end, cb) { |
114 | 129 | if (next) return next(end, cb) |
644 | 659 | (upvoted ? 'Undig' : 'Dig') + |
645 | 660 | '</button>') + ' ' + |
646 | 661 | '<strong>' + link(digsPath, votes.upvotes) + '</strong>' + |
647 | 662 | '</form>' + |
648 | | - '<form class="petname" action="" method="post">' + |
649 | | - (isPublic ? '' : |
650 | | - '<input name="name" id="repo-name" value="' + |
651 | | - escapeHTML(repoName) + '" />' + |
652 | | - '<input type="hidden" name="action" value="name">' + |
653 | | - '<input type="hidden" name="id" value="' + |
654 | | - escapeHTML(repo.id) + '">' + |
655 | | - '<label class="repo-name-toggle" for="repo-name" ' + |
656 | | - 'title="Rename the repo"><i>โ</i></label>' + |
657 | | - '<input class="repo-name-btn" type="submit" value="Rename">') + |
658 | | - '<h2>' + link([repo.feed], authorName) + ' / ' + |
659 | | - link([repo.id], repoName) + '</h2>' + |
660 | | - '</form>' + |
| 663 | + nameForm(isPublic, repo.id, repoName, 'repo-name', |
| 664 | + 'Rename the repo', |
| 665 | + '<h2>' + link([repo.feed], authorName) + ' / ' + |
| 666 | + link([repo.id], repoName) + '</h2>') + |
661 | 667 | '</div><div class="repo-nav">' + link([repo.id], 'Code') + |
662 | 668 | link([repo.id, 'activity'], 'Activity') + |
663 | 669 | link([repo.id, 'commits', branch || ''], 'Commits') + |
664 | 670 | link([repo.id, 'issues'], 'Issues') + |