1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-27 15:08:20 +01:00

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
This commit is contained in:
epriestley 2014-06-07 14:04:52 -07:00
parent 39ca090d15
commit c5ee3a4522
3 changed files with 9 additions and 4 deletions

View file

@ -281,7 +281,7 @@ final class CelerityStaticResourceResponse {
return $response;
}
private function getURI(
public function getURI(
CelerityResourceMap $map,
$name) {

View file

@ -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;

View file

@ -99,10 +99,10 @@ JX.behavior('aphlict-listen', function(config) {
// Add Flash object to page
JX.$(config.containerID).innerHTML =
'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">' +
'<param name="movie" value="/rsrc/swf/aphlict.swf" />' +
'<param name="movie" value="' + config.swfURI + '" />' +
'<param name="allowScriptAccess" value="always" />' +
'<param name="wmode" value="opaque" />' +
'<embed src="/rsrc/swf/aphlict.swf" wmode="opaque"' +
'<embed src="' + config.swfURI + '" wmode="opaque"' +
'width="0" height="0" id="' + config.id + '">' +
'</embed></object>'; //Evan sanctioned
});