aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-about-handler.c15
-rw-r--r--embed/ephy-web-view.c89
2 files changed, 12 insertions, 92 deletions
diff --git a/embed/ephy-about-handler.c b/embed/ephy-about-handler.c
index 9f4caf665..e9328a118 100644
--- a/embed/ephy-about-handler.c
+++ b/embed/ephy-about-handler.c
@@ -210,7 +210,7 @@ ephy_about_handler_handle_applications (GString *data_str)
_("Applications"),
_("List of installed web applications"));
- g_string_append (data_str, "<form><table>");
+ g_string_append (data_str, "<table>");
applications = ephy_web_application_get_application_list ();
for (p = applications; p; p = p->next) {
@@ -220,16 +220,21 @@ ephy_about_handler_handle_applications (GString *data_str)
if (g_file_get_contents (app->icon_url, &img_data, &data_length, NULL))
img_data_base64 = g_base64_encode ((guchar*)img_data, data_length);
- g_string_append_printf (data_str, "<tbody><tr><td class=\"icon\"><img width=64 height=64 src=\"data:image/png;base64,%s\">" \
- " </img></td><td class=\"data\"><div class=\"appname\">%s</div><div class=\"appurl\">%s</div></td><td class=\"input\"><input type=\"submit\" value=\"Delete\" id=\"%s\"></td><td class=\"date\">%s <br /> %s</td></tr>",
- img_data_base64, app->name, app->url, app->name,
+ g_string_append_printf (data_str,
+ "<form>" \
+ "<tbody><tr>" \
+ "<td class=\"icon\"><img width=64 height=64 src=\"data:image/png;base64,%s\"></img></td>" \
+ "<td class=\"data\"><div class=\"appname\">%s</div><div class=\"appurl\">%s</div></td>" \
+ "<td class=\"input\"><input type=\"hidden\" name=\"app_id\" value=\"%s\"><input type=\"submit\" value=\"Delete\" id=\"%s\">" \
+ "</td><td class=\"date\">%s <br /> %s</td></tr></tbody></form>",
+ img_data_base64, app->name, app->url, app->name, app->name,
/* Note for translators: this refers to the installation date. */
_("Installed on:"), app->install_date);
g_free (img_data_base64);
g_free (img_data);
}
- g_string_append (data_str, "</form></table></body>");
+ g_string_append (data_str, "</table></body>");
ephy_web_application_free_application_list (applications);
}
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 9b096ae09..c70d9d497 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2013,26 +2013,6 @@ geolocation_policy_decision_requested_cb (WebKitWebView *web_view,
return TRUE;
}
-#ifdef HAVE_WEBKIT2
-/* TODO: DOM Bindings */
-#else
-static gboolean
-delete_web_app_cb (WebKitDOMHTMLElement *button,
- WebKitDOMEvent *dom_event,
- EphyWebView *web_view)
-{
- char *id = NULL;
-
- id = webkit_dom_html_element_get_id (button);
- if (id)
- ephy_web_application_delete (id);
-
- g_free (id);
-
- return FALSE;
-}
-#endif
-
static void
get_host_for_url_cb (gpointer service,
gboolean success,
@@ -2220,9 +2200,7 @@ load_changed_cb (WebKitWebView *web_view,
break;
}
- case WEBKIT_LOAD_FINISHED: {
- SoupURI *uri;
-
+ case WEBKIT_LOAD_FINISHED:
g_free (priv->status_message);
priv->status_message = NULL;
g_object_notify (object, "status-message");
@@ -2241,37 +2219,6 @@ load_changed_cb (WebKitWebView *web_view,
_ephy_web_view_hook_into_links (view);
#endif
- /* FIXME: It sucks to do this here, but it's not really possible
- * to hook the DOM actions nicely in the about: generator. */
- uri = soup_uri_new (webkit_web_view_get_uri (web_view));
- if (uri &&
- !g_strcmp0 (uri->scheme, "ephy-about") &&
- !g_strcmp0 (uri->path, "applications")) {
-#if 0
- /* TODO: DOM bindings */
- WebKitDOMDocument *document;
- WebKitDOMNodeList *buttons;
- gulong buttons_n;
- int i;
-
- document = webkit_web_view_get_dom_document (web_view);
- buttons = webkit_dom_document_get_elements_by_tag_name (document, "input");
- buttons_n = webkit_dom_node_list_get_length (buttons);
-
- for (i = 0; i < buttons_n; i++) {
- WebKitDOMNode *button;
-
- button = webkit_dom_node_list_item (buttons, i);
- webkit_dom_event_target_add_event_listener (WEBKIT_DOM_EVENT_TARGET (button), "click",
- G_CALLBACK (delete_web_app_cb), false,
- NULL);
- }
-#endif
- }
-
- if (uri)
- soup_uri_free (uri);
-
/* Ensure we load the icon for this web view, if available. */
_ephy_web_view_update_icon (view);
@@ -2280,7 +2227,6 @@ load_changed_cb (WebKitWebView *web_view,
break;
}
- }
g_object_thaw_notify (object);
}
@@ -2378,9 +2324,7 @@ load_status_cb (WebKitWebView *web_view,
break;
}
- case WEBKIT_LOAD_FINISHED: {
- SoupURI *uri;
-
+ case WEBKIT_LOAD_FINISHED:
g_free (priv->status_message);
priv->status_message = NULL;
g_object_notify (object, "status-message");
@@ -2396,34 +2340,6 @@ load_status_cb (WebKitWebView *web_view,
_ephy_web_view_hook_into_links (view);
- /* FIXME: It sucks to do this here, but it's not really possible
- * to hook the DOM actions nicely in the about: generator. */
- uri = soup_uri_new (webkit_web_view_get_uri (web_view));
- if (uri &&
- !g_strcmp0 (uri->scheme, "ephy-about") &&
- !g_strcmp0 (uri->path, "applications")) {
- WebKitDOMDocument *document;
- WebKitDOMNodeList *buttons;
- gulong buttons_n;
- int i;
-
- document = webkit_web_view_get_dom_document (web_view);
- buttons = webkit_dom_document_get_elements_by_tag_name (document, "input");
- buttons_n = webkit_dom_node_list_get_length (buttons);
-
- for (i = 0; i < buttons_n; i++) {
- WebKitDOMNode *button;
-
- button = webkit_dom_node_list_item (buttons, i);
- webkit_dom_event_target_add_event_listener (WEBKIT_DOM_EVENT_TARGET (button), "click",
- G_CALLBACK (delete_web_app_cb), false,
- NULL);
- }
- }
-
- if (uri)
- soup_uri_free (uri);
-
/* Reset visit type. */
priv->visit_type = EPHY_PAGE_VISIT_NONE;
@@ -2435,7 +2351,6 @@ load_status_cb (WebKitWebView *web_view,
ephy_web_view_thaw_history (view);
break;
- }
case WEBKIT_LOAD_FAILED:
priv->load_failed = TRUE;
ephy_web_view_set_link_message (view, NULL);