Revise/fixup tooltips

This commit is contained in:
billz 2024-10-25 01:19:19 -07:00
parent 6ee1b84489
commit bc1c7803e0
5 changed files with 5 additions and 17 deletions

View file

@ -863,17 +863,6 @@ function get_public_ip()
return $public_ip[0]; return $public_ip[0];
} }
/* Returns a standardized tooltip
*
* @return string $tooltip
*/
function getTooltip($msg, $id, $visible = true, $data_html = false)
{
($visible) ? $opt1 = 'visible' : $opt1 = 'invisible';
($data_html) ? $opt2 = 'data-html="true"' : $opt2 = 'data-html="false"';
echo '<i class="fas fa-question-circle text-muted ' .$opt1.'" id="' .$id. '" data-toggle="tooltip" ' .$opt2. ' data-placement="auto" title="' . _($msg). '"></i>';
}
// Load non default JS/ECMAScript in footer // Load non default JS/ECMAScript in footer
function loadFooterScripts($extraFooterScripts) function loadFooterScripts($extraFooterScripts)
{ {

View file

@ -81,7 +81,7 @@
<div class="form-check form-switch"> <div class="form-check form-switch">
<input class="form-check-input" id="nohook-wpa-supplicant" type="checkbox" name="NoHookWPASupplicant" value="1" aria-describedby="hook-wpa-supplicant-description"> <input class="form-check-input" id="nohook-wpa-supplicant" type="checkbox" name="NoHookWPASupplicant" value="1" aria-describedby="hook-wpa-supplicant-description">
<label class="form-check-label" for="nohook-wpa-supplicant"><?php echo _("Disable wpa_supplicant dhcp hook for this interface") ?></label> <label class="form-check-label" for="nohook-wpa-supplicant"><?php echo _("Disable wpa_supplicant dhcp hook for this interface") ?></label>
<?php getTooltip('If you manage wireless connections with wpa_supplicant itself, the hook may create unwanted connection events. This option disables the hook.', 'tipnohook'); ?> <i class="fas fa-question-circle text-muted" data-bs-toggle="tooltip" data-bs-placement="auto" title="<?php echo _("If you manage wireless connections with wpa_supplicant itself, the hook may create unwanted connection events. This option disables the hook."); ?>"></i>
</div> </div>
<p class="mb-0" id="hook-wpa-supplicant-description"> <p class="mb-0" id="hook-wpa-supplicant-description">
<small><?php echo _("This toggles the <code>nohook wpa_supplicant</code> option for this interface in the DHCPCD configuration.") ?></small> <small><?php echo _("This toggles the <code>nohook wpa_supplicant</code> option for this interface in the DHCPCD configuration.") ?></small>

View file

@ -56,7 +56,7 @@
<div class="row"> <div class="row">
<div class="mb-3 col-md-6"> <div class="mb-3 col-md-6">
<label for="cbxtxpower"><?php echo _("Transmit power (dBm)") ?></label> <label for="cbxtxpower"><?php echo _("Transmit power (dBm)") ?></label>
<?php getTooltip('dBm is a unit of level used to indicate that a power ratio is expressed in decibels (dB) with reference to one milliwatt (mW). 30 dBm is equal to 1000 mW, while 0 dBm equals 1.25 mW.', 'tiptxpower'); ?> <i class="fas fa-question-circle text-muted" data-bs-toggle="tooltip" data-bs-placement="auto" title="<?php echo _("dBm is a unit of level used to indicate that a power ratio is expressed in decibels (dB) with reference to one milliwatt (mW). 30 dBm is equal to 1000 mW, while 0 dBm equals 1.25 mW."); ?>"></i>
<?php SelectorOptions('txpower', $arrTxPower, $txpower, 'cbxtxpower'); ?> <?php SelectorOptions('txpower', $arrTxPower, $txpower, 'cbxtxpower'); ?>
<small id="txpower_help" class="text-muted"><?php echo _("Sets the <code>txpower</code> option for the AP interface and the configured country."); ?></small> <small id="txpower_help" class="text-muted"><?php echo _("Sets the <code>txpower</code> option for the AP interface and the configured country."); ?></small>
</div> </div>

View file

@ -18,9 +18,8 @@
<div class="row"> <div class="row">
<div class="mb-3 col-md-6"> <div class="mb-3 col-md-6">
<label for="cbxhwmode"><?php echo _("Wireless Mode") ;?></label> <label for="cbxhwmode"><?php echo _("Wireless Mode") ;?></label>
<?php getTooltip(null, 'tiphwmode', true); ?> <i class="fas fa-question-circle text-muted" data-bs-toggle="tooltip" data-bs-placement="auto" title="<?php echo _("The 802.11ac 5 GHz option is disabled until a compatible wireless regulatory domain is set."); ?>"></i>
<?php SelectorOptions('hw_mode', $arr80211Standard, $selectedHwMode, 'cbxhwmode', 'getChannel'); ?> <?php SelectorOptions('hw_mode', $arr80211Standard, $selectedHwMode, 'cbxhwmode', 'getChannel'); ?>
<div id="hwmode" data-tooltip="<?php echo _("The 802.11ac 5 GHz option is disabled until a compatible wireless regulatory domain is set."); ?>"></div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">

View file

@ -23,7 +23,7 @@
<label for="reset"> <label for="reset">
<?php echo sprintf(_("To reset RaspAP to its <a href=\"%s\" target=\"_blank\">initial configuration</a>, click or tap the button below."), "https://docs.raspap.com/defaults/"); ;?> <?php echo sprintf(_("To reset RaspAP to its <a href=\"%s\" target=\"_blank\">initial configuration</a>, click or tap the button below."), "https://docs.raspap.com/defaults/"); ;?>
</label> </label>
<?php getTooltip('Restores all access point (AP) service settings to their default values. This applies to hostapd, dhcpcd and dnsmasq.', 'tiphwmode', true); ?> <i class="fas fa-question-circle text-muted" data-bs-toggle="tooltip" data-bs-placement="auto" title="<?php echo _("Restores all access point (AP) service settings to their default values. This applies to hostapd, dhcpcd and dnsmasq."); ?>"></i>
<div class="small"> <div class="small">
<?php echo _("Custom files for optional components such as Ad Blocking, WireGuard or OpenVPN will remain on the system."); ?> <?php echo _("Custom files for optional components such as Ad Blocking, WireGuard or OpenVPN will remain on the system."); ?>
</div> </div>