Użytkownik:Michał56/common.js: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
M Znacznik: edytor źródłowy |
Znacznik: edytor źródłowy |
||
Linia 72: | Linia 72: | ||
;(function($, mw) { |
;(function($, mw) { |
||
var username = mw.config.get("wgPageName").split("/")[1]; |
|||
$('#contribs-tools').click(function() { |
$('#contribs-tools').click(function() { |
||
$.showCustomModal('Narzędzia — ' + |
$.showCustomModal('Narzędzia — ' + username, '<div class="input-group"><label>Powód:</label><input id="reason" type="text" maxlength="150" value="[[c:help:vandalism]]"> <span id="banReasonV" class="button">V</span> <span id="banReasonS" class="button">S</span> <span id="banReasonP" class="button">P</span> <span id="banReasonOB" class="button">OB</span></div><br/><div class="input-group"><label>Czas blokady:</label><input id="time" type="text" maxlength="150" value="2 weeks"> <span id="banTime12h" class="button">12h</span> <span id="banTime2w" class="button">2w</span> <span id="banTime3m" class="button">3m</span> <span id="banTimeInf" class="button">inf</span></div>', { |
||
id: 'tools', |
id: 'tools', |
||
width: 600, |
width: 600, |
||
Linia 85: | Linia 86: | ||
}] |
}] |
||
}); |
}); |
||
var ReasonBan = document.getElementById("reason"); |
|||
var TimeBan = document.getElementById("time"); |
|||
document.getElementById("banReasonV").onclick = function() { |
|||
ReasonBan.value = '[[c:help:vandalism|Vandalism]]'; |
|||
} |
|||
document.getElementById("banReasonS").onclick = function() { |
|||
ReasonBan.value = '[[c:help:spam|Spam]]'; |
|||
} |
|||
document.getElementById("banReasonP").onclick = function() { |
|||
ReasonBan.value = '[[w:c:nonsensopedia:Nonsensopedia:Prywata|Prywata]]'; |
|||
} |
|||
document.getElementById("banReasonOB").onclick = function() { |
|||
ReasonBan.value = 'Omijanie bana'; |
|||
TimeBan.value = 'infinite'; |
|||
} |
|||
document.getElementById("banTime12h").onclick = function() { |
|||
TimeBan.value = '12 hours'; |
|||
} |
|||
document.getElementById("banTime2w").onclick = function() { |
|||
TimeBan.value = '2 weeks'; |
|||
} |
|||
document.getElementById("banTime3m").onclick = function() { |
|||
TimeBan.value = '3 months'; |
|||
} |
|||
document.getElementById("banTimeInf").onclick = function(){ |
|||
TimeBan.value = 'infinite'; |
|||
} |
|||
}); |
}); |
||
Wersja z 10:43, 3 lut 2016
//importy
importScript('User:Michał56/ostatnie zmiany.js');
importScript('User:Expert3222/RollbackAll.js');
importScript('MediaWiki:Gadget-myNotepad.js');
importScript('MediaWiki:Gadget-AjaxRC.js');
importScript('MediaWiki:Gadget-ReferencePopups.js');
importScript('MediaWiki:Gadget-AutoEd.js');
//dodatkowe przyciski w edytorze
if (typeof (mwCustomEditButtons) != 'undefined') {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "http://upload.wikimedia.org/wikipedia/commons/2/26/Button_latinas.png",
"speedTip": "Wstaw polskie cudzysłowy",
"tagOpen": "„",
"tagClose": "”",
"sampleText": ""
};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "https://upload.wikimedia.org/wikipedia/commons/3/3f/Button_headline_-_2.png",
"speedTip": "Wstaw półpauzę",
"tagOpen": "–",
"tagClose": "",
"sampleText": ""
};
}
//fast delete buttons
window.fdButtons = [];
window.fdButtons.push(
{
summary: '[[Nonsensopedia:Bo tak|Bo tak]]',
label: 'Bo tak'
},
{
summary: '[[Nonsensopedia:Wandalizm|Wandalizm]]',
label: 'Wandalizm'
},
{
summary: '[[Nonsensopedia:Prywata|Prywata]]',
label: 'Prywata'
}
);
importArticles( {
type: 'script',
articles: [
// ...
'u:dev:FastDelete/code.js',
// ...
]
} );
;(function($, mw) {
switch (mw.config.get('wgCanonicalSpecialPageName')) {
case "Contributions":
$('#contentSub a:nth-child(8)').after(' • <a id="nuke" href="http://nonsensopedia.wikia.com/wiki/Special:Nuke/' + mw.config.get('wgPageName').split('/')[1] + '">masowe usuwanie</a>');
break;
}
}) (this.jQuery, this.mediaWiki);
;(function($, mw) {
switch (mw.config.get('wgCanonicalSpecialPageName')) {
case "Contributions":
$('#contentSub a:nth-child(9)').after(' • <a href="#" id="contribs-tools">narzędzia</a>');
break;
}
}) (this.jQuery, this.mediaWiki);
;(function($, mw) {
var username = mw.config.get("wgPageName").split("/")[1];
$('#contribs-tools').click(function() {
$.showCustomModal('Narzędzia — ' + username, '<div class="input-group"><label>Powód:</label><input id="reason" type="text" maxlength="150" value="[[c:help:vandalism]]"> <span id="banReasonV" class="button">V</span> <span id="banReasonS" class="button">S</span> <span id="banReasonP" class="button">P</span> <span id="banReasonOB" class="button">OB</span></div><br/><div class="input-group"><label>Czas blokady:</label><input id="time" type="text" maxlength="150" value="2 weeks"> <span id="banTime12h" class="button">12h</span> <span id="banTime2w" class="button">2w</span> <span id="banTime3m" class="button">3m</span> <span id="banTimeInf" class="button">inf</span></div>', {
id: 'tools',
width: 600,
buttons: [{
message: 'Cofnij wszystko',
id: 'RollbackAllButton',
defaultButton: true,
handler: function() {
alert("test ~");
}
}]
});
var ReasonBan = document.getElementById("reason");
var TimeBan = document.getElementById("time");
document.getElementById("banReasonV").onclick = function() {
ReasonBan.value = '[[c:help:vandalism|Vandalism]]';
}
document.getElementById("banReasonS").onclick = function() {
ReasonBan.value = '[[c:help:spam|Spam]]';
}
document.getElementById("banReasonP").onclick = function() {
ReasonBan.value = '[[w:c:nonsensopedia:Nonsensopedia:Prywata|Prywata]]';
}
document.getElementById("banReasonOB").onclick = function() {
ReasonBan.value = 'Omijanie bana';
TimeBan.value = 'infinite';
}
document.getElementById("banTime12h").onclick = function() {
TimeBan.value = '12 hours';
}
document.getElementById("banTime2w").onclick = function() {
TimeBan.value = '2 weeks';
}
document.getElementById("banTime3m").onclick = function() {
TimeBan.value = '3 months';
}
document.getElementById("banTimeInf").onclick = function(){
TimeBan.value = 'infinite';
}
});
}) (this.jQuery, this.mediaWiki);