Allow CelerityResourceResponse to hold resources from multiple maps

Summary:
Ref T4222. Currently, CelerityResourceResponse holds response resources in flat maps. Instead, specify which map resources appear in.

Also, provide `requireResource()` and `initBehavior()` APIs on the Controller and View base classes. These provide a cleaner abstraction over `require_celerity_resource()` and `Javelin::initBehavior()`, but are otherwise the same. Move a few callsites over.

Test Plan:
  - Reloaded pages.
  - Browsed around Differential.

Reviewers: btrahan, hach-que

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T4222

Differential Revision: https://secure.phabricator.com/D7876
This commit is contained in:
epriestley
2014-01-02 11:59:35 -08:00
parent 09341be10f
commit 31b6f69ff7
18 changed files with 146 additions and 53 deletions

View File

@@ -497,8 +497,8 @@ final class DifferentialRevisionViewController extends DifferentialController {
);
}
require_celerity_resource('phabricator-object-selector-css');
require_celerity_resource('javelin-behavior-phabricator-object-selector');
$this->requireResource('phabricator-object-selector-css');
$this->requireResource('javelin-behavior-phabricator-object-selector');
$links[] = array(
'icon' => 'link',