mirror of
https://github.com/RGBCube/serenity
synced 2025-07-08 06:27:35 +00:00
LibWeb: Implement Window.prompt()
This commit is contained in:
parent
f10967e364
commit
5e07c27e25
14 changed files with 74 additions and 2 deletions
|
@ -30,6 +30,7 @@
|
|||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Clipboard.h>
|
||||
#include <LibGUI/InputBox.h>
|
||||
#include <LibGUI/MessageBox.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/ScrollBar.h>
|
||||
|
@ -425,4 +426,12 @@ bool InProcessWebView::page_did_request_confirm(const String& message)
|
|||
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
|
||||
}
|
||||
|
||||
String InProcessWebView::page_did_request_prompt(const String& message, const String& default_)
|
||||
{
|
||||
String value { default_ };
|
||||
if (GUI::InputBox::show(window(), value, message, "Prompt") == GUI::InputBox::ExecOK)
|
||||
return value;
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue