MediaWiki:Common.js: Difference between revisions

Jump to navigation Jump to search
m
Use DateInput
No edit summary
m (Use DateInput)
Line 2: Line 2:


$(function() {
$(function() {
$('#ir-roman-date-converter').html('<div class=\"mw-inputbox-centered\"> \
let dateInput = new mw.widgets.DateInputWidget({id: 'date'});
        <input id=\'date\' type=\"date\" class=\"mw-ui-input mw-ui-input-inline mw-inputbox-createbox webfonts-changed\" placeholder=\"\" required=\"\" size=\"50\" dir=\"ltr\"> \
$('#ir-roman-date-converter').append(dateInput.$element);
$('#ir-roman-date-converter').append('<div class=\"mw-inputbox-centered\"> \
         <input type=\"submit\" onclick=\"submit()\" class=\"mw-ui-button mw-ui-progressive webfonts-changed\" value=\"Convert Date\"> \
         <input type=\"submit\" onclick=\"submit()\" class=\"mw-ui-button mw-ui-progressive webfonts-changed\" value=\"Convert Date\"> \
         <div id=\"result\"></div> \
         <div id=\"result\"></div> \
Line 10: Line 11:
                 const resultDiv = document.getElementById(\"result\"); \
                 const resultDiv = document.getElementById(\"result\"); \
                 const api = new mw.Api(); \
                 const api = new mw.Api(); \
                 let date = document.getElementById(\"date\").value; \
                 let date = $(#date).getValue(); \
                 api.get({ \
                 api.get({ \
                     action: \'expandtemplates\', \
                     action: \'expandtemplates\', \

Navigation menu