Page MenuHomePhabricator

D16697.id40201.diff
No OneTemporary

D16697.id40201.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -7,9 +7,9 @@
*/
return array(
'names' => array(
- 'conpherence.pkg.css' => '4601645d',
+ 'conpherence.pkg.css' => 'b7cdd201',
'conpherence.pkg.js' => '11f3e07e',
- 'core.pkg.css' => '7ca260a3',
+ 'core.pkg.css' => 'd2b0af44',
'core.pkg.js' => '30185d95',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'e1d704ce',
@@ -47,9 +47,9 @@
'rsrc/css/application/config/setup-issue.css' => 'f794cfc3',
'rsrc/css/application/config/unhandled-exception.css' => '4c96257a',
'rsrc/css/application/conpherence/durable-column.css' => '44bcaa19',
- 'rsrc/css/application/conpherence/header-pane.css' => '20a7028c',
+ 'rsrc/css/application/conpherence/header-pane.css' => 'e8acbd37',
'rsrc/css/application/conpherence/menu.css' => '4f51db5a',
- 'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02',
+ 'rsrc/css/application/conpherence/message-pane.css' => '101e229f',
'rsrc/css/application/conpherence/notification.css' => '965db05b',
'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56',
'rsrc/css/application/conpherence/transaction.css' => '46253e19',
@@ -110,7 +110,7 @@
'rsrc/css/core/core.css' => 'd0801452',
'rsrc/css/core/remarkup.css' => 'cd912f2c',
'rsrc/css/core/syntax.css' => '769d3498',
- 'rsrc/css/core/z-index.css' => '0d4e5558',
+ 'rsrc/css/core/z-index.css' => 'de762ae0',
'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa',
'rsrc/css/font/font-aleo.css' => '8bdb2835',
'rsrc/css/font/font-awesome.css' => '2b7ebbcc',
@@ -144,7 +144,7 @@
'rsrc/css/phui/phui-header-view.css' => '06385974',
'rsrc/css/phui/phui-hovercard.css' => 'de1a2119',
'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad',
- 'rsrc/css/phui/phui-icon.css' => '9bab6f02',
+ 'rsrc/css/phui/phui-icon.css' => '417f80fb',
'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c',
'rsrc/css/phui/phui-info-panel.css' => '27ea50a1',
'rsrc/css/phui/phui-info-view.css' => '28efab79',
@@ -437,6 +437,7 @@
'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f',
'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408',
'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2',
+ 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '5a2f22ef',
'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a',
'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c5238acb',
'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204',
@@ -618,9 +619,9 @@
'config-options-css' => '0ede4c9b',
'config-page-css' => '8798e14f',
'conpherence-durable-column-view' => '44bcaa19',
- 'conpherence-header-pane-css' => '20a7028c',
+ 'conpherence-header-pane-css' => 'e8acbd37',
'conpherence-menu-css' => '4f51db5a',
- 'conpherence-message-pane-css' => '0d7dff02',
+ 'conpherence-message-pane-css' => '101e229f',
'conpherence-notification-css' => '965db05b',
'conpherence-participant-pane-css' => '7bba0b56',
'conpherence-thread-manager' => '01774ab2',
@@ -669,6 +670,7 @@
'javelin-behavior-conpherence-menu' => '9eb55204',
'javelin-behavior-conpherence-participant-pane' => '8604caa8',
'javelin-behavior-conpherence-pontificate' => 'f2e58483',
+ 'javelin-behavior-conpherence-search' => '5a2f22ef',
'javelin-behavior-countdown-timer' => 'e4cc26b3',
'javelin-behavior-dark-console' => 'f411b6ae',
'javelin-behavior-dashboard-async-panel' => '469c0d9e',
@@ -882,7 +884,7 @@
'phabricator-uiexample-reactor-select' => 'a155550f',
'phabricator-uiexample-reactor-sendclass' => '1def2711',
'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee',
- 'phabricator-zindex-css' => '0d4e5558',
+ 'phabricator-zindex-css' => 'de762ae0',
'phame-css' => '8efb0729',
'pholio-css' => 'ca89d380',
'pholio-edit-css' => '07676f51',
@@ -919,7 +921,7 @@
'phui-hovercard' => '1bd28176',
'phui-hovercard-view-css' => 'de1a2119',
'phui-icon-set-selector-css' => '1ab67aad',
- 'phui-icon-view-css' => '9bab6f02',
+ 'phui-icon-view-css' => '417f80fb',
'phui-image-mask-css' => 'a8498f9c',
'phui-info-panel-css' => '27ea50a1',
'phui-info-view-css' => '28efab79',
@@ -1417,6 +1419,13 @@
'javelin-vector',
'javelin-magical-init',
),
+ '5a2f22ef' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-util',
+ 'javelin-workflow',
+ 'javelin-stratcom',
+ ),
'5c54cbf3' => array(
'javelin-behavior',
'javelin-stratcom',
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -320,6 +320,7 @@
'ConpherenceThreadMembersPolicyRule' => 'applications/conpherence/policyrule/ConpherenceThreadMembersPolicyRule.php',
'ConpherenceThreadQuery' => 'applications/conpherence/query/ConpherenceThreadQuery.php',
'ConpherenceThreadRemarkupRule' => 'applications/conpherence/remarkup/ConpherenceThreadRemarkupRule.php',
+ 'ConpherenceThreadSearchController' => 'applications/conpherence/controller/ConpherenceThreadSearchController.php',
'ConpherenceThreadSearchEngine' => 'applications/conpherence/query/ConpherenceThreadSearchEngine.php',
'ConpherenceThreadTitleNgrams' => 'applications/conpherence/storage/ConpherenceThreadTitleNgrams.php',
'ConpherenceTransaction' => 'applications/conpherence/storage/ConpherenceTransaction.php',
@@ -4825,6 +4826,7 @@
'ConpherenceThreadMembersPolicyRule' => 'PhabricatorPolicyRule',
'ConpherenceThreadQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
'ConpherenceThreadRemarkupRule' => 'PhabricatorObjectRemarkupRule',
+ 'ConpherenceThreadSearchController' => 'ConpherenceController',
'ConpherenceThreadSearchEngine' => 'PhabricatorApplicationSearchEngine',
'ConpherenceThreadTitleNgrams' => 'PhabricatorSearchNgrams',
'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',
diff --git a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
--- a/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
+++ b/src/applications/conpherence/application/PhabricatorConpherenceApplication.php
@@ -37,6 +37,8 @@
=> 'ConpherenceListController',
'thread/(?P<id>[1-9]\d*)/'
=> 'ConpherenceListController',
+ 'threadsearch/(?P<id>[1-9]\d*)/'
+ => 'ConpherenceThreadSearchController',
'(?P<id>[1-9]\d*)/'
=> 'ConpherenceViewController',
'(?P<id>[1-9]\d*)/(?P<messageID>[1-9]\d*)/'
diff --git a/src/applications/conpherence/controller/ConpherenceController.php b/src/applications/conpherence/controller/ConpherenceController.php
--- a/src/applications/conpherence/controller/ConpherenceController.php
+++ b/src/applications/conpherence/controller/ConpherenceController.php
@@ -113,6 +113,20 @@
->setHref('#')
->addClass('conpherence-participant-toggle'));
+ Javelin::initBehavior(
+ 'conpherence-search',
+ array(
+ 'searchURI' => '/conpherence/threadsearch/'.$conpherence->getID().'/',
+ ));
+
+ $header->addActionItem(
+ id(new PHUIIconCircleView())
+ ->addSigil('conpherence-search-toggle')
+ ->setIcon('fa-search')
+ ->setHref('#')
+ ->setColor('green')
+ ->addClass('conpherence-search-toggle'));
+
if ($can_join && !$participating) {
$action = ConpherenceUpdateActions::JOIN_ROOM;
$uri = $this->getApplicationURI('update/'.$conpherence->getID().'/');
diff --git a/src/applications/conpherence/controller/ConpherenceThreadSearchController.php b/src/applications/conpherence/controller/ConpherenceThreadSearchController.php
new file mode 100644
--- /dev/null
+++ b/src/applications/conpherence/controller/ConpherenceThreadSearchController.php
@@ -0,0 +1,47 @@
+<?php
+
+final class ConpherenceThreadSearchController
+ extends ConpherenceController {
+
+ public function shouldAllowPublic() {
+ return true;
+ }
+
+ public function handleRequest(AphrontRequest $request) {
+ $viewer = $request->getViewer();
+ $conpherence_id = $request->getURIData('id');
+ $fulltext = $request->getStr('fulltext');
+
+ if (!$conpherence_id) {
+ return new Aphront404Response();
+ }
+
+ $map = array(
+ 'fulltext' => $fulltext,
+ 'ids' => array($conpherence_id),
+ );
+
+ $engine = new ConpherenceThreadSearchEngine();
+ $engine->setViewer($viewer);
+ $saved = $engine->buildSavedQueryFromBuiltin('all')
+ ->setParameter('ids', array($conpherence_id))
+ ->setParameter('fulltext', $fulltext);
+
+ $pager = $engine->newPagerForSavedQuery($saved);
+ $pager->setPageSize(15);
+
+ $query = $engine->buildQueryFromSavedQuery($saved);
+
+ $results = $engine->executeQuery($query, $pager);
+ $view = $engine->renderResults($results, $saved);
+
+ if ($view) {
+ $view = $view->getObjectList();
+ } else {
+ $view = pht('No Results Found.');
+ }
+
+ return id(new AphrontAjaxResponse())
+ ->setContent('cat');
+ }
+}
diff --git a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
--- a/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
+++ b/src/applications/conpherence/query/ConpherenceThreadSearchEngine.php
@@ -55,6 +55,9 @@
if ($map['phids']) {
$query->withPHIDs($map['phids']);
}
+ if ($map['ids']) {
+ $query->withIDs($map['ids']);
+ }
return $query;
}
diff --git a/src/applications/conpherence/view/ConpherenceLayoutView.php b/src/applications/conpherence/view/ConpherenceLayoutView.php
--- a/src/applications/conpherence/view/ConpherenceLayoutView.php
+++ b/src/applications/conpherence/view/ConpherenceLayoutView.php
@@ -184,6 +184,14 @@
'sigil' => 'conpherence-messages',
),
nonempty($this->messages, '')),
+ javelin_tag(
+ 'div',
+ array(
+ 'class' => 'conpherence-search-main',
+ 'id' => 'conpherence-search-main',
+ 'sigil' => 'conpherence-search-main',
+ ),
+ $this->buildSearchForm()),
phutil_tag(
'div',
array(
@@ -253,4 +261,52 @@
}
}
+ private function buildSearchForm() {
+ $viewer = $this->getViewer();
+ $thread = $this->thread;
+
+ $bar = javelin_tag(
+ 'input',
+ array(
+ 'type' => 'text',
+ 'id' => 'conpherence-search-input',
+ 'name' => 'fulltext',
+ 'class' => 'conpherence-search-input',
+ 'sigil' => 'conpherence-search-input',
+ 'placeholder' => pht('Search thread...'),
+ ));
+
+ $id = $thread->getID();
+ $form = phabricator_form(
+ $this->getUser(),
+ array(
+ 'method' => 'POST',
+ 'action' => '/conpherence/threadsearch/'.$id.'/',
+ 'sigil' => 'conpherence-search-form',
+ 'class' => 'conpherence-search-form',
+ ),
+ array(
+ $bar,
+ ));
+
+ $results = phutil_tag(
+ 'div',
+ array(
+ 'id' => 'conpherence-search-results',
+ 'class' => 'conpherence-search-results',
+ ));
+
+ $view = phutil_tag(
+ 'div',
+ array(
+ 'class' => 'conpherence-search-window',
+ ),
+ array(
+ $form,
+ $results,
+ ));
+
+ return $view;
+ }
+
}
diff --git a/webroot/rsrc/css/application/conpherence/header-pane.css b/webroot/rsrc/css/application/conpherence/header-pane.css
--- a/webroot/rsrc/css/application/conpherence/header-pane.css
+++ b/webroot/rsrc/css/application/conpherence/header-pane.css
@@ -66,7 +66,17 @@
}
.conpherence-participant-toggle.phui-icon-circle .phui-icon-view {
- color: {$sky};
+ color: {$sky};
+}
+
+.show-searchbar .conpherence-search-toggle.phui-icon-circle {
+ text-decoration: none;
+ border-color: {$green};
+ cursor: pointer;
+}
+
+.show-searchbar .conpherence-search-toggle.phui-icon-circle .phui-icon-view {
+ color: {$green};
}
.hide-widgets .conpherence-participant-toggle.phui-icon-circle {
@@ -76,5 +86,5 @@
}
.hide-widgets .conpherence-participant-toggle.phui-icon-circle .phui-icon-view {
- color: {$lightblueborder};
+ color: {$lightblueborder};
}
diff --git a/webroot/rsrc/css/application/conpherence/message-pane.css b/webroot/rsrc/css/application/conpherence/message-pane.css
--- a/webroot/rsrc/css/application/conpherence/message-pane.css
+++ b/webroot/rsrc/css/application/conpherence/message-pane.css
@@ -400,3 +400,39 @@
margin-top: 0;
margin-bottom: 0;
}
+
+/***** Thread Search **********************************************************/
+
+.conpherence-search-main {
+ display: none;
+}
+
+.show-searchbar .conpherence-search-main {
+ display: block;
+}
+
+.show-searchbar .conpherence-search-form {
+ display: block;
+ height: 44px;
+ background: {$lightbluebackground};
+ position: absolute;
+ top: 1px;
+ left: 0;
+ right: 0;
+ padding: 12px 16px 0;
+}
+
+input.conpherence-search-input {
+ padding-left: 8px;
+ width: 100%;
+ border-radius: 20px;
+}
+
+.conpherence-search-results {
+ position: absolute;
+ background: #fff;
+ top: 54px;
+ left: 0;
+ right: 0;
+ bottom: 0;
+}
diff --git a/webroot/rsrc/css/core/z-index.css b/webroot/rsrc/css/core/z-index.css
--- a/webroot/rsrc/css/core/z-index.css
+++ b/webroot/rsrc/css/core/z-index.css
@@ -68,8 +68,7 @@
z-index: 4;
}
-.loading .messages-loading-mask,
-.loading .widgets-loading-mask {
+.conpherence-menu-pane .conpherence-search-main {
z-index: 5;
}
@@ -89,6 +88,11 @@
z-index: 6;
}
+.loading .messages-loading-mask,
+.loading .widgets-loading-mask {
+ z-index: 6;
+}
+
.conpherence-durable-column {
z-index: 7;
}
diff --git a/webroot/rsrc/css/phui/phui-icon.css b/webroot/rsrc/css/phui/phui-icon.css
--- a/webroot/rsrc/css/phui/phui-icon.css
+++ b/webroot/rsrc/css/phui/phui-icon.css
@@ -101,6 +101,16 @@
color: {$pink};
}
+a.phui-icon-circle.hover-green:hover {
+ text-decoration: none;
+ border-color: {$green};
+ cursor: pointer;
+}
+
+a.phui-icon-circle.hover-green:hover .phui-icon-view {
+ color: {$green};
+}
+
/* - Icon in a Square ------------------------------------------------------- */
.phui-icon-view.phui-icon-square {
diff --git a/webroot/rsrc/js/application/conpherence/behavior-conpherence-search.js b/webroot/rsrc/js/application/conpherence/behavior-conpherence-search.js
new file mode 100644
--- /dev/null
+++ b/webroot/rsrc/js/application/conpherence/behavior-conpherence-search.js
@@ -0,0 +1,54 @@
+/**
+ * @provides javelin-behavior-conpherence-search
+ * @requires javelin-behavior
+ * javelin-dom
+ * javelin-util
+ * javelin-workflow
+ * javelin-stratcom
+ */
+
+JX.behavior('conpherence-search', function(config) {
+
+ var shown = true;
+
+ function _toggleSearch(e) {
+ e.kill();
+ var node = JX.$('conpherence-main-layout');
+ shown = !shown;
+ JX.DOM.alterClass(node, 'show-searchbar', !shown);
+ JX.Stratcom.invoke('resize');
+ }
+
+ function _doSearch(e) {
+ e.kill();
+ var fulltext = JX.$('conpherence-search-input').value;
+ var search_node = JX.$('conpherence-search-results');
+ var search_data = new JX.Request(config.searchURI)
+ .setData({value: (fulltext)})
+ .send();
+
+ JX.DOM.setContent(search_node, search_data);
+ }
+
+ JX.Stratcom.listen(
+ ['submit', 'didSyntheticSubmit'],
+ 'conpherence-search-input',
+ _doSearch);
+
+ JX.Stratcom.listen(
+ 'keydown',
+ 'conpherence-search-input',
+ function(e) {
+ if (e.getSpecialKey() != 'return') {
+ return;
+ }
+ e.kill();
+ _doSearch(e);
+ });
+
+ JX.Stratcom.listen(
+ 'click',
+ 'conpherence-search-toggle',
+ _toggleSearch);
+
+});

File Metadata

Mime Type
text/plain
Expires
Mon, Oct 21, 5:18 PM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6739735
Default Alt Text
D16697.id40201.diff (16 KB)

Event Timeline