view www/search.php @ 2834:f08e17b1e003 default tip

New pcity 'Zhuque' in Lucentium.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 11 Jun 2024 12:56:47 +0300
parents 03979a8e1f2e
children
line wrap: on
line source

<?php
require "config.inc.php";
require "world.inc.php";
require "common.inc.php";

mpPrintPageHeader($pageTitle,
  "  <script type=\"text/javascript\" src=\"search.js\"></script>\n".
  "  <link rel=\"stylesheet\" href=\"search.css\" type=\"text/css\" />\n",
  " onload=\"mapInitSearch()\""
);

?>
<h1>BatMUD map search</h1>
<div id="noscript" class="error">
This page requires JavaScript (and WebSockets support) to work.
</div>

<div id="locSearchBox">
  <h2>Location name search</h2>
  <input type="text" id="locPattern" autocomplete="off" maxlength="30" size="30" placeholder="location name or part of it">
  <button type="button" title="Show or hide help" onclick="mapToggleView('help1')">Help!</button>
</div>
<div id="help1" class="help">
  <h2>Help for location search by name</h2>
  <ul>
    <li>By default any text typed will be partial-matched to location name(s), including the alternative names known to Pupunen Maps database.
    </li>
    <li>You can use <b>*</b> wildcard token to match any character (0 or more), and <b>?</b> to match exactly one (any) character.
    For example 'for*t' would match 'fort', 'forest', etc. Note that * and ? will match any character, including space.</li>
    <li>You can also use <b>^</b> to anchor the match to name string start, e.g. <b>^ab</b> will match only location names that start with 'ab' (case-insensitive).
    Same goes for <b>$</b> to match string end. However, the matching style is otherwise "glob", not regular expression.</li>
  </ul>
</div>

<div id="mapSearchBox">
  <h2>Map search pattern</h2>
  <textarea id="mapPattern" cols="30" rows="15"></textarea>
  <div id="controls">
    <div id="mapList"></div>
    <button type="button" title="Show or hide help" onclick="mapToggleView('help2')">Help!</button>
    <span id="mapInfo"></span>
    <button id="btnMaps" type="button" title="Reset or clear the map selection to be searched. Just click it to see what happens.">C^</button>
    <button class="large" id="btnClear" type="button" title="Clear current search results and map search pattern. Does NOT reset the selected maps.">Clear search</button>
    <button class="large" id="btnMapSearch" type="button" title="Perform map search with the currently selected maps.">Search</button>
  </div>
</div>

<div id="resultsBox">
  <h2>Search results</h2>
  <div id="results"></div>
</div>

<div id="help2" class="help">
  <h2>Help for map pattern search</h2>
  <ol>
    <li>The following characters act as wildcards (they match any character):
      <b>*</b>, <b>@</b>, <b>X</b>, <b>?</b>, <b>%</b>, <b>C</b> and
      <b>whitespace</b>, thus searching <i>exact</i> matches for player cities
      (C), shrines (%) and location markers (?) is not possible.
    </li>
    <li><b>*</b>, <b>@</b> and <b>X</b> will be used to center the
      search coordinates if they are present in the pattern. If no such
      character is present, the coordinates listed in search results
      will be for the <i>top-left corner of the search pattern</i>.
    </li>
    <li>The search pattern must be "clean", e.g. output from
      'look' with ships/NPCs/etc or direct copy-paste with anything
      extranous other than the map data itself <b>will not work</b>.
      Output of 'map' command is good, also 'wizard eye' spell.
      For other sources you will have to be creative and careful with copy-pasting.
      <button id="btnExample" type="button" title="Show an example search.">Click for example search pattern(s)</button>
    </li>
    <li>Remember that only the selected maps will be searched for matches.
      If you get no results, perhaps you have unselected the one that has
      the spot?
    </li>
  </ol>
</div>

<?php
mpPrintPageFooter(TRUE);
?>