Activation of mwEmbed at Wikimedia Commons leads to some bugs. Therefore, I call it a regression. Writing this bug report presumely took me more time than fixing the bug but if I don't get dev-access, it's not my problem.
Browsers: all.
OS: all.
Instead of adding one "EmbedPlayer"-object, it adds "EmbedPlayer.Attributes", "EmbedPlayer.AttributionButton" and so on.
Cluttering the global scope is considered bad practise ( https://www.google.com/search?q=javascript+clutter+window+scope ) and accessing global scope variables is slow.
Let's illustrate this issue in JavaScript:
// Currently it does:
window['EmbedPlayer.Attributes'] = { /* an object */ };
window['EmbedPlayer.AttributionButton'] = { /* an object */ };
// But it should
window.EmbedPlayer = {
Attributes: { /* an object */ }, AttributionButton: { /* an object */ }
};
// This would allow to "transfer" the variable to a local scope (actually creating a new reference to window.EmbedPlayer) e.g.
function abc() {
var ep = window.EmbedPlayer; if (ep.Attributes) // fast variable access because it is in local function scope and also allows to use abbrevations
}
Version: unspecified
Severity: enhancement