From c5ee3a4522fe49ad9a4cd7ce903595989de54517 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sat, 7 Jun 2014 14:04:52 -0700 Subject: [PATCH] Serve aphlict.swf through Celerity Summary: This currently uses a hard-coded relative path, but should not, especially after D9401. The major effect of this is that updated .swf files might not be served properly, and we were at the whims of the server configuration for caching/versioning behavior. Test Plan: Enabled debug notifications, saw .swf load through Celerity. Reviewers: joshuaspence Reviewed By: joshuaspence Subscribers: epriestley Differential Revision: https://secure.phabricator.com/D9421 --- .../celerity/CelerityStaticResourceResponse.php | 2 +- src/view/page/PhabricatorStandardPageView.php | 7 ++++++- .../rsrc/js/application/aphlict/behavior-aphlict-listen.js | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/infrastructure/celerity/CelerityStaticResourceResponse.php b/src/infrastructure/celerity/CelerityStaticResourceResponse.php index 21ad591e87..feba9ffac1 100644 --- a/src/infrastructure/celerity/CelerityStaticResourceResponse.php +++ b/src/infrastructure/celerity/CelerityStaticResourceResponse.php @@ -281,7 +281,7 @@ final class CelerityStaticResourceResponse { return $response; } - private function getURI( + public function getURI( CelerityResourceMap $map, $name) { diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php index 58f96579d0..093287eb6a 100644 --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -356,6 +356,8 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { parent::getTail(), ); + $response = CelerityAPI::getStaticResourceResponse(); + if (PhabricatorEnv::getEnvConfig('notification.enabled')) { if ($user && $user->isLoggedIn()) { @@ -370,6 +372,9 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { $client_uri->setDomain($this_host->getDomain()); } + $map = CelerityResourceMap::getNamedInstance('phabricator'); + $swf_uri = $response->getURI($map, 'rsrc/swf/aphlict.swf'); + $enable_debug = PhabricatorEnv::getEnvConfig('notification.debug'); Javelin::initBehavior( 'aphlict-listen', @@ -379,6 +384,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { 'server' => $client_uri->getDomain(), 'port' => $client_uri->getPort(), 'debug' => $enable_debug, + 'swfURI' => $swf_uri, 'pageObjects' => array_fill_keys($this->pageObjects, true), )); @@ -393,7 +399,6 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView { } } - $response = CelerityAPI::getStaticResourceResponse(); $tail[] = $response->renderHTMLFooter(); return $tail; diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js index 284534b262..84c221b6ac 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js +++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js @@ -99,10 +99,10 @@ JX.behavior('aphlict-listen', function(config) { // Add Flash object to page JX.$(config.containerID).innerHTML = '' + - '' + + '' + '' + '' + - '' + ''; //Evan sanctioned });