Skip to content

Commit 7138427

Browse files
author
epriestley
committedNov 21, 2012
Modify Celerity to emit required resources on Ajax responses
Summary: Companion diff to D4003. Test Plan: Rigged up a response which loaded a CSS file with `body { background: red; }`, verified page turned red after I clicked the button. Reviewers: vrana, chad, btrahan Reviewed By: chad CC: aran Maniphest Tasks: T2086 Differential Revision: https://secure.phabricator.com/D4004
1 parent 2dcc4cf commit 7138427

File tree

3 files changed

+34
-25
lines changed

3 files changed

+34
-25
lines changed
 

‎externals/javelin

Submodule javelin updated from 888a4aa to d1586fc

‎src/__celerity_resource_map__.php

+24-24
Original file line numberDiff line numberDiff line change
@@ -4705,7 +4705,7 @@
47054705
),
47064706
'javelin-request' =>
47074707
array(
4708-
'uri' => '/res/d881d449/rsrc/js/javelin/lib/Request.js',
4708+
'uri' => '/res/e25d75b3/rsrc/js/javelin/lib/Request.js',
47094709
'type' => 'js',
47104710
'requires' =>
47114711
array(
@@ -5961,7 +5961,7 @@
59615961
'uri' => '/res/pkg/5e68be89/diffusion.pkg.js',
59625962
'type' => 'js',
59635963
),
5964-
'15ced26b' =>
5964+
'2e81a7e8' =>
59655965
array(
59665966
'name' => 'javelin.pkg.js',
59675967
'symbols' =>
@@ -5988,7 +5988,7 @@
59885988
19 => 'javelin-fx',
59895989
20 => 'javelin-color',
59905990
),
5991-
'uri' => '/res/pkg/15ced26b/javelin.pkg.js',
5991+
'uri' => '/res/pkg/2e81a7e8/javelin.pkg.js',
59925992
'type' => 'js',
59935993
),
59945994
'7839ae2d' =>
@@ -6052,7 +6052,7 @@
60526052
'diffusion-icons-css' => 'c8ce2d88',
60536053
'inline-comment-summary-css' => '47549184',
60546054
'javelin-aphlict' => 'dc2e64a4',
6055-
'javelin-behavior' => '15ced26b',
6055+
'javelin-behavior' => '2e81a7e8',
60566056
'javelin-behavior-aphlict-dropdown' => 'dc2e64a4',
60576057
'javelin-behavior-aphlict-listen' => 'dc2e64a4',
60586058
'javelin-behavior-aphront-basic-tokenizer' => 'dc2e64a4',
@@ -6099,26 +6099,26 @@
60996099
'javelin-behavior-repository-crossreference' => '7ecd31fa',
61006100
'javelin-behavior-toggle-class' => 'dc2e64a4',
61016101
'javelin-behavior-workflow' => 'dc2e64a4',
6102-
'javelin-color' => '15ced26b',
6103-
'javelin-dom' => '15ced26b',
6104-
'javelin-event' => '15ced26b',
6105-
'javelin-fx' => '15ced26b',
6106-
'javelin-install' => '15ced26b',
6107-
'javelin-json' => '15ced26b',
6108-
'javelin-mask' => '15ced26b',
6109-
'javelin-request' => '15ced26b',
6110-
'javelin-resource' => '15ced26b',
6111-
'javelin-stratcom' => '15ced26b',
6112-
'javelin-tokenizer' => '15ced26b',
6113-
'javelin-typeahead' => '15ced26b',
6114-
'javelin-typeahead-normalizer' => '15ced26b',
6115-
'javelin-typeahead-ondemand-source' => '15ced26b',
6116-
'javelin-typeahead-preloaded-source' => '15ced26b',
6117-
'javelin-typeahead-source' => '15ced26b',
6118-
'javelin-uri' => '15ced26b',
6119-
'javelin-util' => '15ced26b',
6120-
'javelin-vector' => '15ced26b',
6121-
'javelin-workflow' => '15ced26b',
6102+
'javelin-color' => '2e81a7e8',
6103+
'javelin-dom' => '2e81a7e8',
6104+
'javelin-event' => '2e81a7e8',
6105+
'javelin-fx' => '2e81a7e8',
6106+
'javelin-install' => '2e81a7e8',
6107+
'javelin-json' => '2e81a7e8',
6108+
'javelin-mask' => '2e81a7e8',
6109+
'javelin-request' => '2e81a7e8',
6110+
'javelin-resource' => '2e81a7e8',
6111+
'javelin-stratcom' => '2e81a7e8',
6112+
'javelin-tokenizer' => '2e81a7e8',
6113+
'javelin-typeahead' => '2e81a7e8',
6114+
'javelin-typeahead-normalizer' => '2e81a7e8',
6115+
'javelin-typeahead-ondemand-source' => '2e81a7e8',
6116+
'javelin-typeahead-preloaded-source' => '2e81a7e8',
6117+
'javelin-typeahead-source' => '2e81a7e8',
6118+
'javelin-uri' => '2e81a7e8',
6119+
'javelin-util' => '2e81a7e8',
6120+
'javelin-vector' => '2e81a7e8',
6121+
'javelin-workflow' => '2e81a7e8',
61226122
'lightbox-attachment-css' => '9541e1c0',
61236123
'maniphest-task-summary-css' => '7839ae2d',
61246124
'maniphest-transaction-detail-css' => '7839ae2d',

‎src/infrastructure/celerity/CelerityStaticResourceResponse.php

+9
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,15 @@ public function buildAjaxResponse($payload, $error = null) {
199199
$this->behaviors = array();
200200
}
201201

202+
$this->resolveResources();
203+
$resources = array();
204+
foreach ($this->packaged as $resource) {
205+
$resources[] = PhabricatorEnv::getCDNURI($resource['uri']);
206+
}
207+
if ($resources) {
208+
$response['javelin_resources'] = $resources;
209+
}
210+
202211
return $response;
203212
}
204213

0 commit comments

Comments
 (0)
Failed to load comments.