MediaWiki:Common.js: Difference between revisions
Created page with "→Any JavaScript here will be loaded for all users on every page load.: window.wpDarkModeAutoToggle = true;"  |
No edit summary |
||
| Line 2: | Line 2: | ||
window.wpDarkModeAutoToggle = true; | window.wpDarkModeAutoToggle = true; | ||
/* --- Inject Hero Search Bar on Main Page --- */ | |||
$(function() { | |||
  // Only run this if the placeholder exists | |||
  if ($('#bc-hero-search').length) { | |||
    var searchHTML = | |||
      '<form action="/index.php" id="searchform">' + | |||
      '<input type="hidden" name="title" value="Special:Search">' + | |||
      '<div style="position: relative; max-width: 500px; margin: 0 auto;">' + | |||
      '<input name="search" type="search" placeholder="Search for In-Bond, ACE Manifest..." style="width: 100%; padding: 15px 20px; border-radius: 30px; border: none; font-size: 16px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); outline: none;">' + | |||
      '<button type="submit" name="go" value="Go" style="position: absolute; right: 5px; top: 5px; bottom: 5px; background: #004a80; color: white; border: none; border-radius: 25px; padding: 0 20px; font-weight: bold; cursor: pointer;">Search</button>' + | |||
      '</div>' + | |||
      '</form>'; | |||
      | |||
    $('#bc-hero-search').html(searchHTML); | |||
  } | |||
}); | |||