seed r558 - trunk/doc/tutorial-standalone
- From: hortont svn gnome org
- To: svn-commits-list gnome org
- Subject: seed r558 - trunk/doc/tutorial-standalone
- Date: Wed, 24 Dec 2008 02:06:16 +0000 (UTC)
Author: hortont
Date: Wed Dec 24 02:06:16 2008
New Revision: 558
URL: http://svn.gnome.org/viewvc/seed?rev=558&view=rev
Log:
Make buttons do things.
Modified:
trunk/doc/tutorial-standalone/2.js
Modified: trunk/doc/tutorial-standalone/2.js
==============================================================================
--- trunk/doc/tutorial-standalone/2.js (original)
+++ trunk/doc/tutorial-standalone/2.js Wed Dec 24 02:06:16 2008
@@ -11,6 +11,11 @@
{
var toolbar = new BrowserToolbar();
var web_view = new BrowserView();
+
+ this.get_web_view = function()
+ {
+ return web_view;
+ }
this.pack_start(toolbar);
this.pack_start(web_view, true, true);
@@ -39,22 +44,27 @@
var back = function ()
{
- Seed.print("back");
+ tab.get_web_view().go_back();
}
var forward = function ()
{
- Seed.print("forward");
+ tab.get_web_view().go_forward();
}
var refresh = function ()
{
- Seed.print("refresh");
+ tab.get_web_view().reload();
}
- var browse = function ()
+ var browse = function (url)
{
- Seed.print("browse");
+ if(url.text.search("://") < 0)
+ {
+ url.text = "http://" + url.text;
+ }
+
+ tab.get_web_view().open(url.text);
}
back_button.signal.clicked.connect(back);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]