Clean up usage of pseudo-uris in special pages

This commit is contained in:
Paweł Forysiuk 2011-08-09 19:48:50 +02:00 committed by Christian Dywan
parent 32f71ef5e0
commit c5151ff09a
3 changed files with 9 additions and 26 deletions

View file

@ -62,15 +62,15 @@ description {
</head> </head>
<body> <body>
<div id="container"> <div id="container">
<img id="logo" src="{res}/logo-shade.png" /> <img id="logo" src="res://logo-shade.png" />
<img id="icon" src="{stock}/gtk-dialog-error" /> <img id="icon" src="stock://gtk-dialog-error" />
<div id="main"> <div id="main">
<h1>{title}</h1> <h1>{title}</h1>
<p id="message">{message}</p> <p id="message">{message}</p>
<p id="description">{description}</p> <p id="description">{description}</p>
<form method="GET" action="{uri}"> <form method="GET" action="{uri}">
<button type="submit" onclick="location.reload(); return false;"> <button type="submit" onclick="location.reload(); return false;">
<img src="{stock}/gtk-refresh"/> <img src="stock://gtk-refresh"/>
<span>{tryagain}</span> <span>{tryagain}</span>
</button> </button>
</form> </form>

View file

@ -8,7 +8,7 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title>{title}</title> <title>{title}</title>
<script type="text/javascript" src="{res}/mootools.js"></script> <script type="text/javascript" src="res://mootools.js"></script>
<style> <style>
html, body, #content { html, body, #content {
@ -117,7 +117,7 @@
width: 16px; width: 16px;
margin-bottom: -17px; margin-bottom: -17px;
margin-top: 2px; margin-top: 2px;
background: url({stock}/1/gtk-close) 98% 70% no-repeat; background: url(stock://1/gtk-close) 98% 70% no-repeat;
cursor: pointer; cursor: pointer;
z-index: -4; z-index: -4;
opacity: 0.6; opacity: 0.6;
@ -129,7 +129,7 @@
.activated p { .activated p {
cursor: text; cursor: text;
background: url({stock}/1/gtk-edit) 98% 70% no-repeat; background: url(stock://1/gtk-edit) 98% 70% no-repeat;
opacity: 0.6; opacity: 0.6;
color: rgba(0,0,0,1); color: rgba(0,0,0,1);
} }

View file

@ -1418,22 +1418,15 @@ midori_view_display_error (MidoriView* view,
g_free (template_file); g_free (template_file);
if (g_file_get_contents (path, &template, NULL, NULL)) if (g_file_get_contents (path, &template, NULL, NULL))
{ {
gchar* res_root;
gchar* stock_root;
gchar* title_escaped; gchar* title_escaped;
gchar* result; gchar* result;
res_root = g_strdup ("res:/");
stock_root = g_strdup ("stock:/");
title_escaped = g_markup_escape_text (title, -1); title_escaped = g_markup_escape_text (title, -1);
result = sokoke_replace_variables (template, result = sokoke_replace_variables (template,
"{title}", title_escaped, "{title}", title_escaped,
"{message}", message, "{message}", message,
"{description}", description, "{description}", description,
"{tryagain}", try_again, "{tryagain}", try_again,
"{res}", res_root,
"{stock}", stock_root,
"{uri}", uri, "{uri}", uri,
NULL); NULL);
g_free (title_escaped); g_free (title_escaped);
@ -1442,8 +1435,6 @@ midori_view_display_error (MidoriView* view,
midori_view_load_alternate_string (view, midori_view_load_alternate_string (view,
result, uri, web_frame); result, uri, web_frame);
g_free (res_root);
g_free (stock_root);
g_free (result); g_free (result);
g_free (path); g_free (path);
@ -3683,8 +3674,6 @@ prepare_speed_dial_html (MidoriView* view)
&& g_file_get_contents (file_path, &speed_dial_head, NULL, NULL)) && g_file_get_contents (file_path, &speed_dial_head, NULL, NULL))
{ {
gchar* header = sokoke_replace_variables (speed_dial_head, gchar* header = sokoke_replace_variables (speed_dial_head,
"{res}", "res:/",
"{stock}", "stock:/",
"{title}", _("Speed Dial"), "{title}", _("Speed Dial"),
"{click_to_add}", _("Click to add a shortcut"), "{click_to_add}", _("Click to add a shortcut"),
"{enter_shortcut_address}", _("Enter shortcut address"), "{enter_shortcut_address}", _("Enter shortcut address"),
@ -3883,18 +3872,13 @@ midori_view_set_uri (MidoriView* view,
if (!strncmp (uri, "error:nodocs ", 13)) if (!strncmp (uri, "error:nodocs ", 13))
{ {
gchar* title; gchar* title;
gchar* logo_path;
gchar* logo_uri;
katze_assign (view->uri, g_strdup (&uri[13])); katze_assign (view->uri, g_strdup (&uri[13]));
title = g_strdup_printf (_("No documentation installed")); title = g_strdup_printf (_("No documentation installed"));
logo_path = sokoke_find_data_filename ("midori/res/logo-shade.png");
logo_uri = g_filename_to_uri (logo_path, NULL, NULL);
g_free (logo_path);
data = g_strdup_printf ( data = g_strdup_printf (
"<html><head><title>%s</title></head>" "<html><head><title>%s</title></head>"
"<body><h1>%s</h1>" "<body><h1>%s</h1>"
"<img src=\"%s\" " "<img src=\"res://logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">" "style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
"<p />There is no documentation installed at %s. " "<p />There is no documentation installed at %s. "
"You may want to ask your distribution or " "You may want to ask your distribution or "
@ -3902,9 +3886,8 @@ midori_view_set_uri (MidoriView* view,
"verify that the build is setup properly. " "verify that the build is setup properly. "
"<a href=\"http://wiki.xfce.org/midori/faq\">View the FAQ online</a>" "<a href=\"http://wiki.xfce.org/midori/faq\">View the FAQ online</a>"
"</body></html>", "</body></html>",
title, title, logo_uri, view->uri); title, title, view->uri);
g_free (title); g_free (title);
g_free (logo_uri);
} }
else if (!strcmp (uri, "about:") || !strcmp (uri, "about:version")) else if (!strcmp (uri, "about:") || !strcmp (uri, "about:version"))
{ {
@ -3989,7 +3972,7 @@ midori_view_set_uri (MidoriView* view,
katze_assign (view->uri, g_strdup (uri)); katze_assign (view->uri, g_strdup (uri));
data = g_strdup_printf ( data = g_strdup_printf (
"<html><head><title>%s</title></head><body><h1>%s</h1>" "<html><head><title>%s</title></head><body><h1>%s</h1>"
"<img src=\"file://" MDATADIR "/midori/res/logo-shade.png\" " "<img src=\"res://logo-shade.png\" "
"style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">" "style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
"</body></html>", view->uri, view->uri); "</body></html>", view->uri, view->uri);
} }