Page MenuHomePhabricator

D9535.id28968.diff
No OneTemporary

D9535.id28968.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -8,10 +8,10 @@
return array(
'names' => array(
'core.pkg.css' => '70320e8a',
- 'core.pkg.js' => '5a1c336d',
+ 'core.pkg.js' => '28ef0e70',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '1940be3f',
- 'differential.pkg.js' => 'e62fe1cf',
+ 'differential.pkg.js' => '53c1ccc2',
'diffusion.pkg.css' => '591664fa',
'diffusion.pkg.js' => 'bfc0737b',
'maniphest.pkg.css' => '68d4dd3d',
@@ -208,6 +208,7 @@
'rsrc/externals/javelin/lib/Routable.js' => 'b3e7d692',
'rsrc/externals/javelin/lib/Router.js' => '29274e2b',
'rsrc/externals/javelin/lib/Scrollbar.js' => '1ed54a27',
+ 'rsrc/externals/javelin/lib/Sound.js' => '59655c83',
'rsrc/externals/javelin/lib/URI.js' => '6eff08aa',
'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8',
'rsrc/externals/javelin/lib/WebSocket.js' => 'e292eaf4',
@@ -347,7 +348,7 @@
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
'rsrc/js/application/aphlict/Aphlict.js' => '2be71d56',
'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '830b3278',
- 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '851f167c',
+ 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'bdf2226d',
'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761',
'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18',
'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de',
@@ -361,7 +362,7 @@
'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '453c5375',
'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => 'd4eecc63',
'rsrc/js/application/differential/ChangesetViewManager.js' => '88be0133',
- 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '1b772f31',
+ 'rsrc/js/application/differential/DifferentialInlineCommentEditor.js' => '0286a1db',
'rsrc/js/application/differential/behavior-add-reviewers-and-ccs.js' => 'e10f8e18',
'rsrc/js/application/differential/behavior-comment-jump.js' => '4fdb476d',
'rsrc/js/application/differential/behavior-comment-preview.js' => '8e1389b5',
@@ -520,7 +521,7 @@
'conpherence-widget-pane-css' => '3d575438',
'differential-changeset-view-css' => '6a8b172a',
'differential-core-view-css' => '7ac3cabc',
- 'differential-inline-comment-editor' => '1b772f31',
+ 'differential-inline-comment-editor' => '0286a1db',
'differential-results-table-css' => '181aa9d9',
'differential-revision-add-comment-css' => 'c478bcaa',
'differential-revision-comment-css' => '48186045',
@@ -542,7 +543,7 @@
'javelin-aphlict' => '2be71d56',
'javelin-behavior' => '61cbc29a',
'javelin-behavior-aphlict-dropdown' => '830b3278',
- 'javelin-behavior-aphlict-listen' => '851f167c',
+ 'javelin-behavior-aphlict-listen' => 'bdf2226d',
'javelin-behavior-aphlict-status' => 'ea681761',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
'javelin-behavior-aphront-crop' => 'fa0f4fc2',
@@ -677,6 +678,7 @@
'javelin-routable' => 'b3e7d692',
'javelin-router' => '29274e2b',
'javelin-scrollbar' => '1ed54a27',
+ 'javelin-sound' => '59655c83',
'javelin-stratcom' => '6c53634d',
'javelin-tokenizer' => '7644823e',
'javelin-typeahead' => '70baed2f',
@@ -830,6 +832,14 @@
'unhandled-exception-css' => '37d4f9a2',
),
'requires' => array(
+ '0286a1db' => array(
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-stratcom',
+ 'javelin-install',
+ 'javelin-request',
+ 'javelin-workflow',
+ ),
'029a133d' => array(
'aphront-dialog-view-css',
),
@@ -931,14 +941,6 @@
'javelin-util',
'phabricator-keyboard-shortcut-manager',
),
- '1b772f31' => array(
- 'javelin-dom',
- 'javelin-util',
- 'javelin-stratcom',
- 'javelin-install',
- 'javelin-request',
- 'javelin-workflow',
- ),
'1d298e3a' => array(
'javelin-install',
'javelin-util',
@@ -1175,6 +1177,9 @@
'javelin-vector',
'javelin-dom',
),
+ '59655c83' => array(
+ 'javelin-install',
+ ),
'59b251eb' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1424,19 +1429,6 @@
'javelin-uri',
'javelin-routable',
),
- '851f167c' => array(
- 'javelin-behavior',
- 'javelin-aphlict',
- 'javelin-stratcom',
- 'javelin-request',
- 'javelin-uri',
- 'javelin-dom',
- 'javelin-json',
- 'javelin-router',
- 'javelin-util',
- 'javelin-leader',
- 'phabricator-notification',
- ),
'85ea0626' => array(
'javelin-install',
),
@@ -1720,6 +1712,20 @@
'javelin-util',
'javelin-request',
),
+ 'bdf2226d' => array(
+ 'javelin-behavior',
+ 'javelin-aphlict',
+ 'javelin-stratcom',
+ 'javelin-request',
+ 'javelin-uri',
+ 'javelin-dom',
+ 'javelin-json',
+ 'javelin-router',
+ 'javelin-util',
+ 'javelin-leader',
+ 'javelin-sound',
+ 'phabricator-notification',
+ ),
'be807912' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php
--- a/src/applications/celerity/controller/CelerityResourceController.php
+++ b/src/applications/celerity/controller/CelerityResourceController.php
@@ -125,6 +125,7 @@
'woff2' => 'font/woff2',
'eot' => 'font/eot',
'ttf' => 'font/ttf',
+ 'mp3' => 'audio/mpeg',
);
}
diff --git a/src/applications/celerity/resources/CelerityResourcesOnDisk.php b/src/applications/celerity/resources/CelerityResourcesOnDisk.php
--- a/src/applications/celerity/resources/CelerityResourcesOnDisk.php
+++ b/src/applications/celerity/resources/CelerityResourcesOnDisk.php
@@ -37,6 +37,7 @@
'woff2',
'ttf',
'eot',
+ 'mp3',
);
}
diff --git a/webroot/rsrc/externals/javelin/lib/Sound.js b/webroot/rsrc/externals/javelin/lib/Sound.js
new file mode 100644
--- /dev/null
+++ b/webroot/rsrc/externals/javelin/lib/Sound.js
@@ -0,0 +1,38 @@
+/**
+ * @requires javelin-install
+ * @provides javelin-sound
+ * @javelin
+ */
+
+
+JX.install('Sound', {
+ statics: {
+ _sounds: {},
+
+ load: function(uri) {
+ var self = JX.Sound;
+
+ if (!(uri in self._sounds)) {
+ self._sounds[uri] = JX.$N(
+ 'audio',
+ {
+ src: uri,
+ preload: 'auto'
+ });
+ }
+ },
+
+ play: function(uri) {
+ var self = JX.Sound;
+ self.load(uri);
+
+ var sound = self._sounds[uri];
+
+ try {
+ sound.play();
+ } catch (ex) {
+ JX.log(ex);
+ }
+ }
+ }
+});
diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
--- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
+++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
@@ -10,6 +10,7 @@
* javelin-router
* javelin-util
* javelin-leader
+ * javelin-sound
* phabricator-notification
*/
@@ -97,4 +98,17 @@
.setHandler(onAphlictMessage)
.start();
+ JX.Leader.listen('onReceiveBroadcast', function(message, is_leader) {
+ if (message.type !== 'sound') {
+ return;
+ }
+
+ if (!is_leader) {
+ return;
+ }
+
+ JX.Sound.play(message.data);
+ });
+
+
});

File Metadata

Mime Type
text/plain
Expires
Oct 16 2024, 2:20 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6715497
Default Alt Text
D9535.id28968.diff (7 KB)

Event Timeline