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',
},
'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
// (as on all other pages there is no need for conventional comments)
const selector = '.page-content.repository.view.issue.pull.files.diff';
if (document.querySelector(selector)) {
setInterval(function() {
document
.querySelectorAll(
'.field.comment-code-cloud:not([data-semantic-button-initialized])',
)
.forEach(function(note) {
note.dataset.semanticButtonInitialized = 'true';
note.querySelector('.markup-info').remove();
addSemanticButton(note);
});
}, 1000);
if (document.querySelector(selector) && editorTemplate) {
const templ = document.querySelector('#issue-comment-editor-template');
if (templ) {
setInterval(function() {
document
.querySelectorAll(`.field.comment-code-cloud:not([data-semantic-button-initialized])`)
.forEach(function(note) {
note.dataset.semanticButtonInitialized = 'true';
note.querySelector('.markup-info').remove();
addSemanticButton(note);
});
}, 1000);
}
}