summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorportix <none@none>2012-11-05 21:23:18 +0100
committerportix <none@none>2012-11-05 21:23:18 +0100
commit773dbe7055f3c10ac2329803647fba405ac7cff8 (patch)
treea1f1fb536d9e0c4a2425d23106d1b98e06252591 /api
parent46af32e61b13c8e31987592630e00ec954f41147 (diff)
downloaddwb-773dbe7055f3c10ac2329803647fba405ac7cff8.zip
Ignore default action of button 8 and button 9
Diffstat (limited to 'api')
-rw-r--r--api/dwb-js.717
-rw-r--r--api/jsapi.7.txt13
-rw-r--r--api/jsapi.txt20
3 files changed, 23 insertions, 27 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7
index c208d932..1a14f5d4 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: 11/03/2012
+.\" Date: 11/04/2012
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
-.TH "DWB\-JS" "7" "11/03/2012" "\ \&" "\ \&"
+.TH "DWB\-JS" "7" "11/04/2012" "\ \&" "\ \&"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -2518,16 +2518,15 @@ Since all scripts share the same execution context, they are encapsulated in a f
number = 0;
io\&.print(number); // undefined
-// always use var instead
-var number = 0;
+var number2 = 0;
io\&.print(number2); // 0
-// won\*(Aqt work either
-function foo() {
- bar = 1;
+// not allowed
+foo = function()
+{
+ io\&.print("foo");
}
-foo();
-io\&.print(bar); // undefined
+foo(); // fails
.fi
.if n \{\
.RE
diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt
index 1f6eff2d..cd83b493 100644
--- a/api/jsapi.7.txt
+++ b/api/jsapi.7.txt
@@ -1216,16 +1216,15 @@ on the global object, i.e.
number = 0;
io.print(number); // undefined
-// always use var instead
-var number = 0;
+var number2 = 0;
io.print(number2); // 0
-// won't work either
-function foo() {
- bar = 1;
+// not allowed
+foo = function()
+{
+ io.print("foo");
}
-foo();
-io.print(bar); // undefined
+foo(); // fails
-------
For sharing data between scripts either signals or modules can be created.
diff --git a/api/jsapi.txt b/api/jsapi.txt
index d411c0d3..55d112f7 100644
--- a/api/jsapi.txt
+++ b/api/jsapi.txt
@@ -2094,9 +2094,9 @@ const Modes = {
[[Globaldata]]
== Global data ==
-Since all scripts share the same execution context, they are encapsulated as a
-module function. To avoid conflicts with other scripts it is not allowed to set
-properties on the global object, i.e.
+Since all scripts share the same execution context, every script is encapsulated
+in a function. To avoid conflicts between scripts, e.g. with duplicate
+variables, it is not allowed to set properties on the global object:
[source,javascript]
-------
@@ -2106,21 +2106,19 @@ properties on the global object, i.e.
number = 0;
io.print(number); // undefined
-// always use var instead
-var number = 0;
+var number2 = 0;
io.print(number2); // 0
-// won't work either
-function foo() {
- bar = 1;
+// not allowed
+foo = function()
+{
+ io.print("foo");
}
-foo();
-io.print(bar); // undefined
+foo(); // fails
-------
For sharing data between scripts either signals or modules can be created.
-
[[Modules]]
== Modules ==