User talk:MarkS/Extra edit buttons

From Wikipedia, the free encyclopedia

--77.4.44.112 (talk) 21:26, 6 March 2008 (UTC)
Has anybody tried to include the js of the buttons directly into the skin? This would be by far the most appropriate solution. Any advice is highly appreciated!


--Johnp125 16:59, 18 September 2007 (UTC)

I do not understand what I am need to do with the monobook.js. Do I need to make a new skin. Do I put the code in the current skin and add this data to it and then change the name to monobook.js. Do I need to edit my LocalSettings.php and make the new monobook.js the default skin? Do I need to put the code in a namespace? I am a little confused as to how to get this working, and how to ref the data. Do I put this in a extension? I need some direction. Please help.

--205.144.218.172 00:05, 23 September 2007 (UTC)

Is this a dead discussion?


I did not find info. on in which directory to put monobook.js into? Kindly assist. (June 13, 2007)

me too. there´s no monobook.js in wiki 1.11.0. ist there anywhere a installation-guide for 1.11.0? 143.164.102.13 06:27, 31 October 2007 (UTC)

I cann't find monobook.js either. I can find skins/monobook directory, but there's no js files in it at all. Anybody can explain about the monobook.js? —Preceding unsigned comment added by 24.218.73.252 (talk) 15:43, 31 January 2008 (UTC)





Hi there,

We are desperately looking for the extended toolbar, aspecially for tables, only... Where is the 'monobook.js'? It's not in the mediawiki files I downloaded on 10 Jan. 2007 from the official site... So the 'simple' install just doesn't work. Please give instructions how to add this for a user who just downloaded the wiki package, installed it and doesn't know diddly about it otherwise.

Many thanks, Marc

Hi Mark,

This is interesting. How to add this for my site? Can we do this without editing the EditPage.php.

Thanks Vasu


May you please add a button for right to left align? Thanks, David

You mean right Image:Button_align_right.png for left? For what in fact is left used? --Olliminatore 15:16, 19 September 2006 (UTC)
As of 13 October 2006 XEB includes left aligned, centred and right aligned buttons --MarkS (talk) 15:45, 13 October 2006 (UTC)

When adding your own new buttons, how do we specify the url for the button's image? You look like you're using the absolute path of the image ex: 6/6a/Button_sup_letter.png. But I can't see that path when I search for that image on wikipedia. So I assume I create images using gimp, them upload them to wikipedia. But how do I know the path to the image?

Thanks in advance, Jason L Michael

Hi Jason, you can find the absolute path to the image by clicking on its link in its description page, e.g. here, you would click on the text right beneath the picture which says "John_W._Bricker_cropped.jpg‎ (10KB, MIME type: image/jpeg)". That takes you to the absolute path: http://upload.wikimedia.org/wikipedia/en/7/77/John_W._Bricker_cropped.jpg
--Matt57 15:45, 28 October 2006 (UTC)
All the icons are now in commons so rather than specify the full path on each line 'http://upload.wikimedia.org/wikipedia/commons/' is added to the front of each URL. If you are looking at the code then you can see variable Isrc is defined at the top to hold this part of the URL. Isrc is then added to the location specified for each button.


Contents

[edit] Reference tags

Hello there. This seems like a great tool, but there's one more thing I'm missing. There's plenty of reference templates available out there and copy-pasting them and then filling them with content might be a tedious task. Is there a way to create buttons that would paste the three most common templates?

  • {{cite book | author = | coauthors = | title = | year = | editor = | pages = | chapter = | chapterurl = | publisher = | location = | id =ISBN | url = | format = | accessdate = }}
  • {{cite journal | author = | year = | month = | title = | journal = | volume = | issue = | pages = | id = | url = | format = | accessdate = }}
  • {{cite web | author= | title= | publisher= | year= | work= | url= | accessdate= }}

//Halibutt 09:02, 31 October 2006 (UTC)

There are two ways:
  1. You could use the mwCustomEditButtons function directly in your own monobook.js. mwCustomEditButtons is an array which contains details of the buttons to add. You can see an example of using it in extraeditbuttons.js.
  2. Extra buttons can be added. These would probably be non-standard buttons. This ensures the buttons don't appear automatically for everybody. You would then need to use XEBOrder to get the buttons to appear.
I'm willing to follow the second option and add the buttons into XEB. Would you be willing to design the icons? --MarkS (talk) 20:34, 1 November 2006 (UTC)
More: Thanh công cụ soạn thảo --Nguyễn Thế Phúc Talk 04:07, 4 March 2007 (UTC)

Have you had a chance to implement these useful citation buttons? NigelG (or Ndsg) | Talk 00:43, 6 February 2007 (UTC)

[edit] Gallery created

It's much larger then I expected - perhaps it should be split off? In either case, we need to move some buttons to Commons; and it should be helpful for people designing their own buttons (we can also use a place to list them). -- Piotr Konieczny aka Prokonsul Piotrus | talk  19:18, 24 December 2006 (UTC)

[edit] Button images not appearing

A really useful tool: thanks!

One problem, though. I've added some buttons to colour text, as follows (in my monobook.js):

myButtons={'_BL':['http://commons.wikimedia.org/wiki/Image:Bouton_Vandale0.png','blue','<span style="color:blue">','</span>','text'], '_GR':['http://commons.wikimedia.org/wiki/Image:Bouton_Vandale1.png','green','<span style="color:green">','</span>','text'], '_FU':['http://commons.wikimedia.org/wiki/Image:Bouton_Vandale2.png','fuchsia','<span style="color:fuchsia">','</span>','text'], '_RE':['http://commons.wikimedia.org/wiki/Image:Bouton_Vandale3.png','red','<span style="color:red">','</span>','text']}; :XEBOrder="R,F,Q,_GR,_BL,_FU,_RE";

The buttons work; but instead of getting the images, all I see in the toolbar is the tooltips ("blue", "green", etc). What am I doing wrong? --NigelG (or Ndsg) | Talk 18:51, 30 January 2007 (UTC)

The URL you have provided doesn't actually link to the picture. Your URL's point to the page that contains all the wikimedia stuff (menus, licence, the picture etc...). In your case if you go to this page then just below each image is a link to the picture itself. Follow the link to get to just the button image. For example the image for your first button is at: http://upload.wikimedia.org/wikipedia/commons/f/f0/Bouton_Vandale0.png. You need to take the URL of this page and that in, rather than the page you are linked to. --MarkS (talk) 20:11, 2 February 2007 (UTC)

Thanks! I've finally got them to work. But how does this fit in with your previous statement?

"All the icons are now in commons so rather than specify the full path on each line 'http://upload.wikimedia.org/wikipedia/commons/' is added to the front of each URL."

It seems that you still have to type the whole verbose URL - or have I missed something? --NigelG (or Ndsg) | Talk 00:47, 6 February 2007 (UTC)

[edit] How to have extra buttons installed on my wiki

Hi,

What is the license for extra buttons. Is it possible to place them on my wiki? If yes what are the steps I have to follow to have them? Do I have to make any changes to code? Is it possible to default users accounts to have extra buttons by default (i.e. each user doesn't have to copy all the code, etc.)

Regards, Aretai 13:59, 2 February 2007 (UTC)

Comment on my talk page. --MarkS (talk) 20:11, 2 February 2007 (UTC)

[edit] Thank you - it works on my MediaWiki

Thank you! I finaly figured out how to install this on my MediaWiki site. This is great. IIt works great. I also have the wikEd installed for the other users, but it only works for FireFox. Many of the potential users of my site use IE7 and IE6, so, this universal extra buttons are very helpful. This will make Wiki style editting a bit more approachable for some. Thank you again!Kohyin 22:18, 15 February 2007 (UTC)

[edit] Ref tag button

I see from the Changes section that some buttons have been modified:

"6 March 2007 Major upgrade. XEB now features popups on some of the buttons. These display a dialog box to complete with parameters. The markup code then depends on the inserted text."

In the case of the <ref>...</ref> button this has made things worse. I find it much easier to type (sometimes quite long) footnotes in the text, then highlight them and click on the Ref button. This used to work, but no longer does so. Could you please reinstate it? Thanks -- NigelG (or Ndsg) | Talk 12:25, 14 March 2007 (UTC

NigelG, quick question: Would you be happy with a single option for the moment to turn all the popups off in one go?
In the longer term I know something needs to be done to improve the reference popup. The popup is an attempt to fix the two types of buttons for reference that XEB has (one does the whole reference in one go, whilst the other builds in up in bits so you can specify the name as well as the reference). The ultimate intention is that the popup should pick up the selected text, the insert button should be the one with the focus (so if you press enter it is just entered) and that the popup can let you specify different types of cite references (my understanding is that is what should be between the ref tags). Any comments on this as a longer term plan? --MarkS (talk) 18:10, 14 March 2007 (UTC)
I've added an option to turn off popups entirely. Simply add XEBPopups=false; to your monobook.js before the XEB code is include. I'll look for more sophisticated solutions when I get a proper chance. Comments on the reference button in general (see above) or this fix are welcome. --MarkS (talk) 22:38, 14 March 2007 (UTC)
Thanks for giving us the option, & for doing it so promptly! Yes, that's fine for the time being.
In the longer term it would certainly be nice to have an additional option of the various Cite templates (book, journal, web) inside the Ref tags. But remember that not all Refs are for citations of this sort: some are just footnotes with additional information. So allowance must be made for this type of Ref as well. --NigelG (or Ndsg) | Talk 00:00, 15 March 2007 (UTC)


[edit] Multiple Lines

Is it possible to create buttons on two lines? Like having two button toolbars? If I use to many, then the toolbar extends off of the page. How can I fix this?

thanks--198.70.22.217 17:42, 16 March 2007 (UTC)

The buttons are drawn by the mediaWiki software. XEB just gives it a list of buttons (the list contains the image, the tooltip and the tags to insert). So there isn't an easy way to get it to create two toolbars. However, in testing the MediaWiki software has always caused the buttons to wrap on to a second line if necessary. There are two possible explanations for your problem:
  1. You are using a browser I haven't tested on. The only major group of browsers I haven't tested on are for MAC (as I don't have access to a MAC).
  2. You have a particular style that tells the toolbar not to wrap. This might be set from a MediaWiki skin or by another user script.

[edit] Mac OS tested

Being a user of Mac OS and Mac OS alone, I can confirm that it works perfectly. I can make text:

  1. Small
  2. Underlined; and
Defined
Made clear

In short, it's brilliant! CarrotMan 07:27, 17 March 2007 (UTC)

[edit] Breaks table sorting?

I'm using an out-of-the-box installation of MediaWiki 1.9.3 and my sortable tables are no longer sortable. Testing on Wikipedia, I see the same thing; when I'm using the extra edit buttons, I cannot sort tables.

This should now be fixed. The problem arose because both sortable tables and XEB had a function with an identical name (getElement ByClassName if I remember). This is a function I grabbed off the net and is incredibly useful. I've renamed the XEB version but the issue could arise somewhere else with another script. --MarkS(talk) 21:10, 1 May 2007 (UTC)

[edit] Does it work on other Wikimedia Wikis?

Hi, this is great! But does it work on other wikimedia wikis? TomasBat (@)(Contribs)(Sign!) 03:26, 31 March 2007 (UTC)

It should copy over to other wikimedia wikis without any problems. The buttons are all in commons so they shouldn't cause any problem. It might be even work directly but adapting the monobook code to include the full URL. I haven't tried this but can't imagine any problems. I'll have a look if I get a chance.

[edit] prettytable not working

Although the the popup box is great, if i select anything more than caption when the table resolves it shows the table 'options' like

align="center" which showed with just selecting align center. if i build the table option by itself then this does not appear to happen. So it seems to be some kind of timing error? any ideas? --Dtsig 04:17, 22 April 2007 (UTC)

There is a revised version of XEB which changes the way text is inserted when popups are used. Can you refresh your cache etc and tell me how you get on. --MarkS(talk) 21:21, 1 May 2007 (UTC)

[edit] Some changes in install directions and a request

I just installed this onto my wiki and it works just fine. I am on mediawiki v1.10 and have found that the install is quite simple as explained in the posting by Carlos Hanson. I dropped your code into mediawiki:common.js and snap, extra buttons!. This does mean that each wiki administrator needs to add this to their own wiki but this is not necessarily a bad thing as each wiki admin may want a different set of buttons.

Request: Since your code has hard coded locations for all the JPGs it would be nice of you could provide a tar/zip file of the buttons starting 1 level below /images.

[edit] Citation

Is it possible to make two extra buttons for citing books and websites. The templates are:

{{cite book|last=|first=|authorlink=|coauthors=|title=|year=|publisher=|location=|isbn=}}

and

{{cite web|url=|title=|accessdate=|last=|first=|authorlink=|coauthors=|date=|publisher=|pages=|language=|quote=}}

Note: It would be nice if the accessdate parameter be completed automatically (using CURRENTYEAR, etc.)

It would be awesome if these buttons can be designed to show a popup window with all options, much like the advanced image and table buttons. I tried adding them (as extra buttons) but I failed, after several tries. This tool would make life so much easier for me and I would really appreciate if this can be done. Thanks, Anas talk? 15:24, 15 July 2007 (UTC)

I've made a start (but can't claim to be actively working on it) to create some extra cite buttons. This would create a set of buttons all of which had a similar look which could then be used for "cite book", "cite web" .... . Once these are done I'll add them on. I'd like to have a single popup from which you choose what to cite at the top (eg. web, book ...) and it then showed the relevant parameters to complete. The problem is that this means the popup will change in size. At the moment XEB doesn't support and popups changing content let alone size. I have therefore been playing on my own version of the wikimedia software to try and solve this. Once that's done I'll do an XEB update. --MarkS(talk) 20:26, 23 July 2007 (UTC)
Excellent! Good luck with that, Mark. I'll be waiting for the update. Thanks, Anas talk? 17:19, 24 July 2007 (UTC)

[edit] subst and sig

I'm creating a custom button. The intent is for a Welcome tag subst, as I am getting tired of typing it :) The code I want is {{subst:WelcomeIcon}}~~~~

However, if I create the button as, say: myButtons={'_ZZ':['http://upload.wikimedia.org/wikipedia/commons/9/9c/Button_smiley2.png', 'Welcome','{{subst:WelcomeIcon}}~~~~','','']};

Then the subst both of the WelcomeIcon tag and the sig is performed as I save the monobook.js page.

Next, I tried

myButtons={'_ZZ':['http://upload.wikimedia.org/wikipedia/commons/9/9c/Button_smiley2.png', 'Welcome','<nowiki>{{subst:WelcomeIcon}}~~~~</nowiki>',,]};

but when I do that, the nowiki tags get put into the edit box as well

My solution, for now is to do this:

myButtons={'_ZZ':['http://upload.wikimedia.org/wikipedia/commons/9/9c/Button_smiley2.png', 'Welcome','{{subst:','~~','WelcomeIcon}}~~']};

which breaks things up enough that it doesn't subst in the monobook.js, but it is rather inelegant. Do you have any suggestions?  — Timotab Timothy (not Tim dagnabbit!) 03:28, 5 September 2007 (UTC)

[edit] Recent update prevents my wiki page to open in IE7

Hi,

I suppose that the monobook.js has recently been changed. The main page of my wiki won't open anymore, and deactivating the extraEdit Buttons solves that problem.

Did you have the chance to test it on IE 7 ?

Thx, --Jacques-- —Preceding unsigned comment added by 90.34.105.16 (talk) 07:28, 24 September 2007 (UTC)

[edit] Dont know how to Install

Hi,

Im Using the latest version of Wiki, and i cannot intall the XEB, please give me the details guide

Im going to my special page from search form i typed special Special:Mypage/monobook.js then i put your code over there, after refresh, its nothing happening ?

kindly assist the details —Preceding unsigned comment added by 203.121.47.26 (talk) 02:18, 27 October 2007 (UTC)

[edit] ERROR

There is an error in the extra edit buttons:
The left and right align codes are the same, at least in the Comments / What is shown when editing table.
please fix this, thanks!-- penubag  08:40, 9 January 2008 (UTC)

[edit] References to buttons

I browsed the source for some ideas for a gadget of my own and stumbled upon how you access the buttons. Specifically, when you want to add a onclick handler to a button, you loop through all the buttons and compare the img attributes. At least on the German Wikipedia, with [1], the much easier solution is to pass the attribute imageId to mwEditButtons that will set the ID attribute of the element. HTH, Tim Landscheidt (talk) 17:10, 24 April 2008 (UTC)