diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -11,7 +11,6 @@ 'conpherence.pkg.js' => '15191c65', 'core.pkg.css' => 'c218ed53', 'core.pkg.js' => '0fabde4f', - 'darkconsole.pkg.js' => '1f9a31bc', 'differential.pkg.css' => '113e692c', 'differential.pkg.js' => 'f6d809c0', 'diffusion.pkg.css' => 'a2d17c7d', @@ -462,7 +461,6 @@ 'rsrc/js/core/behavior-detect-timezone.js' => '4c193c96', 'rsrc/js/core/behavior-device.js' => 'a3714c76', 'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '484a6e22', - 'rsrc/js/core/behavior-error-log.js' => '6882e80a', 'rsrc/js/core/behavior-fancy-datepicker.js' => 'ecf4e799', 'rsrc/js/core/behavior-file-tree.js' => '88236f00', 'rsrc/js/core/behavior-form.js' => '5c54cbf3', @@ -501,7 +499,7 @@ 'rsrc/js/core/behavior-workflow.js' => '0a3f3021', 'rsrc/js/core/darkconsole/DarkLog.js' => 'c8e1ffe3', 'rsrc/js/core/darkconsole/DarkMessage.js' => 'c48cccdd', - 'rsrc/js/core/darkconsole/behavior-dark-console.js' => '17bb8539', + 'rsrc/js/core/darkconsole/behavior-dark-console.js' => '66888767', 'rsrc/js/core/phtize.js' => 'd254d646', 'rsrc/js/phui/behavior-phui-dropdown-menu.js' => 'b95d6f7d', 'rsrc/js/phui/behavior-phui-file-upload.js' => 'b003d4fb', @@ -588,7 +586,7 @@ 'javelin-behavior-conpherence-pontificate' => '55616e04', 'javelin-behavior-conpherence-search' => '9bbf3762', 'javelin-behavior-countdown-timer' => 'e4cc26b3', - 'javelin-behavior-dark-console' => '17bb8539', + 'javelin-behavior-dark-console' => '66888767', 'javelin-behavior-dashboard-async-panel' => '469c0d9e', 'javelin-behavior-dashboard-move-panels' => '408bf173', 'javelin-behavior-dashboard-query-panel-select' => '453c5375', @@ -613,7 +611,6 @@ 'javelin-behavior-durable-column' => '2ae077e1', 'javelin-behavior-editengine-reorder-configs' => 'd7a74243', 'javelin-behavior-editengine-reorder-fields' => 'b59e1e96', - 'javelin-behavior-error-log' => '6882e80a', 'javelin-behavior-event-all-day' => 'b41537c9', 'javelin-behavior-fancy-datepicker' => 'ecf4e799', 'javelin-behavior-global-drag-and-drop' => '960f6a39', @@ -987,16 +984,6 @@ 'aphront-typeahead-control-css', 'phui-tag-view-css', ), - '17bb8539' => array( - 'javelin-behavior', - 'javelin-stratcom', - 'javelin-util', - 'javelin-dom', - 'javelin-request', - 'phabricator-keyboard-shortcut', - 'phabricator-darklog', - 'phabricator-darkmessage', - ), '1802a242' => array( 'phui-theme-css', ), @@ -1416,6 +1403,16 @@ 'javelin-typeahead-ondemand-source', 'javelin-util', ), + 66888767 => array( + 'javelin-behavior', + 'javelin-stratcom', + 'javelin-util', + 'javelin-dom', + 'javelin-request', + 'phabricator-keyboard-shortcut', + 'phabricator-darklog', + 'phabricator-darkmessage', + ), '66a6def1' => array( 'javelin-behavior', 'javelin-dom', @@ -1429,9 +1426,6 @@ 'javelin-dom', 'phabricator-notification', ), - '6882e80a' => array( - 'javelin-dom', - ), '68af71ca' => array( 'javelin-install', 'javelin-dom', @@ -2343,10 +2337,6 @@ 'javelin-behavior-user-menu', 'phabricator-favicon', ), - 'darkconsole.pkg.js' => array( - 'javelin-behavior-dark-console', - 'javelin-behavior-error-log', - ), 'differential.pkg.css' => array( 'differential-core-view-css', 'differential-changeset-view-css', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -224,8 +224,4 @@ 'javelin-behavior-maniphest-subpriority-editor', 'javelin-behavior-maniphest-list-editor', ), - 'darkconsole.pkg.js' => array( - 'javelin-behavior-dark-console', - 'javelin-behavior-error-log', - ), ); diff --git a/src/applications/console/plugin/DarkConsoleErrorLogPlugin.php b/src/applications/console/plugin/DarkConsoleErrorLogPlugin.php --- a/src/applications/console/plugin/DarkConsoleErrorLogPlugin.php +++ b/src/applications/console/plugin/DarkConsoleErrorLogPlugin.php @@ -39,10 +39,13 @@ $file = $row['file']; $line = $row['line']; - $tag = phutil_tag( + $tag = javelin_tag( 'a', array( - 'onclick' => jsprintf('show_details(%d)', $index), + 'sigil' => 'darkconsole-expand', + 'meta' => array( + 'expandID' => 'row-details-'.$index, + ), ), $row['str'].' at ['.basename($file).':'.$line.']'); $rows[] = array($tag); diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php --- a/src/view/page/PhabricatorStandardPageView.php +++ b/src/view/page/PhabricatorStandardPageView.php @@ -330,9 +330,6 @@ Javelin::initBehavior( 'dark-console', $this->getConsoleConfig()); - - // Change this to initBehavior when there is some behavior to initialize - require_celerity_resource('javelin-behavior-error-log'); } if ($user) { diff --git a/webroot/rsrc/js/core/behavior-error-log.js b/webroot/rsrc/js/core/behavior-error-log.js deleted file mode 100644 --- a/webroot/rsrc/js/core/behavior-error-log.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @provides javelin-behavior-error-log - * @requires javelin-dom - */ - -/* exported show_details */ - -var current_details = null; - -function show_details(row) { - var node = JX.$('row-details-' + row); - - if (current_details !== null) { - JX.$('row-details-' + current_details).style.display = 'none'; - } - - node.style.display = 'block'; - current_details = row; -} diff --git a/webroot/rsrc/js/core/darkconsole/behavior-dark-console.js b/webroot/rsrc/js/core/darkconsole/behavior-dark-console.js --- a/webroot/rsrc/js/core/darkconsole/behavior-dark-console.js +++ b/webroot/rsrc/js/core/darkconsole/behavior-dark-console.js @@ -404,4 +404,24 @@ } + if (!statics.expand) { + statics.expand = true; + + var current_details = null; + JX.Stratcom.listen('click', 'darkconsole-expand', function(e) { + e.kill(); + + if (current_details) { + current_details.style.display = 'none'; + current_details = null; + } + + var id = e.getNodeData('darkconsole-expand').expandID; + var node = JX.$(id); + + node.style.display = 'block'; + current_details = node; + }); + } + });