summaryrefslogtreecommitdiff
path: root/api
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-12-07 18:36:07 +0100
committerportix <portix@gmx.net>2012-12-07 18:36:07 +0100
commit258e4e4b60c69c2d47369d15003cac863444b1d8 (patch)
tree2eab97c8aad34af7cbb8ea32cd467adf75c7c82a /api
parent1a1b8f71d1a055ede111036a40eb57e97d2a154b (diff)
downloaddwb-258e4e4b60c69c2d47369d15003cac863444b1d8.zip
Updated js-api
Diffstat (limited to 'api')
-rw-r--r--api/dwb-js.720
-rw-r--r--api/jsapi.7.txt20
-rw-r--r--api/jsapi.txt20
3 files changed, 33 insertions, 27 deletions
diff --git a/api/dwb-js.7 b/api/dwb-js.7
index 75ae3ac0..db781718 100644
--- a/api/dwb-js.7
+++ b/api/dwb-js.7
@@ -1337,17 +1337,19 @@ function foo(message)
});
return d;
}
+function callback1(response)
+{
+ io\&.print(response); // Prints "foo" after 2 seconds
-foo("foo")\&.done(
- function(response) {
- io\&.print(response); // Prints "foo" after 2 seconds
+ // Return a new Deferred, will replace the old one\&.
+ return foo("bar");
+}
+function callback2(response)
+{
+ io\&.print(response); // Prints "bar" after 4 seconds
+}
- // Return a new Deferred, will replace the old one\&.
- return foo("bar");
- })\&.done(
- function(response) {
- io\&.print(response); // Prints "bar" after 4 seconds
- });
+foo("foo")\&.done(callback1)\&.done(callback2);
.fi
.if n \{\
.RE
diff --git a/api/jsapi.7.txt b/api/jsapi.7.txt
index 7d4fe753..3a2ca7cd 100644
--- a/api/jsapi.7.txt
+++ b/api/jsapi.7.txt
@@ -669,17 +669,19 @@ function foo(message)
});
return d;
}
+function callback1(response)
+{
+ io.print(response); // Prints "foo" after 2 seconds
-foo("foo").done(
- function(response) {
- io.print(response); // Prints "foo" after 2 seconds
+ // Return a new Deferred, will replace the old one.
+ return foo("bar");
+}
+function callback2(response)
+{
+ io.print(response); // Prints "bar" after 4 seconds
+}
- // Return a new Deferred, will replace the old one.
- return foo("bar");
- }).done(
- function(response) {
- io.print(response); // Prints "bar" after 4 seconds
- });
+foo("foo").done(callback1).done(callback2);
---------------------------------
diff --git a/api/jsapi.txt b/api/jsapi.txt
index 7bd919ac..b04c583a 100644
--- a/api/jsapi.txt
+++ b/api/jsapi.txt
@@ -1243,17 +1243,19 @@ function foo(message)
});
return d;
}
+function callback1(response)
+{
+ io.print(response); // Prints "foo" after 2 seconds
-foo("foo").done(
- function(response) {
- io.print(response); // Prints "foo" after 2 seconds
+ // Return a new Deferred, will replace the old one.
+ return foo("bar");
+}
+function callback2(response)
+{
+ io.print(response); // Prints "bar" after 4 seconds
+}
- // Return a new Deferred, will replace the old one.
- return foo("bar");
- }).done(
- function(response) {
- io.print(response); // Prints "bar" after 4 seconds
- });
+foo("foo").done(callback1).done(callback2);
---------------------------------