Last modified: 2014-05-09 10:53:07 UTC
Buttons added with addToToolbar seem to create <img>s rather than <span>s, but the removeFromToolbar function will only remove tools that are <span>s: target += ' span[rel=' + data.character + ']'; An img button: <img width="22" height="22" src="/trunk/extensions/CodeEditor/images/code-selected.png?20110616T191440Z" alt="<codeeditor-toolbar-toggle>" title="<codeeditor-toolbar-toggle>" rel="codeEditor" class="tool tool-button"> A span button: <span alt="Bold" title="Bold" rel="bold" class="tool tool-button wikiEditor-toolbar-spritedButton" style="background-position: 2px -142px;">Bold</span> Thus this doesn't work as expected: $('#wpTextbox1').wikiEditor('removeFromToolbar', { 'section': 'main', 'group': 'format', 'tool': 'codeEditor' });
This bug is still present in 1.19.2 final, it seems this commit: https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/extensions/WikiEditor.git;a=commit;f=modules/jquery.wikiEditor.toolbar.js;h=e63ef419f074a01871a3c23f61f61ee84eb7ae3e has been forgotten. It uses <a> instead of <span>.
Commit# is e63ef419f074a01871a3c23f61f61ee84eb7ae3e
*** This bug has been marked as a duplicate of bug 37484 ***
Eh, wait, this still exists.. zomg
Change 124503 had a related patch set uploaded by TheDJ: Repair removeFromToolbar() to handle image buttons https://gerrit.wikimedia.org/r/124503
Change 124503 merged by jenkins-bot: Repair removeFromToolbar() to handle image buttons https://gerrit.wikimedia.org/r/124503