User:SD0001/oldSearchHistory.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:SD0001/oldSearchHistory. This user script seems to have an accompanying .css page at User:SD0001/oldSearchHistory.css. |
// Revert to the non-OOUI version of page history search form, that appears
// at the top of page histories
if (mw.config.get('wgAction') === 'history') {
var oldFormHTML = `<form action="/w/index.php" method="get" id="mw-history-searchform">
<fieldset id="mw-history-search">
<legend>Search for revisions</legend>
<input type="hidden" value="` + mw.config.get('wgPageName') + `" name="title">
<input type="hidden" value="history" name="action">
<label for="year">From year (and earlier):</label>
<input id="year" maxlength="4" size="7" type="number" name="year">
<label for="month">From month (and earlier):</label>
<select name="month" id="month" class="mw-month-selector">
<option value="-1">all</option>
<option value="1">January</option>
<option value="2">February</option>
<option value="3">March</option>
<option value="4">April</option>
<option value="5">May</option>
<option value="6">June</option>
<option value="7">July</option>
<option value="8">August</option>
<option value="9">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select> <label for="tagfilter"><a href="/wiki/Special:Tags" title="Special:Tags">Tag</a> filter:</label> <input name="tagfilter" size="20" value="" class="mw-tagfilter-input mw-ui-input mw-ui-input-inline" id="tagfilter"> <input type="submit" value="Show">
</fieldset>
</form>`;
$('.action-history #mw-content-text > .mw-htmlform-ooui-wrapper:first-child')
.before(oldFormHTML)
.hide();
$('#year').val( mw.util.getParamValue('year') || (new Date().getFullYear()));
$('#month').val(mw.util.getParamValue('month') || '-1');
$('#tagfilter').val(mw.util.getParamValue('tagfilter') || '');
}