Użytkownik:Michał56/common.js: Różnice pomiędzy wersjami
Z Nonsensopedii, polskiej encyklopedii humoru
Znacznik: edytor źródłowy |
M Znacznik: edytor źródłowy |
||
Linia 4: | Linia 4: | ||
} |
} |
||
function open_modal() { |
function open_modal() { |
||
$('#p-cactions > .pBody > ul').append('<li id="ca-qrc"><a href="#" id="ca-qrc-link">Zobacz zmiany</a></li>'); |
$('#p-cactions > .pBody > ul').append('<li id="ca-qrc"><a href="#" id="ca-qrc-link">Zobacz zmiany</a></li>'); |
||
var time = new Date(); |
var time = new Date(); |
||
var modal_html = '<label for="year">Rok:</label> <input type="text" id="year" value="' + time.getFullYear() + '" |
var modal_html = '<label for="year">Rok:</label> <input type="text" id="year" value="' + time.getFullYear() + '" /><br/><label for="month"> <select id="month"><option>styczeń</option><option>luty</option><option>marzec</option><option>kwiecień</option><option>maj</option><option>czerwiec</option><option>lipiec</option><option>sierpień</option><option>wrzesień</option><option>październik</option><option>listopad</option><option>Grudzień</option></select></br><label for="day"><input type="text" id="day" placeholder="wpisz numer dnia, np. 1 albo 25" /><br/><span style="font-family: Arial">Pokaż:<br/><form id="show_last"><input type="radio" id="sc-50" /><label for="sc-50">50</label></br><input type="radio" id="sc-100" /><label for="sc-100">100</label></br><input type="radio" id="sc-250" /><label for="sc-250">250</label></br><input type="radio" id="sc-500" /><label for="sc-500">500</label></form>'; |
||
$('#ca-qrc-link').click(function() { |
$('#ca-qrc-link').click(function() { |
||
$.showCustomModal('Wybierz datę', modal_html, { |
$.showCustomModal('Wybierz datę', modal_html, { |
||
id: 'qrc-modal', |
id: 'qrc-modal', |
||
width: 600, |
width: 600, |
||
buttons: [{ |
buttons: [{ |
||
message: 'done', |
|||
id: 'qrc-modal-button-done', |
|||
defaultButton: true, |
defaultButton: true, |
||
handler: function() { |
|||
alert('waifu'); |
|||
} |
|||
}] |
}] |
||
}); |
}); |
||
}); |
}); |
||
} |
} |
||
}) (this.jQuery, this.mediaWiki); |
}) (this.jQuery, this.mediaWiki); |
Wersja z 22:00, 28 lut 2016
;(function($, mw) {
if (mw.config.get('wgCanonicalSpecialPageName') == 'Recentchanges') {
open_modal()
}
function open_modal() {
$('#p-cactions > .pBody > ul').append('<li id="ca-qrc"><a href="#" id="ca-qrc-link">Zobacz zmiany</a></li>');
var time = new Date();
var modal_html = '<label for="year">Rok:</label> <input type="text" id="year" value="' + time.getFullYear() + '" /><br/><label for="month"> <select id="month"><option>styczeń</option><option>luty</option><option>marzec</option><option>kwiecień</option><option>maj</option><option>czerwiec</option><option>lipiec</option><option>sierpień</option><option>wrzesień</option><option>październik</option><option>listopad</option><option>Grudzień</option></select></br><label for="day"><input type="text" id="day" placeholder="wpisz numer dnia, np. 1 albo 25" /><br/><span style="font-family: Arial">Pokaż:<br/><form id="show_last"><input type="radio" id="sc-50" /><label for="sc-50">50</label></br><input type="radio" id="sc-100" /><label for="sc-100">100</label></br><input type="radio" id="sc-250" /><label for="sc-250">250</label></br><input type="radio" id="sc-500" /><label for="sc-500">500</label></form>';
$('#ca-qrc-link').click(function() {
$.showCustomModal('Wybierz datę', modal_html, {
id: 'qrc-modal',
width: 600,
buttons: [{
message: 'done',
id: 'qrc-modal-button-done',
defaultButton: true,
handler: function() {
alert('waifu');
}
}]
});
});
}
}) (this.jQuery, this.mediaWiki);
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": ""
};
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "https://commons.wikimedia.org/wiki/Category:MediaWiki_edit_toolbar_formatting_buttons#/media/File:Pulsante_tmp.png",
"speedTip": "Wstaw podpis",
"tagOpen": "{{Michał56}} <nowiki>{{subst:#time:H:i, M d, Y|+1 hour}} (CET)</nowiki>",
"tagClose": "",
"sampleText": ""
};
}
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',
// ...
]
} );