Revision 40784 of "MediaWiki:Gadget-share.js" on zhwikivoyage/* <source lang="javascript">
Please keep the following lines intact
Userscript: [[User:TheDJ/Sharebox]]. Sharebox is a script that changes your toolbox.
It adds a new order, some icons and a share button to publish something to facebook for instance.
This share button is powered by addthis ( http://www.addthis.com/ )
You can install it by adding "importScript( 'User:TheDJ/sharebox.js' );" to
your [[Special:MyPage/monobook.js]].
Written by: [[User:TheDJ]]
<nowiki> */
var addthis_config = {
data_use_flash: false,
data_use_cookies: false,
ui_language: wgUserLanguage,
};
importScriptURI('//s7.addthis.com/js/250/addthis_widget.js?pub=xa-4a83143d4db59aef');
function localaddthis() {
var toolbox_ul = document.getElementById( 't-specialpages' ).parentNode;
var permael = document.getElementById( 't-permalink');
var printel = document.getElementById( 't-print' );
var pdfel = document.getElementById( 'coll-download-as-rl' );
var citeel = document.getElementById( 't-cite' );
var newel;
if( citeel || permael )
{
newel = document.createElement("LI");
var newhtml = '<div class="addthis_toolbox addthis_default_style">';
if( citeel )
newhtml += '<a class="at300m" href="' + citeel.getElementsByTagName("A")[0].href + '" title="' + citeel.getElementsByTagName("A")[0].title + '"><span class="at300bs" style="background: url(); font-size: larger; color:black;">“ ”</span> Cite</a>';
if( citeel && permael )
newhtml += '<span class="addthis_separator"></span>';
if( permael ) {
newhtml += '<a class="at300m" href="' + permael.getElementsByTagName("A")[0].href + '" title="' + permael.getElementsByTagName("A")[0].title;
if( citeel )
newhtml += '" style="position:absolute; left:7em;';
newhtml += '">' /*<span class="at300bs" style="background: url();"></span> */ + 'Permalink</a>';
}
newhtml +='</div>';
newel.innerHTML = newhtml;
if( citeel ) toolbox_ul.removeChild( citeel );
if( permael ) toolbox_ul.removeChild( permael );
toolbox_ul.insertBefore( newel, toolbox_ul.firstChild );
}
var shareel = document.createElement("LI");
shareel.innerHTML= '<div class="addthis_toolbox addthis_default_style"><a class="addthis_button_email"> E-mail</a><span class="addthis_separator"></span><a class="addthis_button_compact" style="position:absolute; left:8em;">Share</a></div>';
toolbox_ul.insertBefore( shareel, toolbox_ul.firstChild );
if( printel && pdfel ) {
var export_ul = printel.parentNode;
if ( export_ul ) {
newel = document.createElement("LI");
newel.innerHTML= '<div class="addthis_toolbox addthis_default_style"><a class="addthis_button_print"> Print</a><span class="addthis_separator"></span><a class="at300m" href="' + pdfel.getElementsByTagName("A")[0].href + '" title="' + pdfel.getElementsByTagName("A")[0].title + '" style="position:absolute; left:8em;"><span class="at300bs" style="background: url(//upload.wikimedia.org/wikipedia/commons/2/23/Icons-mini-file_acrobat.gif);"></span> PDF</a></div>';
export_ul.removeChild( printel );
export_ul.removeChild( pdfel );
export_ul.insertBefore( newel, export_ul.firstChild );
}
}
}
addOnloadHook(localaddthis);
/* </nowiki></source> */All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://zh.wikivoyage.org/w/index.php?oldid=40784.
![]() ![]() This site is not affiliated with or endorsed in any way by the Wikimedia Foundation or any of its affiliates. In fact, we fucking despise them.
|