Difference between revisions of "MediaWiki:Perseids-toolbar.js"
Jump to navigation
Jump to search
(revert) |
|||
| Line 1: | Line 1: | ||
| − | function setPerseidsToolbarEdit() { |
||
| + | $( '.wikibase-toolbareditgroup-innoneditmode .wikibase-toolbar .wikibase-toolbarbutton' ) |
||
| − | |||
| + | .after( |
||
| − | $('.perseids-toolbar-edit', $(this).parent()).remove(); // Resets all links |
||
| + | $( '<a>' ) |
||
| − | $('.toolbar-separator', $(this).parent()).remove(); |
||
| + | .attr( { |
||
| − | |||
| + | 'class': 'wikibase-toolbarbutton', |
||
| − | $( '.wikibase-toolbareditgroup-innoneditmode .wikibase-toolbar .wikibase-toolbarbutton' ) |
||
| + | 'href': '#' |
||
| − | .after( |
||
| + | } ) |
||
| − | + | .before( '|' ) |
|
| − | + | .text( 'edit in Perseids' ) |
|
| − | + | .click( function ( event ) { |
|
| − | + | /*event.preventDefault();*/ |
|
| − | + | } ) |
|
| − | + | ); |
|
| − | .text( 'edit in Perseids' ) |
||
| − | .click( function ( event ) { |
||
| − | event.preventDefault(); |
||
| − | } ) |
||
| − | ); |
||
| − | } |
||
$( '.wb-claim-section .wb-addtoolbar .wb-editsection a.wikibase-toolbarbutton') |
$( '.wb-claim-section .wb-addtoolbar .wb-editsection a.wikibase-toolbarbutton') |
||
.after( |
.after( |
||
$( '<a>' ) |
$( '<a>' ) |
||
| − | .addClass('wikibase-toolbarbutton perseids-toolbar-add') |
||
.attr( { |
.attr( { |
||
| + | 'class': 'wikibase-toolbarbutton', |
||
'href': '#' |
'href': '#' |
||
} ) |
} ) |
||
| − | .before( |
+ | .before( '|' ) |
.text( 'add via Perseids' ) |
.text( 'add via Perseids' ) |
||
.click( function ( event ) { |
.click( function ( event ) { |
||
| − | event.preventDefault(); |
+ | /*event.preventDefault();*/ |
} ) |
} ) |
||
); |
); |
||
| − | |||
| + | |||
$( '.wikibase-toolbareditgroup .wikibase-toolbarbutton:not(.wikibase-toolbarbutton-disabled' ).click(function () { |
$( '.wikibase-toolbareditgroup .wikibase-toolbarbutton:not(.wikibase-toolbarbutton-disabled' ).click(function () { |
||
| − | + | $( '.wikibase-toolbareditgroup-ineditmode .wikibase-toolbar .wikibase-toolbarbutton') |
|
| − | + | .slice(-2,-1) |
|
| − | + | .after( |
|
| − | + | $( '<a>' ) |
|
| − | + | .attr( { |
|
| − | + | 'class': 'wikibase-toolbarbutton', |
|
| − | + | 'href': '#' |
|
| − | + | } ) |
|
| − | + | .before( '|' ) |
|
| − | + | .text( 'save to Perseids' ) |
|
| − | + | .click( function ( event ) { |
|
| − | + | /*event.preventDefault();*/ |
|
| − | + | } ) |
|
| − | + | ); |
|
| − | + | }); |
|
| − | |||
| − | setPerseidsToolbarEdit(); |
||
| − | $( '.wikibase-toolbar' ).click( setPerseidsToolbarEdit ); |
||
Revision as of 11:19, 31 July 2014
$( '.wikibase-toolbareditgroup-innoneditmode .wikibase-toolbar .wikibase-toolbarbutton' )
.after(
$( '<a>' )
.attr( {
'class': 'wikibase-toolbarbutton',
'href': '#'
} )
.before( '|' )
.text( 'edit in Perseids' )
.click( function ( event ) {
/*event.preventDefault();*/
} )
);
$( '.wb-claim-section .wb-addtoolbar .wb-editsection a.wikibase-toolbarbutton')
.after(
$( '<a>' )
.attr( {
'class': 'wikibase-toolbarbutton',
'href': '#'
} )
.before( '|' )
.text( 'add via Perseids' )
.click( function ( event ) {
/*event.preventDefault();*/
} )
);
$( '.wikibase-toolbareditgroup .wikibase-toolbarbutton:not(.wikibase-toolbarbutton-disabled' ).click(function () {
$( '.wikibase-toolbareditgroup-ineditmode .wikibase-toolbar .wikibase-toolbarbutton')
.slice(-2,-1)
.after(
$( '<a>' )
.attr( {
'class': 'wikibase-toolbarbutton',
'href': '#'
} )
.before( '|' )
.text( 'save to Perseids' )
.click( function ( event ) {
/*event.preventDefault();*/
} )
);
});