Merge lp:~abreu-alexandre/unity-js-scopes/activate into lp:unity-js-scopes

Proposed by Alexandre Abreu
Status: Work in progress
Proposed branch: lp:~abreu-alexandre/unity-js-scopes/activate
Merge into: lp:unity-js-scopes
Diff against target: 76 lines (+42/-2)
2 files modified
examples/simple/simple.js (+23/-2)
src/bindings/src/activation-query.h (+19/-0)
To merge this branch: bzr merge lp:~abreu-alexandre/unity-js-scopes/activate
Reviewer Review Type Date Requested Status
WebApps Pending
Review via email: mp+303452@code.launchpad.net

Commit message

Improve doc for ActivationQuery

Description of the change

Improve doc for ActivationQuery

To post a comment you must log in.

Unmerged revisions

143. By Alexandre Abreu

Improve doc for ActivationQuery

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'examples/simple/simple.js'
2--- examples/simple/simple.js 2016-01-11 14:25:28 +0000
3+++ examples/simple/simple.js 2016-08-19 17:32:13 +0000
4@@ -1,5 +1,5 @@
5 /*
6- * Copyright 2015 Canonical Ltd.
7+ * Copyright 2015-2016 Canonical Ltd.
8 *
9 * This file is part of unity-js-scopes.
10 *
11@@ -140,6 +140,7 @@
12 new scopes.lib.CategorisedResult(category);
13 categorised_result.set_uri("http://www.ubuntu.com");
14 categorised_result.set_title("'" + qs + "'");
15+ categorised_result.set_intercept_activation();
16
17 var filter_state =
18 new scopes.lib.FilterState();
19@@ -162,6 +163,26 @@
20 function() {
21 });
22 },
23- preview: function(result, action_metadata) {}
24+ preview: function(result, action_metadata) {},
25+ activate: function(result, metadata) {
26+ return new scopes.lib.ActivationQuery(
27+ result,
28+ metadata,
29+ "",
30+ "",
31+ // activate
32+ function() {
33+ console.log('Activate called');
34+
35+ var activation_response = new scopes.lib.ActivationResponse(
36+ scopes.defs.ActivationResponseStatus.NotHandled);
37+
38+ return activation_response;
39+ },
40+ // cancelled
41+ function() {
42+ }
43+ );
44+ },
45 }
46 );
47
48=== modified file 'src/bindings/src/activation-query.h'
49--- src/bindings/src/activation-query.h 2016-02-13 16:01:06 +0000
50+++ src/bindings/src/activation-query.h 2016-08-19 17:32:13 +0000
51@@ -39,6 +39,25 @@
52
53 --doc:prototype ActivationQuery
54
55+--doc:constructor
56+ * Constructs an ActivationQuery.
57+ *
58+ * To create an ActivationQuery in response to an activate() callback
59+ * called from scopes.self.initialize, pass down the result and metadata
60+ * received in the activate() callback and empty strings for the other
61+ * parameters.
62+ *
63+ * To create an ActivationQuery in response to an perform_action() callback
64+ * called from scopes.self.initialize, pass down the result, metadata, widget_id
65+ * and action_id received in the perform_action() callback.
66+ *
67+ * @constructor
68+ * @param result Result for the associated result
69+ * @param metadata ActionMetadata associated with the result
70+ * @param widget_id The widget identifier receiver received by the activation callback (if any)
71+ * @param action_id The action identifier receiver received by the activation callback (if any)
72+--/doc:constructor
73+
74 --doc:member
75 * Return response to the activation request
76 * @method activate

Subscribers

People subscribed via source and target branches

to all changes: