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

Show a count (like "(3)") in the page title corresponding to unread notifications/messages

Summary: Fixes T5368. Synchronizes the page title to reflect unread counts in the notification and Conphernece messages menus.

Test Plan: {F201083}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5368

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

+70 -12
+18 -12
resources/celerity/map.php
··· 8 8 return array( 9 9 'names' => array( 10 10 'core.pkg.css' => '974635bb', 11 - 'core.pkg.js' => 'f0e2c091', 11 + 'core.pkg.js' => 'cbdbd552', 12 12 'darkconsole.pkg.js' => 'df001cab', 13 13 'differential.pkg.css' => '36884139', 14 14 'differential.pkg.js' => '73337d1d', ··· 348 348 'rsrc/image/texture/table_header_hover.png' => '038ec3b9', 349 349 'rsrc/image/texture/table_header_tall.png' => 'd56b434f', 350 350 'rsrc/js/application/aphlict/Aphlict.js' => '4a07e8e3', 351 - 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'f51afce0', 351 + 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => '7d4cc76c', 352 352 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'a826c925', 353 353 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '58f7803f', 354 354 'rsrc/js/application/auth/behavior-persona-login.js' => '9414ff18', ··· 448 448 'rsrc/js/core/Prefab.js' => 'bbae734c', 449 449 'rsrc/js/core/ShapedRequest.js' => '7cbe244b', 450 450 'rsrc/js/core/TextAreaUtils.js' => '5c93c52c', 451 + 'rsrc/js/core/Title.js' => '5c1c758c', 451 452 'rsrc/js/core/ToolTip.js' => '3915d490', 452 453 'rsrc/js/core/behavior-active-nav.js' => 'e379b58e', 453 454 'rsrc/js/core/behavior-audio-source.js' => '59b251eb', ··· 542 543 'inline-comment-summary-css' => '8cfd34e8', 543 544 'javelin-aphlict' => '4a07e8e3', 544 545 'javelin-behavior' => '61cbc29a', 545 - 'javelin-behavior-aphlict-dropdown' => 'f51afce0', 546 + 'javelin-behavior-aphlict-dropdown' => '7d4cc76c', 546 547 'javelin-behavior-aphlict-listen' => 'a826c925', 547 548 'javelin-behavior-aphlict-status' => '58f7803f', 548 549 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', ··· 740 741 'phabricator-source-code-view-css' => '7d346aa4', 741 742 'phabricator-standard-page-view' => '517cdfb1', 742 743 'phabricator-textareautils' => '5c93c52c', 744 + 'phabricator-title' => '5c1c758c', 743 745 'phabricator-tooltip' => '3915d490', 744 746 'phabricator-transaction-view-css' => '5d0cae25', 745 747 'phabricator-ui-example-css' => '528b19de', ··· 1190 1192 'javelin-behavior', 1191 1193 'javelin-stratcom', 1192 1194 ), 1195 + '5c1c758c' => array( 1196 + 'javelin-install', 1197 + ), 1193 1198 '5c54cbf3' => array( 1194 1199 'javelin-behavior', 1195 1200 'javelin-stratcom', ··· 1328 1333 'javelin-request', 1329 1334 'javelin-router', 1330 1335 ), 1336 + '7d4cc76c' => array( 1337 + 'javelin-behavior', 1338 + 'javelin-request', 1339 + 'javelin-stratcom', 1340 + 'javelin-vector', 1341 + 'javelin-dom', 1342 + 'javelin-uri', 1343 + 'javelin-behavior-device', 1344 + 'phabricator-title', 1345 + ), 1331 1346 '7e41274a' => array( 1332 1347 'javelin-install', 1333 1348 ), ··· 1858 1873 'phuix-action-list-view', 1859 1874 'phuix-action-view', 1860 1875 'javelin-workflow', 1861 - ), 1862 - 'f51afce0' => array( 1863 - 'javelin-behavior', 1864 - 'javelin-request', 1865 - 'javelin-stratcom', 1866 - 'javelin-vector', 1867 - 'javelin-dom', 1868 - 'javelin-uri', 1869 - 'javelin-behavior-device', 1870 1876 ), 1871 1877 'f588412e' => array( 1872 1878 'javelin-behavior',
+4
src/view/page/menu/PhabricatorMainMenuView.php
··· 349 349 'dropdownID' => $message_dropdown_id, 350 350 'loadingText' => pht('Loading...'), 351 351 'uri' => '/conpherence/panel/', 352 + 'countType' => 'messages', 353 + 'countNumber' => $message_count_number, 352 354 )); 353 355 354 356 $message_notification_dropdown = javelin_tag( ··· 428 430 'dropdownID' => $dropdown_id, 429 431 'loadingText' => pht('Loading...'), 430 432 'uri' => '/notification/panel/', 433 + 'countType' => 'notifications', 434 + 'countNumber' => $count_number, 431 435 )); 432 436 433 437 $notification_dropdown = javelin_tag(
+5
webroot/rsrc/js/application/aphlict/behavior-aphlict-dropdown.js
··· 7 7 * javelin-dom 8 8 * javelin-uri 9 9 * javelin-behavior-device 10 + * phabricator-title 10 11 */ 11 12 12 13 JX.behavior('aphlict-dropdown', function(config, statics) { ··· 23 24 24 25 var request = null; 25 26 var dirty = config.local ? false : true; 27 + 28 + JX.Title.setCount(config.countType, config.countNumber); 26 29 27 30 function refresh() { 28 31 if (dirty) { ··· 38 41 } 39 42 40 43 request = new JX.Request(config.uri, function(response) { 44 + JX.Title.setCount(config.countType, response.number); 45 + 41 46 var display = (response.number > 999) ? '\u221E' : response.number; 42 47 43 48 JX.DOM.setContent(count, display);
+43
webroot/rsrc/js/core/Title.js
··· 1 + /** 2 + * @requires javelin-install 3 + * @provides phabricator-title 4 + * @javelin 5 + */ 6 + 7 + /** 8 + * Update the document title to show a notification/message count. 9 + */ 10 + JX.install('Title', { 11 + statics: { 12 + _counts: {}, 13 + _title: null, 14 + 15 + setCount: function(k, v) { 16 + var self = JX.Title; 17 + self._counts[k] = v; 18 + self._update(); 19 + }, 20 + 21 + _update: function() { 22 + var self = JX.Title; 23 + 24 + if (self._title === null) { 25 + self._title = document.title; 26 + } 27 + 28 + var sum = 0; 29 + for (var k in self._counts) { 30 + sum += parseInt(self._counts[k], 10) || 0; 31 + } 32 + 33 + var title; 34 + if (sum) { 35 + title = '(' + sum + ') ' + self._title; 36 + } else { 37 + title = self._title; 38 + } 39 + 40 + document.title = title; 41 + } 42 + } 43 + });