Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

making extra buttons in edit page tool

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


rein at livingtale

Jun 4, 2008, 12:01 PM

Post #1 of 12 (719 views)
Permalink
making extra buttons in edit page tool

To my surprise was the unintended consequence of installing common.js the appearance of lay-ou buttons on top of the editing screen.
I had been looking for it desperately, but not found.

But it tasted for more!
The positioning is just far better than on the bottom of the page. Select text and click the button - no scrolling needed!
For instance an extra button for the making of anchored pagelinks would be very helpful: [[#|insert]insert].
But as you maybe could learn of my opening statement: not knowing why they appeared means also not knowing where to adapt and copy the existing buttons.
Who can help
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


alexis.moinet at fpms

Jun 5, 2008, 2:08 AM

Post #2 of 12 (693 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

Rein wrote :
> To my surprise was the unintended consequence of installing common.js the appearance of lay-ou buttons on top of the editing screen.
> I had been looking for it desperately, but not found.
>
> But it tasted for more!
> The positioning is just far better than on the bottom of the page. Select text and click the button - no scrolling needed!
> For instance an extra button for the making of anchored pagelinks would be very helpful: [[#|insert]insert].
> But as you maybe could learn of my opening statement: not knowing why they appeared means also not knowing where to adapt and copy the existing buttons.
> Who can help

in Mediawiki:Common.js, there is :

//Editpage scripts
if (wgAction=='edit' || wgAction == 'submit')
importScript('MediaWiki:Editpage.js')

so let's see MediaWiki:Editpage.js : there is a function addInsertButton(...) to be used to add custom edit buttons on top of the page

;-)


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


rein at livingtale

Jun 5, 2008, 7:27 AM

Post #3 of 12 (695 views)
Permalink
making extra buttons in edit page tool [In reply to]

Okay!
Made the Mediawiki:editpage.js.

If I understand the js correctly there are three extra buttons made allready.
For instance:
addInsertButton('wikipedia/commons/1/11/Button_category.png','Category','[[Category:',']]','');
It's clear that the address is not correct.
I put a button in skins/common/images
and changed the address.....
but nothing happens.
I tried a complete url, a relative url ... but no success.
What am I doing wrong?
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


alexis.moinet at fpms

Jun 5, 2008, 8:46 AM

Post #4 of 12 (685 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

Rein a écrit :
> Okay!
> Made the Mediawiki:editpage.js.
>
> If I understand the js correctly there are three extra buttons made allready.
> For instance:
> addInsertButton('wikipedia/commons/1/11/Button_category.png','Category','[[Category:',']]','');
> It's clear that the address is not correct.
> I put a button in skins/common/images
> and changed the address.....
> but nothing happens.
> I tried a complete url, a relative url ... but no success.
> What am I doing wrong?

force-refresh your browser (clear your cache) ?

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


rein at livingtale

Jun 6, 2008, 1:52 AM

Post #5 of 12 (695 views)
Permalink
making extra buttons in edit page tool [In reply to]

I think the problem is rather that the script is not okay.
First it is obvious that at mediawiki the script has no results (no extra buttons shown). That's strange because you would think there should be a working script!

http://www.mediawiki.org/wiki/MediaWiki:Editpage.js
This is the script I used. I altered like I wrote the destination of the buttons itself and placed them on my site (of course some I made myself).
This line should also puzzles me:
{'imageFile': 'http://upload.wikimedia.org/' + img,
Shouldn't it be to my own site (I tried but am not sure what the url should be)
And I think it is connected with the urls of the buttons?

If you read it (I'm to too technical, and can read only the basic) this is strange:
This file is uploaded:
importScript('MediaWiki:Scripts/Edittools1.js').
1. there is no such script
2. "Scripts/" looks strange to me
3. there is a 'MediaWiki:Edittools.js' but uploading (and correcting the script) had no effect.
http://www.mediawiki.org/wiki/MediaWiki:Edittools.js

Then I noticed this:
loadCommonsEdittoos - twice
No "l" there: loadCommonsEdittools
But no effect here either (nor in combination of above). Nor using it together with the button links in the script.
Rein

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


alexis.moinet at fpms

Jun 6, 2008, 5:55 AM

Post #6 of 12 (688 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

Rein wrote :
> I think the problem is rather that the script is not okay.

well, it works fine on my local vanilla install :-)


> First it is obvious that at mediawiki the script has no results (no extra buttons shown). That's strange because you would think there should be a working script!

I do see extra buttons for any editable page at http://www.mediawiki.org (when I click on 'edit', I see the 3 buttons just above the edit panel. They look like this : '#R', '-' and 'Cat')


> http://www.mediawiki.org/wiki/MediaWiki:Editpage.js
> This is the script I used. I altered like I wrote the destination of the buttons itself and placed them on my site (of course some I made myself).

can you show us the altered code or a link to your site (if it's not local)


> This line should also puzzles me:
> {'imageFile': 'http://upload.wikimedia.org/' + img,
> Shouldn't it be to my own site (I tried but am not sure what the url should be)
> And I think it is connected with the urls of the buttons?

it's the url of the image displayed as a button.

you can replace it with : {'imageFile': 'http://yourwebsite/' + img,

and use the url to the image on your website in the call to addInsertButton()

so if the image is in http://youwebsite/images/extrabutton1.png, you have

{'imageFile': 'http://yourwebsite/' + img,

and

addInsertButton('images/extrabutton1.png','mybutton','...','...','...')

If the image is not found, you should see a simple text 'mybutton' (the second parameter of the function addInsertButton() ) instead of the button. if you see nothing, force-refresh your browser.

NB : you can also let {'imageFile': 'http://upload.wikimedia.org/' + img, and use an image available on the wikimedia server


> If you read it (I'm to too technical, and can read only the basic) this is strange:
> This file is uploaded:
> importScript('MediaWiki:Scripts/Edittools1.js').
> 1. there is no such script
> 2. "Scripts/" looks strange to me
> 3. there is a 'MediaWiki:Edittools.js' but uploading (and correcting the script) had no effect.
> http://www.mediawiki.org/wiki/MediaWiki:Edittools.js
>
> Then I noticed this:
> loadCommonsEdittoos - twice
> No "l" there: loadCommonsEdittools
> But no effect here either (nor in combination of above). Nor using it together with the button links in the script.
> Rein

I don't use these two scripts, so they don't seem to be required to make the extra buttons work



NB : for the extra buttons above the edit text pane, I just added (and adapted) some of the function of Mediawiki:Editpage.js in my Mediawiki:Common.js, instead of creating a MediaWiki:Editpage.js page on my wiki

so basically my Mediawiki:Common.js is simply :

/* Any JavaScript here will be loaded for all users on every page load. */
/**
* Add extra buttons above edit panel
*/

function addCustomButton(imageFile, speedTip, tagOpen, tagClose, sampleText, imageId) {
mwCustomEditButtons[mwCustomEditButtons.length] =
{"imageId": imageId,
"imageFile": imageFile,
"speedTip": speedTip,
"tagOpen": tagOpen,
"tagClose": tagClose,
"sampleText": sampleText};
}

addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png',
'strike',
'<s>',
'</s>',
'',
'mw-editbutton-strike');


could you check what happen if you have only this in your Mediawiki:Common.js (+ clear your browser's cache) ?


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


burtejf at orange

Jun 6, 2008, 9:19 AM

Post #7 of 12 (675 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

> I don't use these two scripts, so they don't seem to be required to make
> the extra buttons work

Me too,
(but I only use "text display" and not "button fashion" for the text to
insert, and that's enough for me)
It's seems that perharps successive version exist to make edittools work,
but differently with/or without "button images" ? but it remains possible to
adapt the <span> with css ?

For me just [[MediaWiki:Edittols]], Common.js, Common.css, and Charinsert
extension and the {{+|+}}
(Sorry you can't edit my site if you are not logged as asso user)
So Rein, look/search for the term "edittols" in
http://fr.wikipedia.org/w/index.php?title=MediaWiki:Common.js
@+ de jfb "enjoy my 0.02$"

----- Original Message -----
From: "Alexis Moinet" <alexis.moinet [at] fpms>
To: "Mediawiki" <mediawiki-l [at] lists>
Sent: Friday, June 06, 2008 2:55 PM
Subject: Re: [Mediawiki-l] making extra buttons in edit page tool


> Rein wrote :
>> I think the problem is rather that the script is not okay.
>
> well, it works fine on my local vanilla install :-)
>
>
>> First it is obvious that at mediawiki the script has no results (no extra
>> buttons shown). That's strange because you would think there should be a
>> working script!
>
> I do see extra buttons for any editable page at http://www.mediawiki.org
> (when I click on 'edit', I see the 3 buttons just above the edit panel.
> They look like this : '#R', '-' and 'Cat')
>
>
>> http://www.mediawiki.org/wiki/MediaWiki:Editpage.js
>> This is the script I used. I altered like I wrote the destination of the
>> buttons itself and placed them on my site (of course some I made myself).
>
> can you show us the altered code or a link to your site (if it's not
> local)
>
>
>> This line should also puzzles me:
>> {'imageFile': 'http://upload.wikimedia.org/' + img,
>> Shouldn't it be to my own site (I tried but am not sure what the url
>> should be)
>> And I think it is connected with the urls of the buttons?
>
> it's the url of the image displayed as a button.
>
> you can replace it with : {'imageFile': 'http://yourwebsite/' + img,
>
> and use the url to the image on your website in the call to
> addInsertButton()
>
> so if the image is in http://youwebsite/images/extrabutton1.png, you have
>
> {'imageFile': 'http://yourwebsite/' + img,
>
> and
>
> addInsertButton('images/extrabutton1.png','mybutton','...','...','...')
>
> If the image is not found, you should see a simple text 'mybutton' (the
> second parameter of the function addInsertButton() ) instead of the
> button. if you see nothing, force-refresh your browser.
>
> NB : you can also let {'imageFile': 'http://upload.wikimedia.org/' + img,
> and use an image available on the wikimedia server
>
>
>> If you read it (I'm to too technical, and can read only the basic) this
>> is strange:
>> This file is uploaded:
>> importScript('MediaWiki:Scripts/Edittools1.js').
>> 1. there is no such script
>> 2. "Scripts/" looks strange to me
>> 3. there is a 'MediaWiki:Edittools.js' but uploading (and correcting the
>> script) had no effect.
>> http://www.mediawiki.org/wiki/MediaWiki:Edittools.js
>>
>> Then I noticed this:
>> loadCommonsEdittoos - twice
>> No "l" there: loadCommonsEdittools
>> But no effect here either (nor in combination of above). Nor using it
>> together with the button links in the script.
>> Rein
>
> I don't use these two scripts, so they don't seem to be required to make
> the extra buttons work
>
>
>
> NB : for the extra buttons above the edit text pane, I just added (and
> adapted) some of the function of Mediawiki:Editpage.js in my
> Mediawiki:Common.js, instead of creating a MediaWiki:Editpage.js page on
> my wiki
>
> so basically my Mediawiki:Common.js is simply :
>
> /* Any JavaScript here will be loaded for all users on every page load. */
> /**
> * Add extra buttons above edit panel
> */
>
> function addCustomButton(imageFile, speedTip, tagOpen, tagClose,
> sampleText, imageId) {
> mwCustomEditButtons[mwCustomEditButtons.length] =
> {"imageId": imageId,
> "imageFile": imageFile,
> "speedTip": speedTip,
> "tagOpen": tagOpen,
> "tagClose": tagClose,
> "sampleText": sampleText};
> }
>
> addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png',
> 'strike',
> '<s>',
> '</s>',
> '',
> 'mw-editbutton-strike');
>
>
> could you check what happen if you have only this in your
> Mediawiki:Common.js (+ clear your browser's cache) ?
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.0.0/1486 - Release Date: 05/06/2008
> 18:29
>
>



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


onekopaka at gmail

Jun 6, 2008, 3:28 PM

Post #8 of 12 (677 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

actually, you need the SourceHighlight Extension, and
MediaWiki:Common.js/edit.js from english wikipedia.

Sorry.
On Jun 6, 2008, at 9:19 AM, Dr JFBurté wrote:

>
>> I don't use these two scripts, so they don't seem to be required to
>> make
>> the extra buttons work
>
> Me too,
> (but I only use "text display" and not "button fashion" for the text
> to
> insert, and that's enough for me)
> It's seems that perharps successive version exist to make edittools
> work,
> but differently with/or without "button images" ? but it remains
> possible to
> adapt the <span> with css ?
>
> For me just [[MediaWiki:Edittols]], Common.js, Common.css, and
> Charinsert
> extension and the {{+|+}}
> (Sorry you can't edit my site if you are not logged as asso user)
> So Rein, look/search for the term "edittols" in
> http://fr.wikipedia.org/w/index.php?title=MediaWiki:Common.js
> @+ de jfb "enjoy my 0.02$"
>
> ----- Original Message -----
> From: "Alexis Moinet" <alexis.moinet [at] fpms>
> To: "Mediawiki" <mediawiki-l [at] lists>
> Sent: Friday, June 06, 2008 2:55 PM
> Subject: Re: [Mediawiki-l] making extra buttons in edit page tool
>
>
>> Rein wrote :
>>> I think the problem is rather that the script is not okay.
>>
>> well, it works fine on my local vanilla install :-)
>>
>>
>>> First it is obvious that at mediawiki the script has no results
>>> (no extra
>>> buttons shown). That's strange because you would think there
>>> should be a
>>> working script!
>>
>> I do see extra buttons for any editable page at http://www.mediawiki.org
>> (when I click on 'edit', I see the 3 buttons just above the edit
>> panel.
>> They look like this : '#R', '-' and 'Cat')
>>
>>
>>> http://www.mediawiki.org/wiki/MediaWiki:Editpage.js
>>> This is the script I used. I altered like I wrote the destination
>>> of the
>>> buttons itself and placed them on my site (of course some I made
>>> myself).
>>
>> can you show us the altered code or a link to your site (if it's not
>> local)
>>
>>
>>> This line should also puzzles me:
>>> {'imageFile': 'http://upload.wikimedia.org/' + img,
>>> Shouldn't it be to my own site (I tried but am not sure what the url
>>> should be)
>>> And I think it is connected with the urls of the buttons?
>>
>> it's the url of the image displayed as a button.
>>
>> you can replace it with : {'imageFile': 'http://yourwebsite/' + img,
>>
>> and use the url to the image on your website in the call to
>> addInsertButton()
>>
>> so if the image is in http://youwebsite/images/extrabutton1.png,
>> you have
>>
>> {'imageFile': 'http://yourwebsite/' + img,
>>
>> and
>>
>> addInsertButton('images/
>> extrabutton1.png','mybutton','...','...','...')
>>
>> If the image is not found, you should see a simple text
>> 'mybutton' (the
>> second parameter of the function addInsertButton() ) instead of the
>> button. if you see nothing, force-refresh your browser.
>>
>> NB : you can also let {'imageFile': 'http://upload.wikimedia.org/'
>> + img,
>> and use an image available on the wikimedia server
>>
>>
>>> If you read it (I'm to too technical, and can read only the basic)
>>> this
>>> is strange:
>>> This file is uploaded:
>>> importScript('MediaWiki:Scripts/Edittools1.js').
>>> 1. there is no such script
>>> 2. "Scripts/" looks strange to me
>>> 3. there is a 'MediaWiki:Edittools.js' but uploading (and
>>> correcting the
>>> script) had no effect.
>>> http://www.mediawiki.org/wiki/MediaWiki:Edittools.js
>>>
>>> Then I noticed this:
>>> loadCommonsEdittoos - twice
>>> No "l" there: loadCommonsEdittools
>>> But no effect here either (nor in combination of above). Nor using
>>> it
>>> together with the button links in the script.
>>> Rein
>>
>> I don't use these two scripts, so they don't seem to be required to
>> make
>> the extra buttons work
>>
>>
>>
>> NB : for the extra buttons above the edit text pane, I just added
>> (and
>> adapted) some of the function of Mediawiki:Editpage.js in my
>> Mediawiki:Common.js, instead of creating a MediaWiki:Editpage.js
>> page on
>> my wiki
>>
>> so basically my Mediawiki:Common.js is simply :
>>
>> /* Any JavaScript here will be loaded for all users on every page
>> load. */
>> /**
>> * Add extra buttons above edit panel
>> */
>>
>> function addCustomButton(imageFile, speedTip, tagOpen, tagClose,
>> sampleText, imageId) {
>> mwCustomEditButtons[mwCustomEditButtons.length] =
>> {"imageId": imageId,
>> "imageFile": imageFile,
>> "speedTip": speedTip,
>> "tagOpen": tagOpen,
>> "tagClose": tagClose,
>> "sampleText": sampleText};
>> }
>>
>> addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png'
>> ,
>> 'strike',
>> '<s>',
>> '</s>',
>> '',
>> 'mw-editbutton-strike');
>>
>>
>> could you check what happen if you have only this in your
>> Mediawiki:Common.js (+ clear your browser's cache) ?
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>
>>
>>
>> --
>> No virus found in this incoming message.
>> Checked by AVG.
>> Version: 7.5.524 / Virus Database: 270.0.0/1486 - Release Date:
>> 05/06/2008
>> 18:29
>>
>>
>
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Darren VanBuren
onekopaka [at] gmail
----------------------------------------------
Administrator of Onekopakaspace

Trunk MediaWiki install:
http://oks.verymad.net/~onekopaka/mwtrunk/


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


onekopaka at gmail

Jun 6, 2008, 3:31 PM

Post #9 of 12 (672 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

Correction:

SyntaxHighlight extension. Sorry.
On Jun 6, 2008, at 3:28 PM, Darren VanBuren wrote:

> actually, you need the SourceHighlight Extension, and
> MediaWiki:Common.js/edit.js from english wikipedia.
>
> Sorry.
> On Jun 6, 2008, at 9:19 AM, Dr JFBurté wrote:
>
>>
>>> I don't use these two scripts, so they don't seem to be required
>>> to make
>>> the extra buttons work
>>
>> Me too,
>> (but I only use "text display" and not "button fashion" for the
>> text to
>> insert, and that's enough for me)
>> It's seems that perharps successive version exist to make edittools
>> work,
>> but differently with/or without "button images" ? but it remains
>> possible to
>> adapt the <span> with css ?
>>
>> For me just [[MediaWiki:Edittols]], Common.js, Common.css, and
>> Charinsert
>> extension and the {{+|+}}
>> (Sorry you can't edit my site if you are not logged as asso user)
>> So Rein, look/search for the term "edittols" in
>> http://fr.wikipedia.org/w/index.php?title=MediaWiki:Common.js
>> @+ de jfb "enjoy my 0.02$"
>>
>> ----- Original Message -----
>> From: "Alexis Moinet" <alexis.moinet [at] fpms>
>> To: "Mediawiki" <mediawiki-l [at] lists>
>> Sent: Friday, June 06, 2008 2:55 PM
>> Subject: Re: [Mediawiki-l] making extra buttons in edit page tool
>>
>>
>>> Rein wrote :
>>>> I think the problem is rather that the script is not okay.
>>>
>>> well, it works fine on my local vanilla install :-)
>>>
>>>
>>>> First it is obvious that at mediawiki the script has no results
>>>> (no extra
>>>> buttons shown). That's strange because you would think there
>>>> should be a
>>>> working script!
>>>
>>> I do see extra buttons for any editable page at http://www.mediawiki.org
>>> (when I click on 'edit', I see the 3 buttons just above the edit
>>> panel.
>>> They look like this : '#R', '-' and 'Cat')
>>>
>>>
>>>> http://www.mediawiki.org/wiki/MediaWiki:Editpage.js
>>>> This is the script I used. I altered like I wrote the destination
>>>> of the
>>>> buttons itself and placed them on my site (of course some I made
>>>> myself).
>>>
>>> can you show us the altered code or a link to your site (if it's not
>>> local)
>>>
>>>
>>>> This line should also puzzles me:
>>>> {'imageFile': 'http://upload.wikimedia.org/' + img,
>>>> Shouldn't it be to my own site (I tried but am not sure what the
>>>> url
>>>> should be)
>>>> And I think it is connected with the urls of the buttons?
>>>
>>> it's the url of the image displayed as a button.
>>>
>>> you can replace it with : {'imageFile': 'http://yourwebsite/' + img,
>>>
>>> and use the url to the image on your website in the call to
>>> addInsertButton()
>>>
>>> so if the image is in http://youwebsite/images/extrabutton1.png,
>>> you have
>>>
>>> {'imageFile': 'http://yourwebsite/' + img,
>>>
>>> and
>>>
>>> addInsertButton('images/
>>> extrabutton1.png','mybutton','...','...','...')
>>>
>>> If the image is not found, you should see a simple text
>>> 'mybutton' (the
>>> second parameter of the function addInsertButton() ) instead of the
>>> button. if you see nothing, force-refresh your browser.
>>>
>>> NB : you can also let {'imageFile': 'http://upload.wikimedia.org/'
>>> + img,
>>> and use an image available on the wikimedia server
>>>
>>>
>>>> If you read it (I'm to too technical, and can read only the
>>>> basic) this
>>>> is strange:
>>>> This file is uploaded:
>>>> importScript('MediaWiki:Scripts/Edittools1.js').
>>>> 1. there is no such script
>>>> 2. "Scripts/" looks strange to me
>>>> 3. there is a 'MediaWiki:Edittools.js' but uploading (and
>>>> correcting the
>>>> script) had no effect.
>>>> http://www.mediawiki.org/wiki/MediaWiki:Edittools.js
>>>>
>>>> Then I noticed this:
>>>> loadCommonsEdittoos - twice
>>>> No "l" there: loadCommonsEdittools
>>>> But no effect here either (nor in combination of above). Nor
>>>> using it
>>>> together with the button links in the script.
>>>> Rein
>>>
>>> I don't use these two scripts, so they don't seem to be required
>>> to make
>>> the extra buttons work
>>>
>>>
>>>
>>> NB : for the extra buttons above the edit text pane, I just added
>>> (and
>>> adapted) some of the function of Mediawiki:Editpage.js in my
>>> Mediawiki:Common.js, instead of creating a MediaWiki:Editpage.js
>>> page on
>>> my wiki
>>>
>>> so basically my Mediawiki:Common.js is simply :
>>>
>>> /* Any JavaScript here will be loaded for all users on every page
>>> load. */
>>> /**
>>> * Add extra buttons above edit panel
>>> */
>>>
>>> function addCustomButton(imageFile, speedTip, tagOpen, tagClose,
>>> sampleText, imageId) {
>>> mwCustomEditButtons[mwCustomEditButtons.length] =
>>> {"imageId": imageId,
>>> "imageFile": imageFile,
>>> "speedTip": speedTip,
>>> "tagOpen": tagOpen,
>>> "tagClose": tagClose,
>>> "sampleText": sampleText};
>>> }
>>>
>>> addCustomButton('http://upload.wikimedia.org/wikipedia/commons/c/c9/Button_strike.png'
>>> ,
>>> 'strike',
>>> '<s>',
>>> '</s>',
>>> '',
>>> 'mw-editbutton-strike');
>>>
>>>
>>> could you check what happen if you have only this in your
>>> Mediawiki:Common.js (+ clear your browser's cache) ?
>>>
>>>
>>> _______________________________________________
>>> MediaWiki-l mailing list
>>> MediaWiki-l [at] lists
>>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>>
>>>
>>>
>>> --
>>> No virus found in this incoming message.
>>> Checked by AVG.
>>> Version: 7.5.524 / Virus Database: 270.0.0/1486 - Release Date:
>>> 05/06/2008
>>> 18:29
>>>
>>>
>>
>>
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> MediaWiki-l [at] lists
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
> Darren VanBuren
> onekopaka [at] gmail
> ----------------------------------------------
> Administrator of Onekopakaspace
>
> Trunk MediaWiki install:
> http://oks.verymad.net/~onekopaka/mwtrunk/
>

Darren VanBuren
onekopaka [at] gmail
----------------------------------------------
Administrator of Onekopakaspace

Trunk MediaWiki install:
http://oks.verymad.net/~onekopaka/mwtrunk/


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


rein at livingtale

Jun 15, 2008, 6:09 AM

Post #10 of 12 (607 views)
Permalink
making extra buttons in edit page tool [In reply to]

Thank you all for your remarks and ideas.
But....
I think (no: I know!) it is much simpler after all.
No need for extra js script, simply use: /includes/EditPage.php and make some modifications in $toolarray = array(:
For instance take:
array( 'image' => 'button_nowiki.png',
'id' => 'mw-editbutton-nowiki',
'open' => "<nowiki>",
'close' => "</nowiki>",
'sample'=> wfMsg('nowiki_sample'),
'tip' => wfMsg('nowiki_tip'),
'key' => 'N'
)
Copy and change it par example in a button for an intern anchorlink:
array( 'image' => 'intern.gif',
'id' => 'mw-editbutton-exlink',
'open' => "[[#",
'close' => "|to headline]]",
'sample'=> 'This Head',
'tip' => 'a link to \'This Head\' on the same page - remind the caption ',
'key' => ''
),

And you have a superior button!
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


alexis.moinet at fpms

Jun 16, 2008, 1:03 AM

Post #11 of 12 (589 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

Indeed, but be aware that every time you upgrade Mediawiki code, you'll have to do it again ;-)

The whole idea of extra-js-in-the-wiki is not to have to change the Mediawiki core code on every upgrade.

Rein wrote :
> Thank you all for your remarks and ideas.
> But....
> I think (no: I know!) it is much simpler after all.
> No need for extra js script, simply use: /includes/EditPage.php and make some modifications in $toolarray = array(:
> For instance take:
> array( 'image' => 'button_nowiki.png',
> 'id' => 'mw-editbutton-nowiki',
> 'open' => "<nowiki>",
> 'close' => "</nowiki>",
> 'sample'=> wfMsg('nowiki_sample'),
> 'tip' => wfMsg('nowiki_tip'),
> 'key' => 'N'
> )
> Copy and change it par example in a button for an intern anchorlink:
> array( 'image' => 'intern.gif',
> 'id' => 'mw-editbutton-exlink',
> 'open' => "[[#",
> 'close' => "|to headline]]",
> 'sample'=> 'This Head',
> 'tip' => 'a link to \'This Head\' on the same page - remind the caption ',
> 'key' => ''
> ),
>
> And you have a superior button!


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


burtejf at orange

Jun 16, 2008, 12:27 PM

Post #12 of 12 (572 views)
Permalink
Re: making extra buttons in edit page tool [In reply to]

n'aurais-tu pas un pb de hiérarchie puisque ton image wiki est là:
http://www.wikisciences.jean-emile.com/skins/common/images/mediawiki.png
et non pas là (code source de la page d'accueil)
<img src="/wiki.phtmlskins/common/images/mediawiki.png" alt='The MediaWiki
logo' />
et que ton install est accessible depuis
http://www.wikisciences.jean-emile.com/config/index.php


@+ de jfb "0.02$"----- Original Message -----
From: "Alexis Moinet" <alexis.moinet [at] fpms>
To: "Mediawiki" <mediawiki-l [at] lists>
Sent: Monday, June 16, 2008 10:03 AM
Subject: Re: [Mediawiki-l] making extra buttons in edit page tool


>
> Indeed, but be aware that every time you upgrade Mediawiki code, you'll
> have to do it again ;-)
>
> The whole idea of extra-js-in-the-wiki is not to have to change the
> Mediawiki core code on every upgrade.
>
> Rein wrote :
>> Thank you all for your remarks and ideas.
>> But....
>> I think (no: I know!) it is much simpler after all.
>> No need for extra js script, simply use: /includes/EditPage.php and make
>> some modifications in $toolarray = array(:
>> For instance take:
>> array( 'image' => 'button_nowiki.png',
>> 'id' => 'mw-editbutton-nowiki',
>> 'open' => "<nowiki>",
>> 'close' => "</nowiki>",
>> 'sample'=> wfMsg('nowiki_sample'),
>> 'tip' => wfMsg('nowiki_tip'),
>> 'key' => 'N'
>> )
>> Copy and change it par example in a button for an intern anchorlink:
>> array( 'image' => 'intern.gif',
>> 'id' => 'mw-editbutton-exlink',
>> 'open' => "[[#",
>> 'close' => "|to headline]]",
>> 'sample'=> 'This Head',
>> 'tip' => 'a link to \'This Head\' on the same page - remind the
>> caption ',
>> 'key' => ''
>> ),
>>
>> And you have a superior button!
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l [at] lists
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> ---------------------------------------------------------------------------------------
> Orange vous informe que cet e-mail a ete controle par l'anti-virus mail.
> Aucun virus connu a ce jour par nos services n'a ete detecte.
>
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.524 / Virus Database: 270.3.0/1504 - Release Date: 15/06/2008
> 17:52
>
>



_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.