@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor tidying of Aphlict code

Summary: Just some housekeeping... mostly just removing some unused variables.

Test Plan: Checked that I was still about to receive notifications from `/notification/status/`.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11398

+63 -74
+44 -44
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '8d1c0f87', 11 - 'core.pkg.js' => '27bb3264', 11 + 'core.pkg.js' => 'b6a9c22a', 12 12 'darkconsole.pkg.js' => '8ab24e01', 13 13 'differential.pkg.css' => '8af45893', 14 14 'differential.pkg.js' => 'dad3622f', ··· 342 342 'rsrc/image/texture/table_header.png' => '5c433037', 343 343 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 344 344 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 345 - 'rsrc/js/application/aphlict/Aphlict.js' => '464d333a', 346 - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'f6bc26f0', 347 - 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '1162a152', 348 - 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '58f7803f', 345 + 'rsrc/js/application/aphlict/Aphlict.js' => 'b300dac3', 346 + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '335470d7', 347 + 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => '62998733', 348 + 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => 'ea681761', 349 349 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', 350 350 'rsrc/js/application/config/behavior-reorder-fields.js' => '14a827de', 351 351 'rsrc/js/application/conpherence/behavior-menu.js' => 'f0a41b9f', ··· 535 535 'herald-rule-editor' => '335fd41f', 536 536 'herald-test-css' => '778b008e', 537 537 'inline-comment-summary-css' => '8cfd34e8', 538 - 'javelin-aphlict' => '464d333a', 538 + 'javelin-aphlict' => 'b300dac3', 539 539 'javelin-behavior' => '61cbc29a', 540 - 'javelin-behavior-aphlict-dropdown' => 'f6bc26f0', 541 - 'javelin-behavior-aphlict-listen' => '1162a152', 542 - 'javelin-behavior-aphlict-status' => '58f7803f', 540 + 'javelin-behavior-aphlict-dropdown' => '335470d7', 541 + 'javelin-behavior-aphlict-listen' => '62998733', 542 + 'javelin-behavior-aphlict-status' => 'ea681761', 543 543 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', 544 544 'javelin-behavior-aphront-crop' => 'fa0f4fc2', 545 545 'javelin-behavior-aphront-drag-and-drop-textarea' => '92eb531d', ··· 902 902 'javelin-install', 903 903 'javelin-util', 904 904 ), 905 - '1162a152' => array( 906 - 'javelin-behavior', 907 - 'javelin-aphlict', 908 - 'javelin-stratcom', 909 - 'javelin-request', 910 - 'javelin-uri', 911 - 'javelin-dom', 912 - 'javelin-json', 913 - 'javelin-router', 914 - 'javelin-util', 915 - 'phabricator-notification', 916 - ), 917 905 '13c739ea' => array( 918 906 'javelin-behavior', 919 907 'javelin-stratcom', ··· 1002 990 'javelin-install', 1003 991 'javelin-typeahead-source', 1004 992 ), 993 + '335470d7' => array( 994 + 'javelin-behavior', 995 + 'javelin-request', 996 + 'javelin-stratcom', 997 + 'javelin-vector', 998 + 'javelin-dom', 999 + 'javelin-uri', 1000 + 'javelin-behavior-device', 1001 + 'phabricator-title', 1002 + ), 1005 1003 '335fd41f' => array( 1006 1004 'multirow-row-manager', 1007 1005 'javelin-install', ··· 1089 1087 'javelin-behavior', 1090 1088 'javelin-dom', 1091 1089 ), 1092 - '464d333a' => array( 1093 - 'javelin-install', 1094 - 'javelin-util', 1095 - 'javelin-websocket', 1096 - 'javelin-leader', 1097 - 'javelin-json', 1098 - ), 1099 1090 '469c0d9e' => array( 1100 1091 'javelin-behavior', 1101 1092 'javelin-dom', ··· 1173 1164 'javelin-vector', 1174 1165 'javelin-dom', 1175 1166 ), 1176 - '58f7803f' => array( 1177 - 'javelin-behavior', 1178 - 'javelin-aphlict', 1179 - 'phabricator-phtize', 1180 - 'javelin-dom', 1181 - ), 1182 1167 '59b251eb' => array( 1183 1168 'javelin-behavior', 1184 1169 'javelin-stratcom', ··· 1226 1211 '61cbc29a' => array( 1227 1212 'javelin-magical-init', 1228 1213 'javelin-util', 1214 + ), 1215 + 62998733 => array( 1216 + 'javelin-behavior', 1217 + 'javelin-aphlict', 1218 + 'javelin-stratcom', 1219 + 'javelin-request', 1220 + 'javelin-uri', 1221 + 'javelin-dom', 1222 + 'javelin-json', 1223 + 'javelin-router', 1224 + 'javelin-util', 1225 + 'phabricator-notification', 1229 1226 ), 1230 1227 '6453c869' => array( 1231 1228 'javelin-install', ··· 1584 1581 'javelin-dom', 1585 1582 'phortune-credit-card-form', 1586 1583 ), 1584 + 'b300dac3' => array( 1585 + 'javelin-install', 1586 + 'javelin-util', 1587 + 'javelin-websocket', 1588 + 'javelin-leader', 1589 + 'javelin-json', 1590 + ), 1587 1591 'b3a4b884' => array( 1588 1592 'javelin-behavior', 1589 1593 'phabricator-prefab', ··· 1839 1843 'javelin-dom', 1840 1844 'phabricator-draggable-list', 1841 1845 ), 1846 + 'ea681761' => array( 1847 + 'javelin-behavior', 1848 + 'javelin-aphlict', 1849 + 'phabricator-phtize', 1850 + 'javelin-dom', 1851 + ), 1842 1852 'efe49472' => array( 1843 1853 'javelin-install', 1844 1854 'javelin-util', ··· 1891 1901 'javelin-reactornode', 1892 1902 'javelin-util', 1893 1903 'javelin-reactor', 1894 - ), 1895 - 'f6bc26f0' => array( 1896 - 'javelin-behavior', 1897 - 'javelin-request', 1898 - 'javelin-stratcom', 1899 - 'javelin-vector', 1900 - 'javelin-dom', 1901 - 'javelin-uri', 1902 - 'javelin-behavior-device', 1903 - 'phabricator-title', 1904 1904 ), 1905 1905 'f7379f45' => array( 1906 1906 'javelin-behavior',
+12 -11
webroot/rsrc/js/application/aphlict/Aphlict.js
··· 36 36 events: ['didChangeStatus'], 37 37 38 38 members: { 39 - _server: null, 40 - _port: null, 39 + _uri: null, 40 + _socket: null, 41 41 _subscriptions: null, 42 42 _status: null, 43 - _statusCode: null, 44 43 45 - start: function(node, uri) { 44 + start: function() { 46 45 JX.Leader.listen('onBecomeLeader', JX.bind(this, this._lead)); 47 46 JX.Leader.listen('onReceiveBroadcast', JX.bind(this, this._receive)); 48 47 JX.Leader.start(); ··· 64 63 }, 65 64 66 65 _lead: function() { 67 - var socket = new JX.WebSocket(this._uri); 68 - socket.setOpenHandler(JX.bind(this, this._open)); 69 - socket.setMessageHandler(JX.bind(this, this._message)); 70 - socket.setCloseHandler(JX.bind(this, this._close)); 66 + this._socket = new JX.WebSocket(this._uri); 67 + this._socket.setOpenHandler(JX.bind(this, this._open)); 68 + this._socket.setMessageHandler(JX.bind(this, this._message)); 69 + this._socket.setCloseHandler(JX.bind(this, this._close)); 71 70 72 - this._socket = socket; 73 - 74 - socket.open(); 71 + this._socket.open(); 75 72 }, 76 73 77 74 _open: function() { ··· 97 94 case 'aphlict.status': 98 95 this._setStatus(message.data); 99 96 break; 97 + 100 98 case 'aphlict.getstatus': 101 99 if (is_leader) { 102 100 this._broadcastStatus(this.getStatus()); 103 101 } 104 102 break; 103 + 105 104 case 'aphlict.getsubscribers': 106 105 JX.Leader.broadcast( 107 106 null, 108 107 {type: 'aphlict.subscribe', data: this._subscriptions}); 109 108 break; 109 + 110 110 case 'aphlict.subscribe': 111 111 if (is_leader) { 112 112 this._write({ ··· 115 115 }); 116 116 } 117 117 break; 118 + 118 119 case 'aphlict.server': 119 120 var handler = this.getHandler(); 120 121 handler && handler(message.data);
+2 -2
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
··· 37 37 true); 38 38 } 39 39 40 - if (request) { //already fetching 40 + if (request) { 41 + // Already fetching. 41 42 return; 42 43 } 43 44 ··· 109 110 e.kill(); 110 111 } 111 112 }); 112 - 113 113 114 114 JX.DOM.listen( 115 115 bubble,
+4 -8
webroot/rsrc/js/application/aphlict/behavior-aphlict-listen.js
··· 13 13 */ 14 14 15 15 JX.behavior('aphlict-listen', function(config) { 16 - 17 16 var showing_reload = false; 18 17 19 18 JX.Stratcom.listen('aphlict-receive-message', null, function(e) { ··· 25 24 26 25 var request = new JX.Request( 27 26 '/notification/individual/', 28 - onnotification); 27 + onNotification); 29 28 30 29 var routable = request 31 30 .addData({key: message.key}) ··· 38 37 JX.Router.getInstance().queue(routable); 39 38 }); 40 39 41 - 42 40 // Respond to a notification from the Aphlict notification server. We send 43 41 // a request to Phabricator to get notification details. 44 - function onaphlictmessage(message) { 42 + function onAphlictMessage(message) { 45 43 JX.Stratcom.invoke('aphlict-receive-message', null, message); 46 44 } 47 45 48 - 49 46 // Respond to a response from Phabricator about a specific notification. 50 - function onnotification(response) { 47 + function onNotification(response) { 51 48 if (!response.pertinent) { 52 49 return; 53 50 } ··· 58 55 new JX.Notification() 59 56 .setContent(JX.$H(response.content)) 60 57 .show(); 61 - 62 58 63 59 // If the notification affected an object on this page, show a 64 60 // permanent reload notification if we aren't already. ··· 79 75 config.subscriptions); 80 76 81 77 client 82 - .setHandler(onaphlictmessage) 78 + .setHandler(onAphlictMessage) 83 79 .start(); 84 80 85 81 });
+1 -9
webroot/rsrc/js/application/aphlict/behavior-aphlict-status.js
··· 23 23 return; 24 24 } 25 25 26 - var tip = null; 27 26 var status = client.getStatus(); 28 - 29 - if (status == 'error') { 30 - tip = pht(client.getStatusCode()); 31 - } 32 - 33 27 var status_node = JX.$N( 34 28 'span', 35 29 { 36 - className: 'aphlict-connection-status-' + status, 37 - sigil: tip ? 'has-tooltip' : null, 38 - meta: tip ? {tip: tip, align: 'S', size: 300} : {} 30 + className: 'aphlict-connection-status-' + status 39 31 }, 40 32 pht(status)); 41 33