Page MenuHomePhabricator

D11398.diff
No OneTemporary

D11398.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -8,7 +8,7 @@
return array(
'names' => array(
'core.pkg.css' => '8d1c0f87',
- 'core.pkg.js' => '27bb3264',
+ 'core.pkg.js' => 'b6a9c22a',
'darkconsole.pkg.js' => '8ab24e01',
'differential.pkg.css' => '8af45893',
'differential.pkg.js' => 'dad3622f',
@@ -342,10 +342,10 @@
'rsrc/image/texture/table_header.png' => '5c433037',
'rsrc/image/texture/table_header_hover.png' => '038ec3b9',
'rsrc/image/texture/table_header_tall.png' => 'd56b434f',
- 'rsrc/js/application/aphlict/Aphlict.js' => '464d333a',
- 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'f6bc26f0',
- 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '1162a152',
- 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '58f7803f',
+ 'rsrc/js/application/aphlict/Aphlict.js' => 'b300dac3',
+ 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '335470d7',
+ 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '62998733',
+ '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',
'rsrc/js/application/conpherence/behavior-menu.js' => 'f0a41b9f',
@@ -535,11 +535,11 @@
'herald-rule-editor' => '335fd41f',
'herald-test-css' => '778b008e',
'inline-comment-summary-css' => '8cfd34e8',
- 'javelin-aphlict' => '464d333a',
+ 'javelin-aphlict' => 'b300dac3',
'javelin-behavior' => '61cbc29a',
- 'javelin-behavior-aphlict-dropdown' => 'f6bc26f0',
- 'javelin-behavior-aphlict-listen' => '1162a152',
- 'javelin-behavior-aphlict-status' => '58f7803f',
+ 'javelin-behavior-aphlict-dropdown' => '335470d7',
+ 'javelin-behavior-aphlict-listen' => '62998733',
+ 'javelin-behavior-aphlict-status' => 'ea681761',
'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884',
'javelin-behavior-aphront-crop' => 'fa0f4fc2',
'javelin-behavior-aphront-drag-and-drop-textarea' => '92eb531d',
@@ -902,18 +902,6 @@
'javelin-install',
'javelin-util',
),
- '1162a152' => array(
- 'javelin-behavior',
- 'javelin-aphlict',
- 'javelin-stratcom',
- 'javelin-request',
- 'javelin-uri',
- 'javelin-dom',
- 'javelin-json',
- 'javelin-router',
- 'javelin-util',
- 'phabricator-notification',
- ),
'13c739ea' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1002,6 +990,16 @@
'javelin-install',
'javelin-typeahead-source',
),
+ '335470d7' => array(
+ 'javelin-behavior',
+ 'javelin-request',
+ 'javelin-stratcom',
+ 'javelin-vector',
+ 'javelin-dom',
+ 'javelin-uri',
+ 'javelin-behavior-device',
+ 'phabricator-title',
+ ),
'335fd41f' => array(
'multirow-row-manager',
'javelin-install',
@@ -1089,13 +1087,6 @@
'javelin-behavior',
'javelin-dom',
),
- '464d333a' => array(
- 'javelin-install',
- 'javelin-util',
- 'javelin-websocket',
- 'javelin-leader',
- 'javelin-json',
- ),
'469c0d9e' => array(
'javelin-behavior',
'javelin-dom',
@@ -1173,12 +1164,6 @@
'javelin-vector',
'javelin-dom',
),
- '58f7803f' => array(
- 'javelin-behavior',
- 'javelin-aphlict',
- 'phabricator-phtize',
- 'javelin-dom',
- ),
'59b251eb' => array(
'javelin-behavior',
'javelin-stratcom',
@@ -1227,6 +1212,18 @@
'javelin-magical-init',
'javelin-util',
),
+ 62998733 => array(
+ 'javelin-behavior',
+ 'javelin-aphlict',
+ 'javelin-stratcom',
+ 'javelin-request',
+ 'javelin-uri',
+ 'javelin-dom',
+ 'javelin-json',
+ 'javelin-router',
+ 'javelin-util',
+ 'phabricator-notification',
+ ),
'6453c869' => array(
'javelin-install',
'javelin-dom',
@@ -1584,6 +1581,13 @@
'javelin-dom',
'phortune-credit-card-form',
),
+ 'b300dac3' => array(
+ 'javelin-install',
+ 'javelin-util',
+ 'javelin-websocket',
+ 'javelin-leader',
+ 'javelin-json',
+ ),
'b3a4b884' => array(
'javelin-behavior',
'phabricator-prefab',
@@ -1839,6 +1843,12 @@
'javelin-dom',
'phabricator-draggable-list',
),
+ 'ea681761' => array(
+ 'javelin-behavior',
+ 'javelin-aphlict',
+ 'phabricator-phtize',
+ 'javelin-dom',
+ ),
'efe49472' => array(
'javelin-install',
'javelin-util',
@@ -1892,16 +1902,6 @@
'javelin-util',
'javelin-reactor',
),
- 'f6bc26f0' => array(
- 'javelin-behavior',
- 'javelin-request',
- 'javelin-stratcom',
- 'javelin-vector',
- 'javelin-dom',
- 'javelin-uri',
- 'javelin-behavior-device',
- 'phabricator-title',
- ),
'f7379f45' => array(
'javelin-behavior',
'javelin-dom',
diff --git a/webroot/rsrc/js/application/aphlict/Aphlict.js b/webroot/rsrc/js/application/aphlict/Aphlict.js
--- a/webroot/rsrc/js/application/aphlict/Aphlict.js
+++ b/webroot/rsrc/js/application/aphlict/Aphlict.js
@@ -36,13 +36,12 @@
events: ['didChangeStatus'],
members: {
- _server: null,
- _port: null,
+ _uri: null,
+ _socket: null,
_subscriptions: null,
_status: null,
- _statusCode: null,
- start: function(node, uri) {
+ start: function() {
JX.Leader.listen('onBecomeLeader', JX.bind(this, this._lead));
JX.Leader.listen('onReceiveBroadcast', JX.bind(this, this._receive));
JX.Leader.start();
@@ -64,14 +63,12 @@
},
_lead: function() {
- var socket = new JX.WebSocket(this._uri);
- socket.setOpenHandler(JX.bind(this, this._open));
- socket.setMessageHandler(JX.bind(this, this._message));
- socket.setCloseHandler(JX.bind(this, this._close));
+ this._socket = new JX.WebSocket(this._uri);
+ this._socket.setOpenHandler(JX.bind(this, this._open));
+ this._socket.setMessageHandler(JX.bind(this, this._message));
+ this._socket.setCloseHandler(JX.bind(this, this._close));
- this._socket = socket;
-
- socket.open();
+ this._socket.open();
},
_open: function() {
@@ -97,16 +94,19 @@
case 'aphlict.status':
this._setStatus(message.data);
break;
+
case 'aphlict.getstatus':
if (is_leader) {
this._broadcastStatus(this.getStatus());
}
break;
+
case 'aphlict.getsubscribers':
JX.Leader.broadcast(
null,
{type: 'aphlict.subscribe', data: this._subscriptions});
break;
+
case 'aphlict.subscribe':
if (is_leader) {
this._write({
@@ -115,6 +115,7 @@
});
}
break;
+
case 'aphlict.server':
var handler = this.getHandler();
handler && handler(message.data);
diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
--- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
+++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
@@ -37,7 +37,8 @@
true);
}
- if (request) { //already fetching
+ if (request) {
+ // Already fetching.
return;
}
@@ -110,7 +111,6 @@
}
});
-
JX.DOM.listen(
bubble,
'click',
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
@@ -13,7 +13,6 @@
*/
JX.behavior('aphlict-listen', function(config) {
-
var showing_reload = false;
JX.Stratcom.listen('aphlict-receive-message', null, function(e) {
@@ -25,7 +24,7 @@
var request = new JX.Request(
'/notification/individual/',
- onnotification);
+ onNotification);
var routable = request
.addData({key: message.key})
@@ -38,16 +37,14 @@
JX.Router.getInstance().queue(routable);
});
-
// Respond to a notification from the Aphlict notification server. We send
// a request to Phabricator to get notification details.
- function onaphlictmessage(message) {
+ function onAphlictMessage(message) {
JX.Stratcom.invoke('aphlict-receive-message', null, message);
}
-
// Respond to a response from Phabricator about a specific notification.
- function onnotification(response) {
+ function onNotification(response) {
if (!response.pertinent) {
return;
}
@@ -59,7 +56,6 @@
.setContent(JX.$H(response.content))
.show();
-
// If the notification affected an object on this page, show a
// permanent reload notification if we aren't already.
if ((response.primaryObjectPHID in config.pageObjects) && !showing_reload) {
@@ -79,7 +75,7 @@
config.subscriptions);
client
- .setHandler(onaphlictmessage)
+ .setHandler(onAphlictMessage)
.start();
});
diff --git a/webroot/rsrc/js/application/aphlict/behavior-aphlict-status.js b/webroot/rsrc/js/application/aphlict/behavior-aphlict-status.js
--- a/webroot/rsrc/js/application/aphlict/behavior-aphlict-status.js
+++ b/webroot/rsrc/js/application/aphlict/behavior-aphlict-status.js
@@ -23,19 +23,11 @@
return;
}
- var tip = null;
var status = client.getStatus();
-
- if (status == 'error') {
- tip = pht(client.getStatusCode());
- }
-
var status_node = JX.$N(
'span',
{
- className: 'aphlict-connection-status-' + status,
- sigil: tip ? 'has-tooltip' : null,
- meta: tip ? {tip: tip, align: 'S', size: 300} : {}
+ className: 'aphlict-connection-status-' + status
},
pht(status));

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 28, 9:50 PM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6729181
Default Alt Text
D11398.diff (9 KB)

Event Timeline