TheCoder4eu / BootsFaces-OSP

BootsFaces - Open Source Project
Apache License 2.0
246 stars 102 forks source link

defaultCommand prints "keycode not 13" in console #1001

Closed TheTimeWalker closed 4 years ago

TheTimeWalker commented 6 years ago

Not really a big issue but maybe something to note about

When using defaultCommand, you can actually see that the script has a console function:

$(function() {
    $('form#loginForm input').keypress(function(e) {
        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
            [...]
            return false;
        } else {
            console.log('keycode not 13');
            return true;
        }
    });
});
$(function() {
    $('form#loginForm textarea').keypress(function(e) {
        if ((e.ctrlKey && e.which && e.which == 13) || (e.ctrlKey && e.keyCode && e.keyCode == 13)) {
            [...]
        } else {
            console.log('keycode not 13 or ctrl not pressed');
            return true;
        }
    });
});

This has the effect that every keystroke done would make the messages appear in the browser's console window under developer tools.

I've been wondering if this is really necessary to have as this could bring some confusion because it's not documented anywhere. Maybe we could add some feature where this only appears in development mode instead of having it print that out even in release or just outright remove that console.log line

geopossachs commented 4 years ago

debug message was eliminated by commit in past https://github.com/TheCoder4eu/BootsFaces-OSP/commit/9729f9dc1273955ac0b42e9c9849c4747c40479e