Difference between revisions of "MediaWiki:Perseids-toolbar.js"
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
.after( |
.after( |
||
$( '<a>' ) |
$( '<a>' ) |
||
− | .addClass('wikibase-toolbarbutton |
+ | .addClass('wikibase-toolbarbutton perseids-toolbar-edit') |
.attr( { |
.attr( { |
||
'href': '#' |
'href': '#' |
||
Line 21: | Line 21: | ||
.after( |
.after( |
||
$( '<a>' ) |
$( '<a>' ) |
||
− | .addClass('wikibase-toolbarbutton |
+ | .addClass('wikibase-toolbarbutton perseids-toolbar-add') |
.attr( { |
.attr( { |
||
'href': '#' |
'href': '#' |
||
Line 37: | Line 37: | ||
.after( |
.after( |
||
$( '<a>' ) |
$( '<a>' ) |
||
− | .addClass('wikibase-toolbarbutton |
+ | .addClass('wikibase-toolbarbutton perseids-toolbar-save') |
.attr( { |
.attr( { |
||
'href': '#' |
'href': '#' |
Revision as of 11:10, 31 July 2014
function setPerseidsToolbarEdit() { $('.perseids-toolbar-edit').remove(); // Resets all links $( '.wikibase-toolbareditgroup-innoneditmode .wikibase-toolbar .wikibase-toolbarbutton' ) .after( $( '<a>' ) .addClass('wikibase-toolbarbutton perseids-toolbar-edit') .attr( { 'href': '#' } ) .before( '|' ) .text( 'edit in Perseids' ) .click( function ( event ) { event.preventDefault(); } ) ); } $( '.wb-claim-section .wb-addtoolbar .wb-editsection a.wikibase-toolbarbutton') .after( $( '<a>' ) .addClass('wikibase-toolbarbutton perseids-toolbar-add') .attr( { '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>' ) .addClass('wikibase-toolbarbutton perseids-toolbar-save') .attr( { 'href': '#' } ) .before( '|' ) .text( 'save to Perseids' ) .click( function ( event ) { event.preventDefault(); } ) ); }); setPerseidsToolbarEdit(); $( '.wikibase-toolbar' ).click( setPerseidsToolbarEdit );