mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
Base+Ladybird: Move Ladybird-related HTML files to their own folder
Pages like the new tab page, error page, etc. all belong solely to Ladybird, but are scattered across a couple of subfolders in Base. This moves them all to Base/res/ladybird.
This commit is contained in:
parent
980e32b4fe
commit
05c8d5ba57
Notes:
sideshowbarker
2024-07-18 05:37:06 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/05c8d5ba57 Pull-request: https://github.com/SerenityOS/serenity/pull/22165 Reviewed-by: https://github.com/ADKaster ✅
@ -40,7 +40,7 @@
|
|||||||
<body>
|
<body>
|
||||||
<main>
|
<main>
|
||||||
<br>
|
<br>
|
||||||
<img src="../../icons/32x32/app-browser.png" width="64" height="64"><br><br>
|
<img src="../icons/32x32/app-browser.png" width="64" height="64"><br><br>
|
||||||
<form>
|
<form>
|
||||||
<input type="search" name="q" id="user_query"><br><br>
|
<input type="search" name="q" id="user_query"><br><br>
|
||||||
<div id="search-buttons">
|
<div id="search-buttons">
|
@ -73,8 +73,8 @@ ErrorOr<int> service_main(int ipc_socket, int fd_passing_socket)
|
|||||||
Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode));
|
Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode));
|
||||||
|
|
||||||
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
||||||
Web::set_error_page_url(TRY(String::formatted("file://{}/res/html/error.html", s_serenity_resource_root)));
|
Web::set_error_page_url(TRY(String::formatted("file://{}/res/ladybird/error.html", s_serenity_resource_root)));
|
||||||
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/html/directory.html", s_serenity_resource_root)));
|
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/ladybird/directory.html", s_serenity_resource_root)));
|
||||||
|
|
||||||
TRY(Web::Bindings::initialize_main_thread_vm());
|
TRY(Web::Bindings::initialize_main_thread_vm());
|
||||||
|
|
||||||
|
@ -107,8 +107,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||||||
Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode));
|
Web::Platform::FontPlugin::install(*new Ladybird::FontPlugin(is_layout_test_mode));
|
||||||
|
|
||||||
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
||||||
Web::set_error_page_url(TRY(String::formatted("file://{}/res/html/error.html", s_serenity_resource_root)));
|
Web::set_error_page_url(TRY(String::formatted("file://{}/res/ladybird/error.html", s_serenity_resource_root)));
|
||||||
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/html/directory.html", s_serenity_resource_root)));
|
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/ladybird/directory.html", s_serenity_resource_root)));
|
||||||
|
|
||||||
TRY(Web::Bindings::initialize_main_thread_vm());
|
TRY(Web::Bindings::initialize_main_thread_vm());
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||||||
VERIFY(fd_passing_socket >= 0);
|
VERIFY(fd_passing_socket >= 0);
|
||||||
|
|
||||||
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
Web::set_resource_directory_url(TRY(String::formatted("file://{}/res", s_serenity_resource_root)));
|
||||||
Web::set_error_page_url(TRY(String::formatted("file://{}/res/html/error.html", s_serenity_resource_root)));
|
Web::set_error_page_url(TRY(String::formatted("file://{}/res/ladybird/error.html", s_serenity_resource_root)));
|
||||||
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/html/directory.html", s_serenity_resource_root)));
|
Web::set_directory_page_url(TRY(String::formatted("file://{}/res/ladybird/directory.html", s_serenity_resource_root)));
|
||||||
|
|
||||||
TRY(Web::Bindings::initialize_main_thread_vm());
|
TRY(Web::Bindings::initialize_main_thread_vm());
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ inline String const& default_new_tab_url()
|
|||||||
{
|
{
|
||||||
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
|
// FIXME: Teach LibWeb how to load resource:// URLs, rather than converting to a file:// URL here.
|
||||||
static auto default_new_tab_url = []() {
|
static auto default_new_tab_url = []() {
|
||||||
static constexpr auto url = "resource://html/misc/new-tab.html"sv;
|
static constexpr auto url = "resource://ladybird/new-tab.html"sv;
|
||||||
return MUST(Core::Resource::load_from_uri(url))->file_url();
|
return MUST(Core::Resource::load_from_uri(url))->file_url();
|
||||||
}();
|
}();
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void set_resource_directory_url(String resource_directory_url)
|
|||||||
s_resource_directory_url = resource_directory_url;
|
s_resource_directory_url = resource_directory_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String s_error_page_url = "file:///res/html/error.html"_string;
|
static String s_error_page_url = "file:///res/ladybird/error.html"_string;
|
||||||
|
|
||||||
String error_page_url()
|
String error_page_url()
|
||||||
{
|
{
|
||||||
@ -38,7 +38,7 @@ void set_error_page_url(String error_page_url)
|
|||||||
s_error_page_url = error_page_url;
|
s_error_page_url = error_page_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
static String s_directory_page_url = "file:///res/html/directory.html"_string;
|
static String s_directory_page_url = "file:///res/ladybird/directory.html"_string;
|
||||||
|
|
||||||
String directory_page_url()
|
String directory_page_url()
|
||||||
{
|
{
|
||||||
|
@ -201,8 +201,8 @@ void InspectorClient::load_inspector()
|
|||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
|
|
||||||
// FIXME: Teach LibWeb how to load resource:// URIs instead of needing to read these files here.
|
// FIXME: Teach LibWeb how to load resource:// URIs instead of needing to read these files here.
|
||||||
auto inspector_css = MUST(Core::Resource::load_from_uri("resource://html/inspector/inspector.css"sv));
|
auto inspector_css = MUST(Core::Resource::load_from_uri("resource://ladybird/inspector.css"sv));
|
||||||
auto inspector_js = MUST(Core::Resource::load_from_uri("resource://html/inspector/inspector.js"sv));
|
auto inspector_js = MUST(Core::Resource::load_from_uri("resource://ladybird/inspector.js"sv));
|
||||||
|
|
||||||
builder.append(R"~~~(
|
builder.append(R"~~~(
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
|
Loading…
Reference in New Issue
Block a user