Revision 338532 of "Użytkownik:Tommy Jantarek/common.js" on plwikiquotemw.loader.using( "ext.gadget.lib-toolbar", function() {
toolbarGadget.addButton( {
title: 'źródło',
alt: 'źródło',
icon: '//http://upload.wikimedia.org/wikipedia/commons/4/4c/RomanZ-01.svg/22px-RomanZ-01.svg',
onclick: function() {
mw.toolbar.insertTags( '** Źródło: ', '', '', '' )
},
section: 'main',
group: 'insert'
} );
toolbarGadget.addButton( {
title: 'Autor',
alt: 'Autor',
icon: '//http://upload.wikimedia.org/wikipedia/commons/9/98/RomanA-01.svg/22px-RomanA-01.svg',
onclick: function() {
mw.toolbar.insertTags( '** Autor: ', '', '', '' )
},
section: 'main',
group: 'insert'
} );
toolbarGadget.addButton( {
title: 'Zobacz',
alt: 'Zobacz',
icon: '//upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Noia_64_apps_kmix_mod.png/22px-Noia_64_apps_kmix_mod.png',
onclick: function() {
mw.toolbar.insertTags( '** Zobacz: ', '', '', '' )
},
section: 'main',
group: 'insert'
} );
} );
/*
This imports the latest version of HotCat from Commons.
HotCat is a gadget to make changes to categories much easier.
Full documentation can be found at http://commons.wikimedia.org/wiki/Help:Gadget-HotCat
*/
if ( mw.config.get( 'wgServer' ).indexOf('https://') == 0 ) {
mw.loader.load( 'https://secure.wikimedia.org/wikipedia/commons/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );
} else {
mw.loader.load( 'http://commons.wikimedia.org/w/index.php?title=MediaWiki:Gadget-HotCat.js&action=raw&ctype=text/javascript' );
}
var hotcat_no_autocommit = true;
// Original version:
// - QuickHistory script by [[:pl:User:ChP94]]
// - Released under the [http://www.gnu.org/licenses/gpl.txt GNU Public License (GPL)]
// Modified by [[:pl:User:Beau]]
/* Translatable strings */
mw.messages.set( {
'quickhistory-close': 'Zamknij.'
} );
window.quickHistoryGagdet = {
/** Version of the gadget */
version: 4,
limit: 15,
panel: null,
timer: null,
trigger: null,
init: function() {
var that = this;
var events = {
mousemove: function() {
if ( !that.timer ) {
that.timer = setTimeout( function() {
that.showHistory()
}, 500 );
that.trigger = this;
}
},
mouseout: function() {
if ( that.timer ) {
clearTimeout( that.timer );
that.timer = null;
}
}
};
jQuery( "#ca-history" ).bind( events );
jQuery( "[rel=archives]" ).bind( events );
},
showHistory: function() {
var that = this;
if ( this.panel ) {
return;
}
this.panel = document.createElement( "div" );
this.panel.style.cssText = "background-color: #FDF5E6; display: none; position: absolute; z-index: 200";
var divClose = document.createElement( "div" );
divClose.style.cssText = "background-color: #CD853F; width: 100%; text-align: center; cursor:pointer; color: #FDF5E6;";
divClose.appendChild( document.createTextNode( mw.msg( 'quickhistory-close' ) ) );
divClose.onclick = function() {
that.hideHistory();
};
this.panel.appendChild( divClose );
var divHistory = document.createElement( "div" );
this.panel.appendChild( divHistory );
this.panel.style.top = ( jQuery( this.trigger ).offset().top + jQuery( this.trigger ).height() + 2 ) + "px";
var width = Math.round( document.body.clientWidth * 0.7 );
var left = jQuery( this.trigger ).offset().left + ( jQuery( this.trigger ).width() / 2 ) - ( width / 2 );
if ( left < 0 ) {
left = 0;
} else if ( left + width > document.body.clientWidth ) {
left = document.body.clientWidth - width;
}
this.panel.style.width = width + "px";
this.panel.style.left = left + "px";
document.body.appendChild( this.panel );
jQuery( divHistory ).load(
mw.util.wikiScript() + '?limit=' + this.limit + '&title=' + encodeURIComponent( mw.config.get( "wgPageName" ) ) + '&action=history #mw-history-compare', function() {
that.panel.style.display = "block";
} );
},
hideHistory: function() {
if ( this.panel ) {
document.body.removeChild( this.panel );
this.panel = null;
}
}
};
jQuery( document ).ready( function() {
quickHistoryGagdet.init();
} );All content in the above text box is licensed under the Creative Commons Attribution-ShareAlike license Version 4 and was originally sourced from https://pl.wikiquote.org/w/index.php?oldid=338532.
![]() ![]() 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.
|