var u = require('./util') var forms = exports forms.post = function (req, repo, placeholder, rows) { return '' + '' + '' + '' + '
' + '' + '
' + '
' + '' } forms.name = function (req, enabled, id, name, action, inputId, title, header) { if (!inputId) inputId = action return '
' + (enabled ? '' + '' + '' + '' + ' ' + '' + header : header + '
' ) + '
' } var issueCommentScript = '(' + function () { var $ = document.getElementById.bind(document) $('tab-links').style.display = 'block' $('preview-tab-link').onclick = function (e) { with (new XMLHttpRequest()) { open('POST', '', true) onload = function() { $('preview-tab').innerHTML = responseText } send('action=markdown' + '&repo=' + encodeURIComponent($('repo-id').value) + '&text=' + encodeURIComponent($('post-text').value)) } } }.toString() + ')()' var issueCommentButtonScript = '(' + function () { var btn = document.getElementById('comment-close-btn') document.getElementById('post-text').onkeyup = function (e) { btn.setAttribute('value', this.value ? btn.getAttribute('data-value-withcomment') : btn.getAttribute('data-value-nocomment')) } }.toString() + ')()' forms.issueComment = function (req, issue, repo, branch, isAuthor, type) { return '
' + '' + '' + '' + '' + '' + forms.post(req, repo) + '' + (isAuthor ? '' + '' : '') + '
' }