! * \brief Injects the JavaScript code required for additional features. * \remarks Called when the page has been loaded. */
| 462 | * \remarks Called when the page has been loaded. |
| 463 | */ |
| 464 | void WebPage::injectJavaScripts(bool ok) |
| 465 | { |
| 466 | Q_UNUSED(ok) |
| 467 | // show folder path selection when double-clicking input |
| 468 | if (!Settings::values().enableWipFeatures) { |
| 469 | return; |
| 470 | } |
| 471 | injectJavaScript(QStringLiteral("var button = jQuery('<button type=\"button\" class=\"btn btn-sm\" " |
| 472 | "style=\"float: right;\">Select directory …</button>');" |
| 473 | "button.click(function(event) {" |
| 474 | " if (!document.getElementById('folderPath').getAttribute('readonly')) {" |
| 475 | " console.log('nativeInterface.showFolderPathSelection: ' + event.target.value);" |
| 476 | " }" |
| 477 | "});" |
| 478 | "var help = jQuery('#folderPath + * + .help-block');" |
| 479 | "help.prepend(button);")); |
| 480 | } |
| 481 | |
| 482 | /*! |
| 483 | * \brief Invokes native methods requested via JavaScript log. |
nothing calls this directly
no outgoing calls
no test coverage detected