--- /dev/null
+<!--
+ Error page template for Midori.
+ This file is licensed under the terms of the expat license, see the file EXPAT.
+-->
+
+<html>
+<head>
+<title>{title}</title>
+<style type="text/css">
+body {
+ background-color: #eee;
+ margin: 0;
+ padding: 0;
+}
+
+#container {
+ background: #f6fff3;
+ min-width: 70%;
+ max-width: 70%;
+ margin: 2em auto 1em;
+ padding: 1em;
+ border: 0.2em solid #9acb7f;
+ -webkit-border-radius: 1em;
+}
+
+h1 {
+ font-size: 1.4em;
+ font-weight: bold;
+}
+
+#logo {
+ position: absolute; right: 15px; bottom: 15px;
+ z-index: -1;
+}
+
+message {
+ font-size: 1.1em;
+}
+
+description {
+ font-size: 1em;
+}
+
+</style>
+</head>
+<body>
+
+<div id="container">
+
+<img id="logo" src="{res}/logo-shade.png" />
+
+<h1>{title}</h1>
+<div class="message">
+ <p>{message}</p>
+ <p>{description}</p>
+</div>
+
+<form onsubmit="location.reload()">
+<input type="submit" value="{tryagain}" />
+</form>
+
+</div>
+
+</body>
+</html>
g_object_notify (G_OBJECT (view), "progress");
}
+#if WEBKIT_CHECK_VERSION (1, 1, 6)
+static gboolean
+webkit_web_view_load_error_cb (WebKitWebView* web_view,
+ WebKitWebFrame* web_frame,
+ const gchar* uri,
+ GError* error,
+ MidoriView* view)
+{
+ const gchar* template_file = DATADIR "/midori/res/error.html";
+ gchar* template;
+
+ if (g_file_get_contents (template_file, &template, NULL, NULL))
+ {
+ SoupServer* res_server;
+ guint port;
+ gchar* res_root;
+ gchar* message;
+ gchar* result;
+
+ res_server = sokoke_get_res_server ();
+ port = soup_server_get_port (res_server);
+ res_root = g_strdup_printf ("http://localhost:%d/res", port);
+
+ message = g_strdup_printf (_("The page %s couldn't be loaded."), uri);
+ result = sokoke_replace_variables (template,
+ "{title}", _("Error"),
+ "{message}", message,
+ "{description}", error->message,
+ "{tryagain}", _("Try again"),
+ "{res}", res_root, NULL);
+ g_free (template);
+ g_free (message);
+
+ webkit_web_frame_load_alternate_string (web_frame,
+ result, res_root, uri);
+ g_free (res_root);
+ g_free (result);
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+#else
static void
webkit_web_frame_load_done_cb (WebKitWebFrame* web_frame,
gboolean success,
midori_view_update_load_status (view, MIDORI_LOAD_FINISHED);
}
+#endif
static void
webkit_web_view_load_finished_cb (WebKitWebView* web_view,
"signal::download-requested",
webkit_web_view_download_requested_cb, view,
#endif
+ #if WEBKIT_CHECK_VERSION (1, 1, 6)
+ "signal::load-error",
+ webkit_web_view_load_error_cb, view,
+ #endif
NULL);
+ #if !WEBKIT_CHECK_VERSION (1, 1, 6)
g_object_connect (web_frame,
"signal::load-done",
webkit_web_frame_load_done_cb, view,
NULL);
+ #endif
if (view->settings)
{
if (g_str_has_prefix (uri, "error:"))
{
data = NULL;
+ #if !WEBKIT_CHECK_VERSION (1, 1, 3)
if (!strncmp (uri, "error:nodisplay ", 16))
{
gchar* title;
title, title, view->uri, view->mime_type);
g_free (title);
}
- else if (!strncmp (uri, "error:nodocs ", 13))
+ #endif
+ if (!strncmp (uri, "error:nodocs ", 13))
{
gchar* title;
' -o ' + blddir + '/data/logo-shade.png ' + \
srcdir + '/data/logo-shade.svg'
if not Utils.exec_command (command):
- bld.install_files ('${DATADIR}/' + APPNAME, blddir + '/data/logo-shade.png')
+ bld.install_files ('${DATADIR}/' + APPNAME + '/res', blddir + '/data/logo-shade.png')
else:
Utils.pprint ('BLUE', "logo-shade could not be rasterized.")
+ bld.install_files ('${DATADIR}/' + APPNAME + '/res', 'data/error.html')
if Options.commands['check']:
bld.add_subdirs ('tests')