mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Implement Window.prompt()
This commit is contained in:
parent
f10967e364
commit
5e07c27e25
Notes:
sideshowbarker
2024-07-18 22:07:15 +09:00
Author: https://github.com/linusg
Commit: 5e07c27e25
Pull-request: https://github.com/SerenityOS/serenity/pull/5423
Reviewed-by: https://github.com/awesomekling
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