diff options
author | portix <none@none> | 2012-11-01 14:58:56 +0100 |
---|---|---|
committer | portix <none@none> | 2012-11-01 14:58:56 +0100 |
commit | 3da3defd89ea9213397bab7ec5908639b3594391 (patch) | |
tree | 82801b03e71825ce3825a5ef88103dffa20ecd81 /api | |
parent | 2529be6a2c5783fbdde70847787cba06cb46175b (diff) | |
download | dwb-3da3defd89ea9213397bab7ec5908639b3594391.zip |
New signal changeMode; new method util.getMode
Diffstat (limited to 'api')
-rw-r--r-- | api/dwb-js.7 | 66 | ||||
-rw-r--r-- | api/jsapi.7.txt | 34 | ||||
-rw-r--r-- | api/jsapi.txt | 48 |
3 files changed, 146 insertions, 2 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7 index 585ef7ed..842daff8 100644 --- a/api/dwb-js.7 +++ b/api/dwb-js.7 @@ -2,12 +2,12 @@ .\" Title: dwb-js .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/> -.\" Date: 10/31/2012 +.\" Date: 11/01/2012 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" -.TH "DWB\-JS" "7" "10/31/2012" "\ \&" "\ \&" +.TH "DWB\-JS" "7" "11/01/2012" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -878,6 +878,22 @@ The body of the function as a string .nr an-break-flag 1 .br .ps +1 +\fBNumber util.getMode()\fR +.RS 4 +.sp +Gets the the current mode\&. +.PP +\fIreturns\fR +.RS 4 +The mode, see Modes for possible modes\&. +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 \fBString util.domainFromHost(String hostname)\fR .RS 4 .sp @@ -1557,6 +1573,37 @@ Same as buttonPress but without .nr an-break-flag 1 .br .ps +1 +\fBchangeMode\fR +.RS 4 +.sp +.if n \{\ +.RS 4 +.\} +.nf +signals\&.connect("changeMode", function(webview, mode)); +.fi +.if n \{\ +.RE +.\} +.sp +Emitted when the mode changes, return true to prevent the change\&. +.PP +\fIwebview\fR +.RS 4 +The focused webview +.RE +.PP +\fImode\fR +.RS 4 +A mode, see also Modes for possible modes +.RE +.RE +.sp +.it 1 an-trap +.nr an-no-space-flag 1 +.nr an-break-flag 1 +.br +.ps +1 \fBclose\fR .RS 4 .sp @@ -2432,6 +2479,21 @@ const SpawnError = { .if n \{\ .RE .\} +.SS "Modes" +.sp +.if n \{\ +.RS 4 +.\} +.nf +const Modes = { + NormalMode : 1<<0, + InsertMode : 1<<1, + CommandMode : 1<<2 +}; +.fi +.if n \{\ +.RE +.\} .SH "GLOBAL DATA" .sp Since all scripts share the same execution context, they are encapsulated in a function\&. To avoid conflicts with other scripts it is not allowed to set properties on the global object, i\&.e\&. diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt index 3ad27d95..cc1a8bb6 100644 --- a/api/jsapi.7.txt +++ b/api/jsapi.7.txt @@ -400,6 +400,14 @@ _func_;; A function _returns_;; The body of the function as a string **** +==== Number util.getMode() +**** + +Gets the the current mode. + +_returns_;; The mode, see Modes for possible modes. +**** + ==== String util.domainFromHost(String hostname) **** @@ -749,6 +757,19 @@ _hittestresult_;; Hittestresult under the cursor _event_;; Same as buttonPress but without _event.type_ **** +==== changeMode + +**** +---- +signals.connect("changeMode", function(webview, mode)); +---- + +Emitted when the mode changes, return true to prevent the change. + +_webview_;; The focused webview +_mode_;; A mode, see also Modes for possible modes +**** + ==== close **** @@ -1166,6 +1187,19 @@ const SpawnError = { -------- **** +=== Modes + +**** +-------- +const Modes = { + NormalMode : 1<<0, + InsertMode : 1<<1, + CommandMode : 1<<2 +}; +-------- +**** + + == GLOBAL DATA == Since all scripts share the same execution context, they are encapsulated in a function. To avoid conflicts with other scripts it is not allowed to set properties diff --git a/api/jsapi.txt b/api/jsapi.txt index 7ae151a7..993fcec3 100644 --- a/api/jsapi.txt +++ b/api/jsapi.txt @@ -750,6 +750,22 @@ _returns_;; The body of the function as a string **** **** +[float] +==== *getMode()* ==== + +[source,javascript] +---- +Number util.getMode() +---- + +Gets the the current mode. + +_returns_;; The mode, see <<Modes>> for possible modes. +**** + + + +**** [[domainFromHost]] [float] ==== *domainFromHost()* ==== @@ -1449,6 +1465,24 @@ _event_;; Same as <<buttonPress>> but without _event.type_ **** **** +[[changeMode]] +[float] +==== *changeMode* ==== + +[source,javascript] +---- +Boolean callback(webview, mode) +---- + +Emitted when the mode changes, return true to prevent the change. + + :: + +_webview_;; The focused webview +_mode_;; A mode, see also <<Modes>> for possible modes +**** + +**** [[close]] [float] ==== *close* ==== @@ -2024,6 +2058,20 @@ const SpawnError = { -------- **** +**** +[[Modes]] +[float] +==== *Modes* ==== +[source,javascript] +-------- +const Modes = { + NormalMode : 1<<0, + InsertMode : 1<<1, + CommandMode : 1<<2 +}; +-------- +**** + [[Globaldata]] == Global data == |