Skip to content

Commit 2f2126e

Browse files
author
Chad Little
committed
Add 'Persist Chat' option in Conpherence notification menu
Summary: This exposes the chat window to a larger audience beside people who accidentaly hit `\`. Test Plan: Lots of clicks and reloads. {F1856043} Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D16643
1 parent 5eb4bc6 commit 2f2126e

File tree

4 files changed

+75
-23
lines changed

4 files changed

+75
-23
lines changed

resources/celerity/map.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*/
88
return array(
99
'names' => array(
10-
'conpherence.pkg.css' => 'b1547973',
10+
'conpherence.pkg.css' => 'c8fbe125',
1111
'conpherence.pkg.js' => '11f3e07e',
1212
'core.pkg.css' => 'ade19c40',
13-
'core.pkg.js' => '975d6a27',
13+
'core.pkg.js' => '03c1cb09',
1414
'darkconsole.pkg.js' => 'e7393ebb',
1515
'differential.pkg.css' => 'e1d704ce',
1616
'differential.pkg.js' => '634399e9',
@@ -50,7 +50,7 @@
5050
'rsrc/css/application/conpherence/header-pane.css' => '517de9fe',
5151
'rsrc/css/application/conpherence/menu.css' => '78c7b811',
5252
'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02',
53-
'rsrc/css/application/conpherence/notification.css' => '6cdcc253',
53+
'rsrc/css/application/conpherence/notification.css' => '65dd0e79',
5454
'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56',
5555
'rsrc/css/application/conpherence/transaction.css' => '46253e19',
5656
'rsrc/css/application/conpherence/update.css' => '53bc527a',
@@ -438,7 +438,7 @@
438438
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
439439
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2',
440440
'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a',
441-
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'e287689f',
441+
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'a0e564c2',
442442
'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204',
443443
'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8',
444444
'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483',
@@ -622,7 +622,7 @@
622622
'conpherence-header-pane-css' => '517de9fe',
623623
'conpherence-menu-css' => '78c7b811',
624624
'conpherence-message-pane-css' => '0d7dff02',
625-
'conpherence-notification-css' => '6cdcc253',
625+
'conpherence-notification-css' => '65dd0e79',
626626
'conpherence-participant-pane-css' => '7bba0b56',
627627
'conpherence-thread-manager' => '01774ab2',
628628
'conpherence-transaction-css' => '46253e19',
@@ -699,7 +699,7 @@
699699
'javelin-behavior-diffusion-pull-lastmodified' => 'f01586dc',
700700
'javelin-behavior-doorkeeper-tag' => 'e5822781',
701701
'javelin-behavior-drydock-live-operation-status' => '901935ef',
702-
'javelin-behavior-durable-column' => 'e287689f',
702+
'javelin-behavior-durable-column' => 'a0e564c2',
703703
'javelin-behavior-editengine-reorder-configs' => 'd7a74243',
704704
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
705705
'javelin-behavior-error-log' => '6882e80a',
@@ -1774,6 +1774,16 @@
17741774
'javelin-util',
17751775
'phabricator-keyboard-shortcut',
17761776
),
1777+
'a0e564c2' => array(
1778+
'javelin-behavior',
1779+
'javelin-dom',
1780+
'javelin-stratcom',
1781+
'javelin-behavior-device',
1782+
'javelin-scrollbar',
1783+
'javelin-quicksand',
1784+
'phabricator-keyboard-shortcut',
1785+
'conpherence-thread-manager',
1786+
),
17771787
'a155550f' => array(
17781788
'javelin-install',
17791789
'javelin-dom',
@@ -2109,16 +2119,6 @@
21092119
'javelin-stratcom',
21102120
'javelin-dom',
21112121
),
2112-
'e287689f' => array(
2113-
'javelin-behavior',
2114-
'javelin-dom',
2115-
'javelin-stratcom',
2116-
'javelin-behavior-device',
2117-
'javelin-scrollbar',
2118-
'javelin-quicksand',
2119-
'phabricator-keyboard-shortcut',
2120-
'conpherence-thread-manager',
2121-
),
21222122
'e292eaf4' => array(
21232123
'javelin-install',
21242124
),

src/applications/conpherence/controller/ConpherenceNotificationPanelController.php

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,28 @@ public function handleRequest(AphrontRequest $request) {
7070
}
7171
$content = $view->render();
7272
} else {
73+
$rooms_uri = phutil_tag(
74+
'a',
75+
array(
76+
'href' => '/conpherence/',
77+
'class' => 'no-room-notification',
78+
),
79+
pht('You have joined no rooms.'));
80+
7381
$content = phutil_tag_div(
74-
'phabricator-notification no-notifications',
75-
pht('You have no messages.'));
82+
'phabricator-notification no-notifications', $rooms_uri);
7683
}
7784

7885
$content = hsprintf(
79-
'<div class="phabricator-notification-header">%s</div>'.
86+
'<div class="phabricator-notification-header grouped">%s%s</div>'.
8087
'%s',
8188
phutil_tag(
8289
'a',
8390
array(
8491
'href' => '/conpherence/',
8592
),
8693
pht('Rooms')),
94+
$this->renderPersistentOption(),
8795
$content);
8896

8997
$unread = id(new ConpherenceParticipantCountQuery())
@@ -100,4 +108,32 @@ public function handleRequest(AphrontRequest $request) {
100108
return id(new AphrontAjaxResponse())->setContent($json);
101109
}
102110

111+
private function renderPersistentOption() {
112+
$viewer = $this->getViewer();
113+
$column_key = PhabricatorConpherenceColumnVisibleSetting::SETTINGKEY;
114+
$show = (bool)$viewer->getUserSetting($column_key, false);
115+
116+
$view = phutil_tag(
117+
'div',
118+
array(
119+
'class' => 'persistent-option',
120+
),
121+
array(
122+
javelin_tag(
123+
'input',
124+
array(
125+
'type' => 'checkbox',
126+
'checked' => ($show) ? 'checked' : null,
127+
'value' => !$show,
128+
'sigil' => 'conpherence-persist-column',
129+
)),
130+
phutil_tag(
131+
'span',
132+
array(),
133+
pht('Persistent Chat')),
134+
));
135+
136+
return $view;
137+
}
138+
103139
}

webroot/rsrc/css/application/conpherence/notification.css

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
width: 30px;
2828
height: 30px;
2929
background-size: 100%;
30-
box-shadow: {$borderinset};
3130
border-radius: 3px;
3231
}
3332

@@ -71,3 +70,19 @@
7170
padding: 0 5px 1px;
7271
font-size: {$smallestfontsize};
7372
}
73+
74+
.phabricator-notification .no-room-notification {
75+
color: {$lightgreytext};
76+
display: block;
77+
}
78+
79+
.phabricator-notification-header .persistent-option {
80+
white-space: nowrap;
81+
float: right;
82+
}
83+
84+
.phabricator-notification-header .persistent-option span {
85+
margin-left: 4px;
86+
font-weight: normal;
87+
color: {$greytext};
88+
}

webroot/rsrc/js/application/conpherence/behavior-durable-column.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ JX.behavior('durable-column', function(config, statics) {
8989
JX.Stratcom.invoke('resize');
9090
}
9191

92-
new JX.KeyboardShortcut('\\', 'Toggle Conpherence Column')
93-
.setHandler(_toggleColumn)
94-
.register();
92+
JX.Stratcom.listen(
93+
'click',
94+
'conpherence-persist-column',
95+
_toggleColumn);
9596

9697
JX.Stratcom.listen(
9798
'click',

0 commit comments

Comments
 (0)