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
=== modified file 'examples/simple/simple.js'
--- examples/simple/simple.js 2016-01-11 14:25:28 +0000
+++ examples/simple/simple.js 2016-08-19 17:32:13 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2015-2016 Canonical Ltd.
3 *3 *
4 * This file is part of unity-js-scopes.4 * This file is part of unity-js-scopes.
5 *5 *
@@ -140,6 +140,7 @@
140 new scopes.lib.CategorisedResult(category);140 new scopes.lib.CategorisedResult(category);
141 categorised_result.set_uri("http://www.ubuntu.com");141 categorised_result.set_uri("http://www.ubuntu.com");
142 categorised_result.set_title("'" + qs + "'");142 categorised_result.set_title("'" + qs + "'");
143 categorised_result.set_intercept_activation();
143144
144 var filter_state =145 var filter_state =
145 new scopes.lib.FilterState();146 new scopes.lib.FilterState();
@@ -162,6 +163,26 @@
162 function() {163 function() {
163 });164 });
164 },165 },
165 preview: function(result, action_metadata) {}166 preview: function(result, action_metadata) {},
167 activate: function(result, metadata) {
168 return new scopes.lib.ActivationQuery(
169 result,
170 metadata,
171 "",
172 "",
173 // activate
174 function() {
175 console.log('Activate called');
176
177 var activation_response = new scopes.lib.ActivationResponse(
178 scopes.defs.ActivationResponseStatus.NotHandled);
179
180 return activation_response;
181 },
182 // cancelled
183 function() {
184 }
185 );
186 },
166 }187 }
167);188);
168189
=== modified file 'src/bindings/src/activation-query.h'
--- src/bindings/src/activation-query.h 2016-02-13 16:01:06 +0000
+++ src/bindings/src/activation-query.h 2016-08-19 17:32:13 +0000
@@ -39,6 +39,25 @@
3939
40--doc:prototype ActivationQuery40--doc:prototype ActivationQuery
4141
42--doc:constructor
43 * Constructs an ActivationQuery.
44 *
45 * To create an ActivationQuery in response to an activate() callback
46 * called from scopes.self.initialize, pass down the result and metadata
47 * received in the activate() callback and empty strings for the other
48 * parameters.
49 *
50 * To create an ActivationQuery in response to an perform_action() callback
51 * called from scopes.self.initialize, pass down the result, metadata, widget_id
52 * and action_id received in the perform_action() callback.
53 *
54 * @constructor
55 * @param result Result for the associated result
56 * @param metadata ActionMetadata associated with the result
57 * @param widget_id The widget identifier receiver received by the activation callback (if any)
58 * @param action_id The action identifier receiver received by the activation callback (if any)
59--/doc:constructor
60
42--doc:member61--doc:member
43 * Return response to the activation request62 * Return response to the activation request
44 * @method activate63 * @method activate

Subscribers

People subscribed via source and target branches

to all changes: