Jump to content

User:Karl Dickman/Threads/06/11/28a

From Wikipedia, the free encyclopedia

Editbuttons script at MediaWiki:Common.js

[edit]

Note: this comment is part of a synchronised thread. You can reply by clicking the [edit] link next to the comment's heading, or following this link. To ensure that you can see any further responses I make, add this page to your watchlist. Once you have replied, feel free to remove this boilerplate.

The buttons on this page interfere with MarkS's editbutton script. Is there an easy way I can suppress the script at Common.js? The only way I can think of is by enclosing the script at Common.js with a statement like if(mediaWikiCommonJsButtons!='no') { button script } and adding var mediaWikiCommonJsButtons='no'; to my personal script page.

Can you think of any alternatives to my proposed solution? Karl Dickman talk 00:11, 28 November 2006 (UTC)

Adding mwCustomEditButtons = false to your monobook.js should do the trick. —Ruud 00:22, 28 November 2006 (UTC)
Doesn't work: your solution also kills Mark's editbutton script. Karl Dickman talk 16:36, 28 November 2006 (UTC)
How about this change. If I make it, it won't break anything, will it? The main problem with your solution, as I said in the previous comment, is that it kills any other editbutton script. Karl Dickman talk 17:57, 28 November 2006 (UTC)
Current revision Your text
Line 411: Line 411:
// This is based on the original code on Wikipedia:Tools/Editing tools // This is based on the original code on Wikipedia:Tools/Editing tools

if (mwCustomEditButtons) {

+

if (mwCustomEditButtons&&(mediaWikiCommonJsButtons!='no')) {

mwCustomEditButtons[mwCustomEditButtons.length] = { mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png", "imageFile": "http://upload.wikimedia.org/wikipedia/en/c/c8/Button_redirect.png",

Try adding mwCustomEditButtons = {}; just before including MarkS' script in your standard.js. I'd try to avoid adding more global variables unless really necessary. —Ruud 16:52, 29 November 2006 (UTC)

Nope, that didn't work either. And FWIW, I tried two different ways of adding the variable to Common.js today (see the page history), but neither of them worked: both killed all editbuttons. Karl Dickman talk 01:21, 30 November 2006 (UTC)
Would you care to take a look at User:Karl Dickman/standard.js, see if I did anything wrong? Karl Dickman talk 01:22, 30 November 2006 (UTC)
Here's another possible way to kill the additional buttons: find some way to enclose them in a <div> tag with an id. Then, I can suppress the id of that tag using my CSS. Karl Dickman talk 17:02, 30 November 2006 (UTC)