MediaWiki:Common.js: Difference between revisions
Summary uses personal details and Life only |
Main Page find-a-soldier search form |
||
| Line 4: | Line 4: | ||
* Put the research-notes disclaimer under that section heading. | * Put the research-notes disclaimer under that section heading. | ||
* Split mashed CSV notes into separate bullets, then link MII/IPW team codes. | * Split mashed CSV notes into separate bullets, then link MII/IPW team codes. | ||
* Build the Main Page find-a-soldier search form (raw HTML forms are stripped from wikitext). | |||
*/ | */ | ||
$(function () { | $(function () { | ||
(function buildHomeFind() { | |||
var $slot = $('.mw-parser-output .home-find-slot').first(); | |||
if (!$slot.length || $slot.data('rbHomeFind')) { | |||
return; | |||
} | |||
$slot.data('rbHomeFind', 1); | |||
var script = $slot.attr('data-search-script') || mw.util.wikiScript(); | |||
$slot.find('.home-find-fallback').remove(); | |||
var $form = $('<form class="home-find-form" method="get"></form>').attr('action', script); | |||
$form.append($('<input type="hidden" name="title" value="Special:Search" />')); | |||
$form.append($('<label class="home-find-label" for="home-search"></label>').text('Name or ASN')); | |||
var $row = $('<div class="home-find-row"></div>'); | |||
$row.append( | |||
$('<input type="search" name="search" id="home-search" class="home-find-input" autocomplete="off" />') | |||
.attr('placeholder', 'e.g. Kugelmann or 32906164') | |||
); | |||
$row.append($('<button type="submit" class="home-find-button"></button>').text('Search')); | |||
$form.append($row); | |||
$slot.find('.home-find-title').after($form); | |||
}()); | |||
var NAME_PARTICLES = { | var NAME_PARTICLES = { | ||
von: 1, van: 1, de: 1, der: 1, den: 1, da: 1, di: 1, du: 1, | von: 1, van: 1, de: 1, der: 1, den: 1, da: 1, di: 1, du: 1, | ||