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

Basic Conpherence Search in Thread

Summary: Adds a search bar toggle and results for searching inside a Conpherence Room. The UI of the results itself are not styled yet, and will follow up with another diff.

Test Plan: Go to Conpherence, search for "asdf", get lots of results. Search for nothing, get no change, search for something fictitious, get no threads found (will follow up with search result UI).

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

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

+340 -93
+36 -30
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'conpherence.pkg.css' => '4601645d', 11 - 'conpherence.pkg.js' => '44dd69f5', 12 - 'core.pkg.css' => '7ca260a3', 10 + 'conpherence.pkg.css' => 'c839a862', 11 + 'conpherence.pkg.js' => 'b18c9dc5', 12 + 'core.pkg.css' => 'b99bbf5e', 13 13 'core.pkg.js' => '30185d95', 14 14 'darkconsole.pkg.js' => 'e7393ebb', 15 15 'differential.pkg.css' => 'e1d704ce', ··· 47 47 'rsrc/css/application/config/setup-issue.css' => 'f794cfc3', 48 48 'rsrc/css/application/config/unhandled-exception.css' => '4c96257a', 49 49 'rsrc/css/application/conpherence/durable-column.css' => '44bcaa19', 50 - 'rsrc/css/application/conpherence/header-pane.css' => '20a7028c', 50 + 'rsrc/css/application/conpherence/header-pane.css' => 'e8acbd37', 51 51 'rsrc/css/application/conpherence/menu.css' => '4f51db5a', 52 - 'rsrc/css/application/conpherence/message-pane.css' => '0d7dff02', 52 + 'rsrc/css/application/conpherence/message-pane.css' => 'eff20ae7', 53 53 'rsrc/css/application/conpherence/notification.css' => '965db05b', 54 54 'rsrc/css/application/conpherence/participant-pane.css' => '7bba0b56', 55 55 'rsrc/css/application/conpherence/transaction.css' => '46253e19', 56 - 'rsrc/css/application/conpherence/update.css' => '53bc527a', 57 56 'rsrc/css/application/contentsource/content-source-view.css' => '4b8b05d4', 58 57 'rsrc/css/application/countdown/timer.css' => '16c52f5c', 59 58 'rsrc/css/application/daemon/bulk-job.css' => 'df9c1d4a', ··· 110 109 'rsrc/css/core/core.css' => 'd0801452', 111 110 'rsrc/css/core/remarkup.css' => 'cd912f2c', 112 111 'rsrc/css/core/syntax.css' => '769d3498', 113 - 'rsrc/css/core/z-index.css' => '0d4e5558', 112 + 'rsrc/css/core/z-index.css' => 'd1270942', 114 113 'rsrc/css/diviner/diviner-shared.css' => 'aa3656aa', 115 114 'rsrc/css/font/font-aleo.css' => '8bdb2835', 116 115 'rsrc/css/font/font-awesome.css' => '2b7ebbcc', ··· 144 143 'rsrc/css/phui/phui-header-view.css' => '06385974', 145 144 'rsrc/css/phui/phui-hovercard.css' => 'de1a2119', 146 145 'rsrc/css/phui/phui-icon-set-selector.css' => '1ab67aad', 147 - 'rsrc/css/phui/phui-icon.css' => '9bab6f02', 146 + 'rsrc/css/phui/phui-icon.css' => '417f80fb', 148 147 'rsrc/css/phui/phui-image-mask.css' => 'a8498f9c', 149 148 'rsrc/css/phui/phui-info-panel.css' => '27ea50a1', 150 149 'rsrc/css/phui/phui-info-view.css' => '28efab79', ··· 437 436 'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f', 438 437 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 439 438 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2', 439 + 'rsrc/js/application/conpherence/behavior-conpherence-search.js' => '3bc9d2b1', 440 440 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c5238acb', 441 - 'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204', 441 + 'rsrc/js/application/conpherence/behavior-menu.js' => '0f82ba76', 442 442 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', 443 443 'rsrc/js/application/conpherence/behavior-pontificate.js' => 'f2e58483', 444 444 'rsrc/js/application/conpherence/behavior-quicksand-blacklist.js' => '7927a7d3', ··· 617 617 'config-options-css' => '0ede4c9b', 618 618 'config-page-css' => '8798e14f', 619 619 'conpherence-durable-column-view' => '44bcaa19', 620 - 'conpherence-header-pane-css' => '20a7028c', 620 + 'conpherence-header-pane-css' => 'e8acbd37', 621 621 'conpherence-menu-css' => '4f51db5a', 622 - 'conpherence-message-pane-css' => '0d7dff02', 622 + 'conpherence-message-pane-css' => 'eff20ae7', 623 623 'conpherence-notification-css' => '965db05b', 624 624 'conpherence-participant-pane-css' => '7bba0b56', 625 625 'conpherence-thread-manager' => '01774ab2', 626 626 'conpherence-transaction-css' => '46253e19', 627 - 'conpherence-update-css' => '53bc527a', 628 627 'd3' => 'a11a5ff2', 629 628 'differential-changeset-view-css' => '9ef7d354', 630 629 'differential-core-view-css' => '5b7b8ff4', ··· 664 663 'javelin-behavior-choose-control' => '327a00d1', 665 664 'javelin-behavior-comment-actions' => '0300eae6', 666 665 'javelin-behavior-config-reorder-fields' => 'b6993408', 667 - 'javelin-behavior-conpherence-menu' => '9eb55204', 666 + 'javelin-behavior-conpherence-menu' => '0f82ba76', 668 667 'javelin-behavior-conpherence-participant-pane' => '8604caa8', 669 668 'javelin-behavior-conpherence-pontificate' => 'f2e58483', 669 + 'javelin-behavior-conpherence-search' => '3bc9d2b1', 670 670 'javelin-behavior-countdown-timer' => 'e4cc26b3', 671 671 'javelin-behavior-dark-console' => 'f411b6ae', 672 672 'javelin-behavior-dashboard-async-panel' => '469c0d9e', ··· 880 880 'phabricator-uiexample-reactor-select' => 'a155550f', 881 881 'phabricator-uiexample-reactor-sendclass' => '1def2711', 882 882 'phabricator-uiexample-reactor-sendproperties' => 'b1f0ccee', 883 - 'phabricator-zindex-css' => '0d4e5558', 883 + 'phabricator-zindex-css' => 'd1270942', 884 884 'phame-css' => '8efb0729', 885 885 'pholio-css' => 'ca89d380', 886 886 'pholio-edit-css' => '07676f51', ··· 917 917 'phui-hovercard' => '1bd28176', 918 918 'phui-hovercard-view-css' => 'de1a2119', 919 919 'phui-icon-set-selector-css' => '1ab67aad', 920 - 'phui-icon-view-css' => '9bab6f02', 920 + 'phui-icon-view-css' => '417f80fb', 921 921 'phui-image-mask-css' => 'a8498f9c', 922 922 'phui-info-panel-css' => '27ea50a1', 923 923 'phui-info-view-css' => '28efab79', ··· 1072 1072 'javelin-install', 1073 1073 'javelin-util', 1074 1074 ), 1075 + '0f82ba76' => array( 1076 + 'javelin-behavior', 1077 + 'javelin-dom', 1078 + 'javelin-util', 1079 + 'javelin-stratcom', 1080 + 'javelin-workflow', 1081 + 'javelin-behavior-device', 1082 + 'javelin-history', 1083 + 'javelin-vector', 1084 + 'javelin-scrollbar', 1085 + 'phabricator-title', 1086 + 'phabricator-shaped-request', 1087 + 'conpherence-thread-manager', 1088 + ), 1075 1089 '116cf19b' => array( 1076 1090 'javelin-behavior', 1077 1091 'javelin-stratcom', ··· 1205 1219 'javelin-dom', 1206 1220 'javelin-magical-init', 1207 1221 ), 1222 + '3bc9d2b1' => array( 1223 + 'javelin-behavior', 1224 + 'javelin-dom', 1225 + 'javelin-util', 1226 + 'javelin-workflow', 1227 + 'javelin-stratcom', 1228 + ), 1208 1229 '3cb0b2fc' => array( 1209 1230 'javelin-behavior', 1210 1231 'javelin-dom', ··· 1745 1766 'javelin-workflow', 1746 1767 'javelin-stratcom', 1747 1768 ), 1748 - '9eb55204' => array( 1749 - 'javelin-behavior', 1750 - 'javelin-dom', 1751 - 'javelin-util', 1752 - 'javelin-stratcom', 1753 - 'javelin-workflow', 1754 - 'javelin-behavior-device', 1755 - 'javelin-history', 1756 - 'javelin-vector', 1757 - 'javelin-scrollbar', 1758 - 'phabricator-title', 1759 - 'phabricator-shaped-request', 1760 - 'conpherence-thread-manager', 1761 - ), 1762 1769 '9ef7d354' => array( 1763 1770 'phui-inline-comment-view-css', 1764 1771 ), ··· 2292 2299 'conpherence-message-pane-css', 2293 2300 'conpherence-notification-css', 2294 2301 'conpherence-transaction-css', 2295 - 'conpherence-update-css', 2296 2302 'conpherence-participant-pane-css', 2297 2303 'conpherence-header-pane-css', 2298 2304 ),
-1
resources/celerity/packages.php
··· 157 157 'conpherence-message-pane-css', 158 158 'conpherence-notification-css', 159 159 'conpherence-transaction-css', 160 - 'conpherence-update-css', 161 160 'conpherence-participant-pane-css', 162 161 'conpherence-header-pane-css', 163 162 ),
+2
src/__phutil_library_map__.php
··· 320 320 'ConpherenceThreadMembersPolicyRule' => 'applications/conpherence/policyrule/ConpherenceThreadMembersPolicyRule.php', 321 321 'ConpherenceThreadQuery' => 'applications/conpherence/query/ConpherenceThreadQuery.php', 322 322 'ConpherenceThreadRemarkupRule' => 'applications/conpherence/remarkup/ConpherenceThreadRemarkupRule.php', 323 + 'ConpherenceThreadSearchController' => 'applications/conpherence/controller/ConpherenceThreadSearchController.php', 323 324 'ConpherenceThreadSearchEngine' => 'applications/conpherence/query/ConpherenceThreadSearchEngine.php', 324 325 'ConpherenceThreadTitleNgrams' => 'applications/conpherence/storage/ConpherenceThreadTitleNgrams.php', 325 326 'ConpherenceTransaction' => 'applications/conpherence/storage/ConpherenceTransaction.php', ··· 4844 4845 'ConpherenceThreadMembersPolicyRule' => 'PhabricatorPolicyRule', 4845 4846 'ConpherenceThreadQuery' => 'PhabricatorCursorPagedPolicyAwareQuery', 4846 4847 'ConpherenceThreadRemarkupRule' => 'PhabricatorObjectRemarkupRule', 4848 + 'ConpherenceThreadSearchController' => 'ConpherenceController', 4847 4849 'ConpherenceThreadSearchEngine' => 'PhabricatorApplicationSearchEngine', 4848 4850 'ConpherenceThreadTitleNgrams' => 'PhabricatorSearchNgrams', 4849 4851 'ConpherenceTransaction' => 'PhabricatorApplicationTransaction',
+2
src/applications/conpherence/application/PhabricatorConpherenceApplication.php
··· 37 37 => 'ConpherenceListController', 38 38 'thread/(?P<id>[1-9]\d*)/' 39 39 => 'ConpherenceListController', 40 + 'threadsearch/(?P<id>[1-9]\d*)/' 41 + => 'ConpherenceThreadSearchController', 40 42 '(?P<id>[1-9]\d*)/' 41 43 => 'ConpherenceViewController', 42 44 '(?P<id>[1-9]\d*)/(?P<messageID>[1-9]\d*)/'
+70
src/applications/conpherence/controller/ConpherenceController.php
··· 113 113 ->setHref('#') 114 114 ->addClass('conpherence-participant-toggle')); 115 115 116 + Javelin::initBehavior( 117 + 'conpherence-search', 118 + array( 119 + 'searchURI' => '/conpherence/threadsearch/'.$conpherence->getID().'/', 120 + )); 121 + 122 + $header->addActionItem( 123 + id(new PHUIIconCircleView()) 124 + ->addSigil('conpherence-search-toggle') 125 + ->setIcon('fa-search') 126 + ->setHref('#') 127 + ->setColor('green') 128 + ->addClass('conpherence-search-toggle')); 129 + 116 130 if ($can_join && !$participating) { 117 131 $action = ConpherenceUpdateActions::JOIN_ROOM; 118 132 $uri = $this->getApplicationURI('update/'.$conpherence->getID().'/'); ··· 147 161 } 148 162 149 163 return $header; 164 + } 165 + 166 + public function buildSearchForm() { 167 + $viewer = $this->getViewer(); 168 + $conpherence = $this->conpherence; 169 + $name = $conpherence->getTitle(); 170 + 171 + $bar = javelin_tag( 172 + 'input', 173 + array( 174 + 'type' => 'text', 175 + 'id' => 'conpherence-search-input', 176 + 'name' => 'fulltext', 177 + 'class' => 'conpherence-search-input', 178 + 'sigil' => 'conpherence-search-input', 179 + 'placeholder' => pht('Search %s...', $name), 180 + )); 181 + 182 + $id = $conpherence->getID(); 183 + $form = phabricator_form( 184 + $viewer, 185 + array( 186 + 'method' => 'POST', 187 + 'action' => '/conpherence/threadsearch/'.$id.'/', 188 + 'sigil' => 'conpherence-search-form', 189 + 'class' => 'conpherence-search-form', 190 + ), 191 + array( 192 + $bar, 193 + )); 194 + 195 + $form_view = phutil_tag( 196 + 'div', 197 + array( 198 + 'class' => 'conpherence-search-form-view', 199 + ), 200 + $form); 201 + 202 + $results = phutil_tag( 203 + 'div', 204 + array( 205 + 'id' => 'conpherence-search-results', 206 + 'class' => 'conpherence-search-results', 207 + )); 208 + 209 + $view = phutil_tag( 210 + 'div', 211 + array( 212 + 'class' => 'conpherence-search-window', 213 + ), 214 + array( 215 + $form_view, 216 + $results, 217 + )); 218 + 219 + return $view; 150 220 } 151 221 152 222 }
+41
src/applications/conpherence/controller/ConpherenceThreadSearchController.php
··· 1 + <?php 2 + 3 + final class ConpherenceThreadSearchController 4 + extends ConpherenceController { 5 + 6 + public function shouldAllowPublic() { 7 + return true; 8 + } 9 + 10 + public function handleRequest(AphrontRequest $request) { 11 + $viewer = $request->getViewer(); 12 + $conpherence_id = $request->getURIData('id'); 13 + $fulltext = $request->getStr('fulltext'); 14 + 15 + $conpherence = id(new ConpherenceThreadQuery()) 16 + ->setViewer($viewer) 17 + ->withIDs(array($conpherence_id)) 18 + ->executeOne(); 19 + 20 + if (!$conpherence) { 21 + return new Aphront404Response(); 22 + } 23 + 24 + $engine = new ConpherenceThreadSearchEngine(); 25 + $engine->setViewer($viewer); 26 + $saved = $engine->buildSavedQueryFromBuiltin('all') 27 + ->setParameter('phids', array($conpherence->getPHID())) 28 + ->setParameter('fulltext', $fulltext); 29 + 30 + $pager = $engine->newPagerForSavedQuery($saved); 31 + $pager->setPageSize(15); 32 + 33 + $query = $engine->buildQueryFromSavedQuery($saved); 34 + 35 + $results = $engine->executeQuery($query, $pager); 36 + $view = $engine->renderResults($results, $saved); 37 + 38 + return id(new AphrontAjaxResponse()) 39 + ->setContent($view->getObjectList()); 40 + } 41 + }
-4
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 327 327 ->setUser($user) 328 328 ->setDatasource(new PhabricatorPeopleDatasource())); 329 329 330 - require_celerity_resource('conpherence-update-css'); 331 330 $view = id(new AphrontDialogView()) 332 331 ->setTitle(pht('Add Participants')) 333 332 ->addHiddenInput('action', 'add_person') ··· 407 406 } 408 407 } 409 408 410 - require_celerity_resource('conpherence-update-css'); 411 - 412 409 $dialog = id(new AphrontDialogView()) 413 410 ->setTitle($title) 414 411 ->addHiddenInput('action', 'remove_person') ··· 471 468 ->setCapability(PhabricatorPolicyCapability::CAN_JOIN) 472 469 ->setPolicies($policies)); 473 470 474 - require_celerity_resource('conpherence-update-css'); 475 471 $view = id(new AphrontDialogView()) 476 472 ->setTitle($title) 477 473 ->addHiddenInput('action', 'metadata')
+3
src/applications/conpherence/controller/ConpherenceViewController.php
··· 89 89 ->setObject($conpherence) 90 90 ->execute(); 91 91 $header = $this->buildHeaderPaneContent($conpherence, $policy_objects); 92 + $search = $this->buildSearchForm(); 92 93 $form = $this->renderFormContent(); 93 94 $content = array( 94 95 'header' => $header, 96 + 'search' => $search, 95 97 'transactions' => $messages, 96 98 'form' => $form, 97 99 ); ··· 128 130 ->setBaseURI($this->getApplicationURI()) 129 131 ->setThread($conpherence) 130 132 ->setHeader($header) 133 + ->setSearch($search) 131 134 ->setMessages($messages) 132 135 ->setReplyForm($form) 133 136 ->setLatestTransactionID($data['latest_transaction_id'])
+20
src/applications/conpherence/view/ConpherenceLayoutView.php
··· 7 7 private $threadView; 8 8 private $role; 9 9 private $header; 10 + private $search; 10 11 private $messages; 11 12 private $replyForm; 12 13 private $latestTransactionID; ··· 23 24 24 25 public function setHeader($header) { 25 26 $this->header = $header; 27 + return $this; 28 + } 29 + 30 + public function setSearch($search) { 31 + $this->search = $search; 26 32 return $this; 27 33 } 28 34 ··· 131 137 'class' => 'conpherence-content-pane', 132 138 ), 133 139 array( 140 + phutil_tag( 141 + 'div', 142 + array( 143 + 'class' => 'conpherence-loading-mask', 144 + ), 145 + ''), 134 146 javelin_tag( 135 147 'div', 136 148 array( ··· 184 196 'sigil' => 'conpherence-messages', 185 197 ), 186 198 nonempty($this->messages, '')), 199 + javelin_tag( 200 + 'div', 201 + array( 202 + 'class' => 'conpherence-search-main', 203 + 'id' => 'conpherence-search-main', 204 + 'sigil' => 'conpherence-search-main', 205 + ), 206 + nonempty($this->search, '')), 187 207 phutil_tag( 188 208 'div', 189 209 array(
+12 -2
webroot/rsrc/css/application/conpherence/header-pane.css
··· 66 66 } 67 67 68 68 .conpherence-participant-toggle.phui-icon-circle .phui-icon-view { 69 - color: {$sky}; 69 + color: {$sky}; 70 + } 71 + 72 + .show-searchbar .conpherence-search-toggle.phui-icon-circle { 73 + text-decoration: none; 74 + border-color: {$green}; 75 + cursor: pointer; 76 + } 77 + 78 + .show-searchbar .conpherence-search-toggle.phui-icon-circle .phui-icon-view { 79 + color: {$green}; 70 80 } 71 81 72 82 .hide-widgets .conpherence-participant-toggle.phui-icon-circle { ··· 76 86 } 77 87 78 88 .hide-widgets .conpherence-participant-toggle.phui-icon-circle .phui-icon-view { 79 - color: {$lightblueborder}; 89 + color: {$lightblueborder}; 80 90 }
+65
webroot/rsrc/css/application/conpherence/message-pane.css
··· 400 400 margin-top: 0; 401 401 margin-bottom: 0; 402 402 } 403 + 404 + /***** Thread Loading *********************************************************/ 405 + 406 + .conpherence-layout .conpherence-loading-mask { 407 + height: 0; 408 + opacity: 0; 409 + top: 0; 410 + right: 0; 411 + left: 240px; 412 + bottom: 0; 413 + transition: all 0.3s; 414 + position: fixed; 415 + background-color: #fff; 416 + } 417 + 418 + .conpherence-layout.loading .conpherence-loading-mask { 419 + opacity: 1; 420 + height: auto; 421 + } 422 + 423 + 424 + /***** Thread Search **********************************************************/ 425 + 426 + .conpherence-search-main { 427 + opacity: 0; 428 + transition: all 0.2s; 429 + position: absolute; 430 + top: 0; 431 + left: 0; 432 + right: 0; 433 + bottom: 0; 434 + height: 0; 435 + } 436 + 437 + .show-searchbar .conpherence-search-main { 438 + opacity: 1; 439 + height: auto; 440 + } 441 + 442 + .show-searchbar .conpherence-search-form-view { 443 + display: block; 444 + height: 54px; 445 + background: {$lightbluebackground}; 446 + position: absolute; 447 + top: 1px; 448 + left: 0; 449 + right: 0; 450 + } 451 + 452 + input.conpherence-search-input { 453 + padding-left: 8px; 454 + width: calc(100% - 24px); 455 + border-radius: 20px; 456 + margin: 12px; 457 + } 458 + 459 + .conpherence-search-results { 460 + position: absolute; 461 + background: #fff; 462 + top: 54px; 463 + left: 0; 464 + right: 0; 465 + bottom: 0; 466 + overflow-y: auto; 467 + }
-13
webroot/rsrc/css/application/conpherence/update.css
··· 1 - /** 2 - * @provides conpherence-update-css 3 - */ 4 - 5 - .aphront-dialog-view .conpherence-dialogue-drag-photo { 6 - border: 1px dashed #bfbfbf; 7 - padding: 10px 0px 10px 10px; 8 - } 9 - 10 - .aphront-dialog-view .conpherence-dialogue-upload-photo { 11 - background: {$lightgreen}; 12 - border-color: {$green}; 13 - }
+11 -3
webroot/rsrc/css/core/z-index.css
··· 68 68 z-index: 4; 69 69 } 70 70 71 - .loading .messages-loading-mask, 72 - .loading .widgets-loading-mask { 73 - z-index: 5; 71 + .conpherence-message-pane .conpherence-search-main { 72 + z-index: 4; 74 73 } 75 74 76 75 .dark-console { ··· 86 85 } 87 86 88 87 .aphront-developer-error-callout { 88 + z-index: 6; 89 + } 90 + 91 + .loading .messages-loading-mask, 92 + .loading .widgets-loading-mask { 89 93 z-index: 6; 90 94 } 91 95 ··· 152 156 153 157 .conpherence-participant-pane { 154 158 z-index: 25; 159 + } 160 + 161 + .conpherence-layout .conpherence-loading-mask { 162 + z-index: 30; 155 163 } 156 164 157 165 .phuix-dropdown-menu {
+10
webroot/rsrc/css/phui/phui-icon.css
··· 101 101 color: {$pink}; 102 102 } 103 103 104 + a.phui-icon-circle.hover-green:hover { 105 + text-decoration: none; 106 + border-color: {$green}; 107 + cursor: pointer; 108 + } 109 + 110 + a.phui-icon-circle.hover-green:hover .phui-icon-view { 111 + color: {$green}; 112 + } 113 + 104 114 /* - Icon in a Square ------------------------------------------------------- */ 105 115 106 116 .phui-icon-view.phui-icon-square {
+63
webroot/rsrc/js/application/conpherence/behavior-conpherence-search.js
··· 1 + /** 2 + * @provides javelin-behavior-conpherence-search 3 + * @requires javelin-behavior 4 + * javelin-dom 5 + * javelin-util 6 + * javelin-workflow 7 + * javelin-stratcom 8 + */ 9 + 10 + JX.behavior('conpherence-search', function(config) { 11 + 12 + var shown = true; 13 + var request = null; 14 + 15 + function _toggleSearch(e) { 16 + e.kill(); 17 + var node = JX.$('conpherence-main-layout'); 18 + 19 + shown = !shown; 20 + JX.DOM.alterClass(node, 'show-searchbar', !shown); 21 + JX.Stratcom.invoke('resize'); 22 + } 23 + 24 + function _doSearch(e) { 25 + e.kill(); 26 + var search_text = JX.$('conpherence-search-input').value; 27 + var search_node = JX.$('conpherence-search-results'); 28 + 29 + if (request || !search_text) { 30 + return; 31 + } 32 + 33 + request = new JX.Request(config.searchURI, function(response) { 34 + JX.DOM.setContent(search_node, JX.$H(response)); 35 + request = null; 36 + }); 37 + request.setData({fulltext: search_text}); 38 + request.send(); 39 + 40 + } 41 + 42 + JX.Stratcom.listen( 43 + ['submit', 'didSyntheticSubmit'], 44 + 'conpherence-search-input', 45 + _doSearch); 46 + 47 + JX.Stratcom.listen( 48 + 'keydown', 49 + 'conpherence-search-input', 50 + function(e) { 51 + if (e.getSpecialKey() != 'return') { 52 + return; 53 + } 54 + e.kill(); 55 + _doSearch(e); 56 + }); 57 + 58 + JX.Stratcom.listen( 59 + 'click', 60 + 'conpherence-search-toggle', 61 + _toggleSearch); 62 + 63 + });
+5 -40
webroot/rsrc/js/application/conpherence/behavior-menu.js
··· 36 36 }); 37 37 threadManager.setDidLoadThreadCallback(function(r) { 38 38 var header = JX.$H(r.header); 39 + var search = JX.$H(r.search); 39 40 var messages = JX.$H(r.transactions); 40 41 var form = JX.$H(r.form); 41 42 var root = JX.DOM.find(document, 'div', 'conpherence-layout'); 42 43 var header_root = JX.DOM.find(root, 'div', 'conpherence-header-pane'); 44 + var search_root = JX.DOM.find(root, 'div', 'conpherence-search-main'); 43 45 var form_root = JX.DOM.find(root, 'div', 'conpherence-form'); 44 46 JX.DOM.setContent(header_root, header); 47 + JX.DOM.setContent(search_root, search); 45 48 JX.DOM.setContent(scrollbar.getContentNode(), messages); 46 49 JX.DOM.setContent(form_root, form); 47 50 ··· 210 213 } 211 214 212 215 function markThreadLoading(loading) { 213 - var root = JX.DOM.find(document, 'div', 'conpherence-layout'); 214 - var header_root = JX.DOM.find(root, 'div', 'conpherence-header-pane'); 215 - var messages_root = JX.DOM.find(root, 'div', 'conpherence-message-pane'); 216 - var form_root = JX.DOM.find(root, 'div', 'conpherence-form'); 217 - 218 - JX.DOM.alterClass(header_root, 'loading', loading); 219 - JX.DOM.alterClass(messages_root, 'loading', loading); 220 - JX.DOM.alterClass(form_root, 'loading', loading); 216 + var root = JX.$('conpherence-main-layout'); 217 + JX.DOM.alterClass(root, 'loading', loading); 221 218 222 219 try { 223 220 var textarea = JX.DOM.find(form, 'textarea'); ··· 377 374 e.kill(); 378 375 selectThread(e.getNode('conpherence-menu-click'), true); 379 376 }); 380 - 381 - JX.Stratcom.listen('click', 'conpherence-edit-metadata', function (e) { 382 - e.kill(); 383 - var root = e.getNode('conpherence-layout'); 384 - var form = JX.DOM.find(root, 'form', 'conpherence-pontificate'); 385 - var data = e.getNodeData('conpherence-edit-metadata'); 386 - var header = JX.DOM.find(root, 'div', 'conpherence-header-pane'); 387 - var messages = scrollbar.getContentNode(); 388 - 389 - new JX.Workflow.newFromForm(form, data) 390 - .setHandler(JX.bind(this, function(r) { 391 - JX.DOM.appendContent(messages, JX.$H(r.transactions)); 392 - _scrollMessageWindow(); 393 - 394 - JX.DOM.setContent( 395 - header, 396 - JX.$H(r.header) 397 - ); 398 - 399 - try { 400 - // update the menu entry 401 - JX.DOM.replace( 402 - JX.$(r.conpherence_phid + '-nav-item'), 403 - JX.$H(r.nav_item) 404 - ); 405 - selectThreadByID(r.conpherence_phid + '-nav-item'); 406 - } catch (ex) { 407 - // Ignore; this view may not have a menu. 408 - } 409 - })) 410 - .start(); 411 - }); 412 377 413 378 /** 414 379 * On devices, we just show a thread list, so we don't want to automatically