Skip to content

Editorial Backend Header Content must be valid XHTML. #33

Description

@lpanebr

Hi! I'm trying to add a helper button that checks when we have submissions with more than 2 evaluations, alerts how many and paints their background, but I'm getting the following error when saving: Editorial Backend Header Content must be valid XHTML.

I've tried vanilla and jquery javascript but neither works.

However, when I paste them on the developer console both work as expected.

Any idea?
thanks!

<!-- teste custom headers  plugin para melhorar backend -->
<script>
// Cria um novo botão
var newButton = document.createElement('button');
newButton.innerHTML = 'Verificar Avaliações <span aria-hidden="true" class="fa fa-check-circle"></span>';

// Adiciona o botão ao cabeçalho
var headerActions = document.querySelector('.app__headerActions');
headerActions.appendChild(newButton);

// Adiciona o evento de clique ao botão
newButton.addEventListener('click', function() {
    var count = 0;
    document.querySelectorAll('li.listPanel__item').forEach(function(li) {
        if (li.textContent.match(/[2-9]+\/[2-9]+/)) {
            li.style.backgroundColor = '#99ff9d';
            count++;
        }
    });

    if (count > 0) {
        alert(count + ' submissões com 2 ou mais avaliações concluídas.');
    }
});
</script>
<!-- teste custom headers  plugin para melhorar backend -->
<script>
$(document).ready(function() {
    // Cria um novo botão
    var newButton = $('<button/>', {
        html: 'Verificar Avaliações <span aria-hidden="true" class="fa fa-check-circle"></span>',
        click: function() {
            var count = 0;
            $('li.listPanel__item').each(function() {
                if ($(this).text().match(/[2-9]+\/[2-9]+/)) {
                    $(this).css('backgroundColor', '#00FFbb');
                    count++;
                }
            });

            if (count > 0) {
                alert(count + ' submissões com 2 ou mais avaliações concluídas.');
            }
        }
    });

    // Adiciona o botão ao cabeçalho
    $('.app__headerActions').append(newButton);
});
</script>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions