Skip to content

Commit

Permalink
Replace hinttextbox with prototype...
Browse files Browse the repository at this point in the history
  • Loading branch information
reedy committed Jul 10, 2023
1 parent f7c76b0 commit 7173aec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
20 changes: 10 additions & 10 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

<div id="quicksearch" style="display: none">
<img src="/img/layer-switcher-minimize.png" height=18 width=18 title="<?php echo _("Hide search bar") ?>" onClick="$('quicksearch').style.display='none'">
<input type="text" name="qs" id="qs" size="60" tabindex="5" onKeyDown='keyPress(event, "qs")' class="hintTextbox" value="<?php echo _("Enter city, airport, airline name or code") ?>"/>
<input type="text" name="qs" id="qs" size="60" tabindex="5" onKeyDown='keyPress(event, "qs")' class="hintTextbox" placeholder="<?php echo _("Enter city, airport, airline name or code") ?>"/>
<input type="hidden" name="qsid" id="qsid"/>
<input type="button" id="qsgo" tabindex="6" value="<?php echo _("Search") ?>" title="<?php echo _("Map of routes from this airport") ?>" align="middle" onclick='JavaScript:goQuickSearch()' DISABLED>
</div>
Expand Down Expand Up @@ -199,7 +199,7 @@
<td colspan=2>
<input type="text" name="src_date" id="src_date" size="11" class="date" tabindex="11" onChange="JavaScript:calcDuration('DEPARTURE');"/> <img src="/img/scw.gif" height="15" width="16" onclick="scwShow(scwID('src_date'),event); calcDuration('DEPARTURE');" />
<input type="text" name="src_time" id="src_time" tabindex="12" size="5" class="hintTextboxMini" value="HH:MM" onChange="JavaScript:calcDuration('DEPARTURE')"/> &rarr;
<input type="text" name="dst_time" id="dst_time" size="5" class="hintTextboxMini" value="HH:MM" onChange="JavaScript:calcDuration('ARRIVAL')"/>
<input type="text" name="dst_time" id="dst_time" size="5" class="hintTextboxMini" placeholder="HH:MM" onChange="JavaScript:calcDuration('ARRIVAL')"/>
<input type="text" name="dst_days" id="dst_days" size="6" value="" style="border: 0px; display: none" onChange="JavaScript:markAsChanged()"/><img src="/img/icon_clock.png" id="icon_clock" title="<?php echo _("Departure and arrival time") ?>" height="16" width="16" onclick='JavaScript:help("time")'/>
</td>

Expand All @@ -216,7 +216,7 @@
<font color="blue"><?php echo _("From") ?></font><a href="#help" onclick='JavaScript:help("airport")'><img src="/img/icon_help.png" title="Help: How do I enter airports?" height=11 width=10></a>
</td>
<td>
<input type="text" name="src_ap" id="src_ap" size="60" tabindex="14" onKeyDown='keyPress(event, "src_ap")' class="hintTextbox" value="<?php echo _("Enter city name or airport code") ?>"/>
<input type="text" name="src_ap" id="src_ap" size="60" tabindex="14" onKeyDown='keyPress(event, "src_ap")' class="hintTextbox" placeholder="<?php echo _("Enter city name or airport code") ?>"/>
<input type="hidden" name="src_apid" id="src_apid"/>
</td>
<td rowspan=2 valign=middle align=left>
Expand All @@ -226,7 +226,7 @@

<td><?php echo _("Plane") ?></td>
<td>
<input style="width: 180px" type="text" name="plane" id="plane" tabindex="111" onChange="JavaScript:markAsChanged();" onKeyDown='keyPress(event, "plane")' class="hintTextbox" value="<?php echo _("Enter plane model") ?>"><input type="hidden" id="planeid" name="planeid" />
<input style="width: 180px" type="text" name="plane" id="plane" tabindex="111" onChange="JavaScript:markAsChanged();" onKeyDown='keyPress(event, "plane")' class="hintTextbox" placeholder="<?php echo _("Enter plane model") ?>"><input type="hidden" id="planeid" name="planeid" />
<?php echo _("Reg.") ?> <input type="text" name="registration" size="8" tabindex="112" onChange="JavaScript:markAsChanged();"/>
</td>

Expand All @@ -236,7 +236,7 @@
<font color="blue"><?php echo _("To") ?></font><a href="#help" onclick='JavaScript:help("airport")'><img src="/img/icon_help.png" title="Help: How do I enter airports?" height=11 width=10></a>
</td>
<td>
<input type="text" name="dst_ap" id="dst_ap" size="60" tabindex="15" onKeyDown='keyPress(event, "dst_ap")' class="hintTextbox" value="<?php echo _("Enter city name or airport code") ?>"/>
<input type="text" name="dst_ap" id="dst_ap" size="60" tabindex="15" onKeyDown='keyPress(event, "dst_ap")' class="hintTextbox" placeholder="<?php echo _("Enter city name or airport code") ?>"/>
<input type="hidden" name="dst_apid" id="dst_apid"/>
</td>

Expand Down Expand Up @@ -282,7 +282,7 @@
<?php echo _("Carrier") ?><a href="#help" onclick='JavaScript:help("airline")'><img src="/img/icon_help.png" title="Help: How do I enter airlines?" height=11 width=10></a>
</td>
<td>
<input type="text" name="airline" id="airline" size="60" tabindex="20" onKeyDown='keyPress(event, "airline")' class="hintTextbox" value="<?php echo _("Enter airline name or code") ?>"/>
<input type="text" name="airline" id="airline" size="60" tabindex="20" onKeyDown='keyPress(event, "airline")' class="hintTextbox" placeholder="<?php echo _("Enter airline name or code") ?>"/>
<input type="hidden" name="airlineid" id="airlineid"/>
</td>
<td>
Expand All @@ -294,7 +294,7 @@
</tr><tr>
<td><?php echo _("Note") ?></td>
<td colspan=2>
<input type="text" name="note" id="note" size="60" tabindex="21" class="hintTextbox" value="" onChange="JavaScript:markAsChanged();">
<input type="text" name="note" id="note" size="60" tabindex="21" class="hintTextbox" placeholder="" onChange="JavaScript:markAsChanged();">
</td>
<td colspan=2 align=right>
<span id="addflightbuttons">
Expand Down Expand Up @@ -334,7 +334,7 @@
for ($row = 1; $row <= 4; $row++) {
echo "<tr id='row$row' " . ($row > 1 ? "style='display: none;'" : "") . "> <!-- Row $row -->\n";
printf(
"<td><input type='text' name='src_ap%s' id='src_ap%s' size='32' tabindex='1%s1' onKeyDown='keyPress(event, \"src_ap%s\")' class='hintTextbox' value=\"%s\"/>\n",
"<td><input type='text' name='src_ap%s' id='src_ap%s' size='32' tabindex='1%s1' onKeyDown='keyPress(event, \"src_ap%s\")' class='hintTextbox' placeholder=\"%s\"/>\n",
$row,
$row,
$row,
Expand All @@ -351,7 +351,7 @@
_("Airport search")
);
printf(
"<td><input type='text' name='dst_ap%s' id='dst_ap%s' size='32' tabindex='1%s2' onKeyDown='keyPress(event, \"dst_ap%s\")' class='hintTextbox' value=\"%s\"/>\n",
"<td><input type='text' name='dst_ap%s' id='dst_ap%s' size='32' tabindex='1%s2' onKeyDown='keyPress(event, \"dst_ap%s\")' class='hintTextbox' placeholder=\"%s\"/>\n",
$row,
$row,
$row,
Expand All @@ -369,7 +369,7 @@
_("Airport search")
);
printf(
"<td><input type='text' name='airline%s' id='airline%s' size='32' tabindex='1%s3' onKeyDown='keyPress(event, \"airline%s\")' class='hintTextbox' value=\"%s\"/>\n",
"<td><input type='text' name='airline%s' id='airline%s' size='32' tabindex='1%s3' onKeyDown='keyPress(event, \"airline%s\")' class='hintTextbox' placeholder=\"%s\"/>\n",
$row,
$row,
$row,
Expand Down
3 changes: 0 additions & 3 deletions openflights.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,6 @@ function init() {
query = arguments[1];
}

initHintTextboxes();

prepareAutocomplete("qs", {
successCb: getQuickSearchId,
failureCb: (e) => undefined,
Expand Down Expand Up @@ -4020,7 +4018,6 @@ function todayString() {

// Clear out (restore to defaults) the input box
function clearInput() {
resetHintTextboxes();
if (getCurrentPane() == "input") {
var form = document.forms["inputform"];
form.src_date.value = todayString();
Expand Down

0 comments on commit 7173aec

Please sign in to comment.