seed r366 - in trunk: examples tests
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r366 - in trunk: examples tests
- Date: Sat, 29 Nov 2008 05:54:02 +0000 (UTC)
Author: hortont
Date: Sat Nov 29 05:54:02 2008
New Revision: 366
URL: http://svn.gnome.org/viewvc/seed?rev=366&view=rev
Log:
Update mini browser to take advantage of WebKit upstream adding support
for new 'windows'... (we open them in new tabs) YAY!
Modified:
trunk/examples/mini-browser.js
trunk/tests/Makefile.am
Modified: trunk/examples/mini-browser.js
==============================================================================
--- trunk/examples/mini-browser.js (original)
+++ trunk/examples/mini-browser.js Sat Nov 29 05:54:02 2008
@@ -40,16 +40,16 @@
this.open(url_entry.text);
}
-// Being able to make new tabs is blocking on a GtkWebkit bug.
-// Yes this is why you've never been able to use open in new window in epiphany
-// webkit.
function new_tab(browser_view, browser_frame, new_frame)
{
- //new_frame = new WebKit.WebView();
- //Seed.print(browser_view);
- //Seed.print(browser_frame);
- //Seed.print(new_frame);
- new_frame = this.create_tab("");
+ new_frame = new WebKit.WebView();
+ new_frame.signal.web_view_ready.connect(new_tab_ready, this);
+ return new_frame;
+}
+
+function new_tab_ready(browser_view)
+{
+ this.create_tab_with_webview(0, browser_view);
return true;
}
@@ -89,10 +89,15 @@
function create_tab(loc)
{
+ var browser_view = new WebKit.WebView();
+ return create_tab_with_webview(loc, browser_view);
+}
+
+function create_tab_with_webview(loc, browser_view)
+{
var tab = new Gtk.VBox();
var browser_title = new Gtk.Label({label:"Untitled"});
- var browser_view = new WebKit.WebView();
var url_entry = new Gtk.Entry();
url_entry.signal.activate.connect(browse, browser_view);
@@ -100,8 +105,11 @@
browser_view.set_scroll_adjustments(null,null);
browser_view.signal.title_changed.connect(title_changed, browser_title);
browser_view.signal.load_committed.connect(url_changed, url_entry);
- //browser_view.signal.create_web_view.connect(new_tab, this);
- browser_view.open(loc);
+ browser_view.signal.create_web_view.connect(new_tab, this);
+ browser_view.signal.web_view_ready.connect(new_tab_ready, this);
+
+ if(loc != 0)
+ browser_view.open(loc);
var toolbar = create_toolbar(browser_view);
toolbar.pack_start(url_entry, true, true);
@@ -120,9 +128,11 @@
tab_header.pack_start(close_button);
tab_header.show_all();
- this.append_page(tab, tab_header);
- this.set_tab_reorderable(tab, true);
- this.show_all();
+ tabs.append_page(tab, tab_header);
+ tabs.set_tab_reorderable(tab, true);
+ tabs.show_all();
+
+ return tabs;
}
function create_ui()
@@ -131,6 +141,7 @@
tabs = new Gtk.Notebook();
tabs.create_tab = create_tab;
+ tabs.create_tab_with_webview = create_tab_with_webview;
tabs.create_tab("http://www.reddit.com/");
tabs.create_tab("http://www.google.com/");
Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am (original)
+++ trunk/tests/Makefile.am Sat Nov 29 05:54:02 2008
@@ -38,6 +38,7 @@
native-closure.js \
gdk-event.js \
signal-connect.js \
+ struct-functions.js \
make-test.py
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]