1 $( '.tools-share' ).click( function () {
3 var ns, title, url, host;
4 host = mw.config.get( 'wgServer' );
5 if ( host.startsWith( '//' ) ) {
6 host = location.protocol + host;
8 ns = mw.config.get('wgNamespaceNumber')
9 title = mw.config.get( 'wgTitle' );
11 title = mw.config.get( 'wgFormattedNamespaces' )[ns] + ':' + title;
13 url = host + mw.config.get( 'wgScriptPath' ) + '/index.php?curid=' + mw.config.get( 'wgArticleId' )
16 text: title + ' - ' + mw.config.get( 'wgSiteName' ),
18 hashtags: [ mw.config.get( 'wgSiteName' ).replace( / /g, '_' ) ]
20 .catch( function ( error ) {
21 console.error( 'Share API error: ', error );