mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-03-14 20:21:14 +03:00
[BridgeCard] add example value to info hint and allow using it by right click (#3726)
This commit is contained in:
parent
64582a64f1
commit
59dd49671d
2 changed files with 17 additions and 2 deletions
|
@ -177,9 +177,18 @@ This bridge is not fetching its content through a secure connection</div>';
|
|||
$form .= self::getCheckboxInput($inputEntry, $idArg, $id);
|
||||
}
|
||||
|
||||
$infoText = [];
|
||||
$infoTextScript = '';
|
||||
if (isset($inputEntry['title'])) {
|
||||
$title_filtered = filter_var($inputEntry['title'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
$form .= '<i class="info" title="' . $title_filtered . '">i</i>';
|
||||
$infoText[] = filter_var($inputEntry['title'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
}
|
||||
if ($inputEntry['exampleValue'] !== '') {
|
||||
$infoText[] = "Example (right click to use):\n" . filter_var($inputEntry['exampleValue'], FILTER_SANITIZE_FULL_SPECIAL_CHARS);
|
||||
$infoTextScript = 'rssbridge_use_placeholder_value(this);';
|
||||
}
|
||||
|
||||
if (count($infoText) > 0) {
|
||||
$form .= '<i class="info" data-for="' . $idArg . '" title="' . implode("\n\n", $infoText) . '" oncontextmenu="' . $infoTextScript . 'return false">i</i>';
|
||||
} else {
|
||||
$form .= '<i class="no-info"></i>';
|
||||
}
|
||||
|
|
|
@ -48,6 +48,12 @@ function rssbridge_toggle_bridge(){
|
|||
}
|
||||
}
|
||||
|
||||
function rssbridge_use_placeholder_value(sender) {
|
||||
let inputId = sender.getAttribute('data-for');
|
||||
let inputElement = document.getElementById(inputId);
|
||||
inputElement.value = inputElement.getAttribute("placeholder");
|
||||
}
|
||||
|
||||
var rssbridge_feed_finder = (function() {
|
||||
/*
|
||||
* Code for "Find feed by URL" feature
|
||||
|
|
Loading…
Add table
Reference in a new issue