diff --git a/resources/celerity/map.php b/resources/celerity/map.php index d2953c72dd..6666b7b5a0 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -376,7 +376,7 @@ return array( 'rsrc/js/application/aphlict/behavior-aphlict-dropdown.js' => 'caade6f2', 'rsrc/js/application/aphlict/behavior-aphlict-listen.js' => 'fb20ac8d', 'rsrc/js/application/aphlict/behavior-aphlict-status.js' => '5e2634b9', - 'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'edd1ba66', + 'rsrc/js/application/aphlict/behavior-desktop-notifications-control.js' => 'd5a2d665', 'rsrc/js/application/calendar/behavior-day-view.js' => '4b3c4443', 'rsrc/js/application/calendar/behavior-event-all-day.js' => 'b41537c9', 'rsrc/js/application/calendar/behavior-month-view.js' => 'fe33e256', @@ -621,7 +621,7 @@ return array( 'javelin-behavior-dashboard-query-panel-select' => '453c5375', 'javelin-behavior-dashboard-tab-panel' => 'd4eecc63', 'javelin-behavior-day-view' => '4b3c4443', - 'javelin-behavior-desktop-notifications-control' => 'edd1ba66', + 'javelin-behavior-desktop-notifications-control' => 'd5a2d665', 'javelin-behavior-detect-timezone' => '4c193c96', 'javelin-behavior-device' => 'bb1dd507', 'javelin-behavior-diff-preview-link' => '051c7832', @@ -2060,6 +2060,13 @@ return array( 'javelin-dom', 'javelin-stratcom', ), + 'd5a2d665' => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-dom', + 'javelin-uri', + 'phabricator-notification', + ), 'd6a7e717' => array( 'multirow-row-manager', 'javelin-install', @@ -2154,13 +2161,6 @@ return array( 'javelin-dom', 'phabricator-draggable-list', ), - 'edd1ba66' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-dom', - 'javelin-uri', - 'phabricator-notification', - ), 'edf8a145' => array( 'javelin-behavior', 'javelin-uri', diff --git a/src/applications/settings/panel/PhabricatorDesktopNotificationsSettingsPanel.php b/src/applications/settings/panel/PhabricatorDesktopNotificationsSettingsPanel.php index e987fed4ab..c08a833f1b 100644 --- a/src/applications/settings/panel/PhabricatorDesktopNotificationsSettingsPanel.php +++ b/src/applications/settings/panel/PhabricatorDesktopNotificationsSettingsPanel.php @@ -88,15 +88,25 @@ final class PhabricatorDesktopNotificationsSettingsPanel 'for this Phabricator instance. Consult your browser settings / '. 'documentation to figure out how to clear this setting, do so, '. 'and then re-visit this page to grant permission.')); + + $message_id = celerity_generate_unique_node_id(); + + $message_container = phutil_tag( + 'span', + array( + 'id' => $message_id, + )); + $status_box = id(new PHUIInfoView()) ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) ->setID($status_id) ->setIsHidden(true) - ->appendChild($accept_ask); + ->appendChild($message_container); $control_config = array( 'controlID' => $control_id, 'statusID' => $status_id, + 'messageID' => $message_id, 'browserStatusID' => $browser_status_id, 'defaultMode' => 0, 'desktopMode' => 1, diff --git a/webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js b/webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js index d3cedc8615..3a9b028ca3 100644 --- a/webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js +++ b/webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js @@ -19,22 +19,26 @@ JX.behavior('desktop-notifications-control', function(config, statics) { return el; } function updateFormStatus(permission) { - var statusEl = findEl(config.statusID); - if (!statusEl) { + var status_node = findEl(config.statusID); + if (!status_node) { return; } + + var message_node = JX.$(config.messageID); + switch (permission) { case 'default': - JX.DOM.setContent(statusEl.firstChild, config.cancelAsk); + JX.DOM.setContent(message_node, config.cancelAsk); break; case 'granted': - JX.DOM.setContent(statusEl.firstChild, config.grantedAsk); + JX.DOM.setContent(message_node, config.grantedAsk); break; case 'denied': - JX.DOM.setContent(statusEl.firstChild, config.deniedAsk); + JX.DOM.setContent(message_node, config.deniedAsk); break; } - JX.DOM.show(statusEl); + + JX.DOM.show(status_node); } function updateBrowserStatus(permission) {