mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibWeb: Implement JS confirm()
This commit is contained in:
parent
0a483cf677
commit
1f6578ee0a
Notes:
sideshowbarker
2024-07-19 07:32:14 +09:00
Author: https://github.com/nicktiberi
Commit: 1f6578ee0a
Pull-request: https://github.com/SerenityOS/serenity/pull/1824
4 changed files with 20 additions and 0 deletions
|
@ -52,6 +52,12 @@ void Window::alert(const String& message)
|
|||
GUI::MessageBox::show(message, "Alert", GUI::MessageBox::Type::Information);
|
||||
}
|
||||
|
||||
bool Window::confirm(const String& message)
|
||||
{
|
||||
auto confirm_result = GUI::MessageBox::show(message, "Confirm", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
|
||||
return confirm_result == GUI::Dialog::ExecResult::ExecOK;
|
||||
}
|
||||
|
||||
void Window::set_interval(JS::Function& callback, i32 interval)
|
||||
{
|
||||
// FIXME: This leaks the interval timer and makes it unstoppable.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue