Approximately rough in persistent chat column very roughly
Summary:
Ref T7014. This is very rough and not hooked up to anything, but gets a couple of the layout pieces in place so we can (a) see that it looks like it'll kinda work; (b) look for problematic interactions and (c) you can fix my mangling of your design.
NOTE: Press "\" to toggle the column.
Test Plan:
Feels pretty good to me?
{F275722}
Reviewers: btrahan, chad
Reviewed By: chad
Subscribers: epriestley
Maniphest Tasks: T7014
Differential Revision: https://secure.phabricator.com/D11497
This commit is contained in:
@@ -1137,6 +1137,7 @@ phutil_register_library_map(array(
|
||||
'PHUICrumbsView' => 'view/phui/PHUICrumbsView.php',
|
||||
'PHUIDocumentExample' => 'applications/uiexample/examples/PHUIDocumentExample.php',
|
||||
'PHUIDocumentView' => 'view/phui/PHUIDocumentView.php',
|
||||
'PHUIDurableColumn' => 'view/phui/PHUIDurableColumn.php',
|
||||
'PHUIFeedStoryExample' => 'applications/uiexample/examples/PHUIFeedStoryExample.php',
|
||||
'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php',
|
||||
'PHUIFormDividerControl' => 'view/form/control/PHUIFormDividerControl.php',
|
||||
@@ -4315,6 +4316,7 @@ phutil_register_library_map(array(
|
||||
'PHUICrumbsView' => 'AphrontView',
|
||||
'PHUIDocumentExample' => 'PhabricatorUIExample',
|
||||
'PHUIDocumentView' => 'AphrontTagView',
|
||||
'PHUIDurableColumn' => 'AphrontTagView',
|
||||
'PHUIFeedStoryExample' => 'PhabricatorUIExample',
|
||||
'PHUIFeedStoryView' => 'AphrontView',
|
||||
'PHUIFormDividerControl' => 'AphrontFormControl',
|
||||
|
||||
@@ -16,6 +16,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||
private $pageObjects = array();
|
||||
private $applicationMenu;
|
||||
private $showFooter = true;
|
||||
private $showDurableColumn = true;
|
||||
|
||||
public function setShowFooter($show_footer) {
|
||||
$this->showFooter = $show_footer;
|
||||
@@ -73,6 +74,15 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||
}
|
||||
}
|
||||
|
||||
public function setShowDurableColumn($show) {
|
||||
$this->showDurableColumn = $show;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getShowDurableColumn() {
|
||||
return $this->showDurableColumn;
|
||||
}
|
||||
|
||||
public function getTitle() {
|
||||
$use_glyph = true;
|
||||
|
||||
@@ -364,6 +374,11 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||
)),
|
||||
));
|
||||
|
||||
$durable_column = null;
|
||||
if ($this->getShowDurableColumn()) {
|
||||
$durable_column = new PHUIDurableColumn();
|
||||
}
|
||||
|
||||
return phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
@@ -371,6 +386,7 @@ final class PhabricatorStandardPageView extends PhabricatorBarePageView {
|
||||
),
|
||||
array(
|
||||
$main_page,
|
||||
$durable_column,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
106
src/view/phui/PHUIDurableColumn.php
Normal file
106
src/view/phui/PHUIDurableColumn.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
final class PHUIDurableColumn extends AphrontTagView {
|
||||
|
||||
protected function getTagAttributes() {
|
||||
return array(
|
||||
'id' => 'durable-column',
|
||||
'class' => 'phui-durable-column',
|
||||
);
|
||||
}
|
||||
|
||||
protected function getTagContent() {
|
||||
Javelin::initBehavior('durable-column');
|
||||
|
||||
$classes = array();
|
||||
$classes[] = 'phui-durable-column-header';
|
||||
$classes[] = 'sprite-main-header';
|
||||
$classes[] = 'main-header-'.PhabricatorEnv::getEnvConfig('ui.header-color');
|
||||
|
||||
$header = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => implode(' ', $classes),
|
||||
),
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-header-text',
|
||||
),
|
||||
pht('Column Prototype')));
|
||||
|
||||
$icon_bar = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-icon-bar',
|
||||
),
|
||||
null); // <-- TODO: Icon buttons go here.
|
||||
|
||||
$copy = pht(
|
||||
'This is a very early prototype of a persistent column. It is not '.
|
||||
'expected to work yet, and leaving it open will activate other new '.
|
||||
'features which will break things. Press "\\" (backslash) on your '.
|
||||
'keyboard to close it now.');
|
||||
|
||||
$content = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-main',
|
||||
),
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'id' => 'phui-durable-column-content',
|
||||
'class' => 'phui-durable-column-frame',
|
||||
),
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-content',
|
||||
),
|
||||
$copy)));
|
||||
|
||||
$input = phutil_tag(
|
||||
'textarea',
|
||||
array(
|
||||
'class' => 'phui-durable-column-textarea',
|
||||
'placeholder' => pht('Box for text...'),
|
||||
));
|
||||
|
||||
$footer = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-footer',
|
||||
),
|
||||
array(
|
||||
phutil_tag(
|
||||
'button',
|
||||
array(
|
||||
'class' => 'grey',
|
||||
),
|
||||
pht('Send')),
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-status',
|
||||
),
|
||||
pht('Status Text')),
|
||||
));
|
||||
|
||||
return array(
|
||||
$header,
|
||||
phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'phui-durable-column-body',
|
||||
),
|
||||
array(
|
||||
$icon_bar,
|
||||
$content,
|
||||
$input,
|
||||
$footer,
|
||||
)),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user