Check for gitea version >= 1.20

and extend line length to 120 chars
This commit is contained in:
Sebastian Sauer 2023-07-19 22:02:35 +02:00
parent 64f5bef433
commit 1a98503650
2 changed files with 17 additions and 12 deletions

@ -21,5 +21,9 @@ module.exports = {
'ecmaVersion': 'latest', 'ecmaVersion': 'latest',
}, },
'rules': { 'rules': {
'max-len': ['error', {
'code': 120,
'ignoreTemplateLiterals': true,
}],
}, },
}; };

@ -144,16 +144,17 @@ const saveChanges = (element) => {
// Only add the interval if we're on the files diff page // Only add the interval if we're on the files diff page
// (as on all other pages there is no need for conventional comments) // (as on all other pages there is no need for conventional comments)
const selector = '.page-content.repository.view.issue.pull.files.diff'; const selector = '.page-content.repository.view.issue.pull.files.diff';
if (document.querySelector(selector)) { if (document.querySelector(selector) && editorTemplate) {
setInterval(function() { const templ = document.querySelector('#issue-comment-editor-template');
document if (templ) {
.querySelectorAll( setInterval(function() {
'.field.comment-code-cloud:not([data-semantic-button-initialized])', document
) .querySelectorAll(`.field.comment-code-cloud:not([data-semantic-button-initialized])`)
.forEach(function(note) { .forEach(function(note) {
note.dataset.semanticButtonInitialized = 'true'; note.dataset.semanticButtonInitialized = 'true';
note.querySelector('.markup-info').remove(); note.querySelector('.markup-info').remove();
addSemanticButton(note); addSemanticButton(note);
}); });
}, 1000); }, 1000);
}
} }