Page MenuHomePhabricator

D19165.id.diff
No OneTemporary

D19165.id.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -78,7 +78,7 @@
'rsrc/css/application/feed/feed.css' => 'ecd4ec57',
'rsrc/css/application/files/global-drag-and-drop.css' => 'b556a948',
'rsrc/css/application/flag/flag.css' => 'bba8f811',
- 'rsrc/css/application/harbormaster/harbormaster.css' => '5dd4c2de',
+ 'rsrc/css/application/harbormaster/harbormaster.css' => '2999ccaa',
'rsrc/css/application/herald/herald-test.css' => 'a52e323e',
'rsrc/css/application/herald/herald.css' => 'cd8d0134',
'rsrc/css/application/maniphest/report.css' => '9b9580b7',
@@ -579,7 +579,7 @@
'font-fontawesome' => 'e838e088',
'font-lato' => 'c7ccd872',
'global-drag-and-drop-css' => 'b556a948',
- 'harbormaster-css' => '5dd4c2de',
+ 'harbormaster-css' => '2999ccaa',
'herald-css' => 'cd8d0134',
'herald-rule-editor' => 'dca75c0e',
'herald-test-css' => 'a52e323e',
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php b/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php
@@ -355,11 +355,11 @@
$display_line = ($line['line'] + 1);
$display_text = ($line['data']);
- $cell_attr = array();
+ $row_attr = array();
if ($highlight_range) {
if (($display_line >= $highlight_range[0]) &&
($display_line <= $highlight_range[1])) {
- $cell_attr = array(
+ $row_attr = array(
'class' => 'phabricator-source-highlight',
);
}
@@ -373,11 +373,11 @@
$display_line);
$line_cell = phutil_tag('th', array(), $display_line);
- $text_cell = phutil_tag('td', $cell_attr, $display_text);
+ $text_cell = phutil_tag('td', array(), $display_text);
$rows[] = phutil_tag(
'tr',
- array(),
+ $row_attr,
array(
$line_cell,
$text_cell,
@@ -401,10 +401,14 @@
}
}
- $table = phutil_tag(
+ $table = javelin_tag(
'table',
array(
'class' => 'harbormaster-log-table PhabricatorMonospaced',
+ 'sigil' => 'phabricator-source',
+ 'meta' => array(
+ 'uri' => $log->getURI(),
+ ),
),
$rows);
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php
@@ -24,7 +24,8 @@
$log_view = id(new HarbormasterBuildLogView())
->setViewer($viewer)
->setBuildLog($log)
- ->setHighlightedLineRange($request->getURIData('lines'));
+ ->setHighlightedLineRange($request->getURIData('lines'))
+ ->setEnableHighlighter(true);
$crumbs = $this->buildApplicationCrumbs()
->addTextCrumb(pht('Build Logs'))
diff --git a/src/applications/harbormaster/view/HarbormasterBuildLogView.php b/src/applications/harbormaster/view/HarbormasterBuildLogView.php
--- a/src/applications/harbormaster/view/HarbormasterBuildLogView.php
+++ b/src/applications/harbormaster/view/HarbormasterBuildLogView.php
@@ -4,6 +4,7 @@
private $log;
private $highlightedLineRange;
+ private $enableHighlighter;
public function setBuildLog(HarbormasterBuildLog $log) {
$this->log = $log;
@@ -23,6 +24,11 @@
return $this->highlightedLineRange;
}
+ public function setEnableHighlighter($enable) {
+ $this->enableHighlighter = $enable;
+ return $this;
+ }
+
public function render() {
$viewer = $this->getViewer();
$log = $this->getBuildLog();
@@ -50,6 +56,10 @@
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
->setHeader($header);
+ if ($this->enableHighlighter) {
+ Javelin::initBehavior('phabricator-line-linker');
+ }
+
$has_linemap = $log->getLineMap();
if ($has_linemap) {
$content_id = celerity_generate_unique_node_id();
diff --git a/webroot/rsrc/css/application/harbormaster/harbormaster.css b/webroot/rsrc/css/application/harbormaster/harbormaster.css
--- a/webroot/rsrc/css/application/harbormaster/harbormaster.css
+++ b/webroot/rsrc/css/application/harbormaster/harbormaster.css
@@ -69,7 +69,11 @@
padding: 4px 0;
}
-.harbormaster-log-table tr.harbormaster-log-highlighted > td {
+.harbormaster-log-table tr.phabricator-source-highlight > th {
+ background: {$paste.border};
+}
+
+.harbormaster-log-table tr.phabricator-source-highlight > td {
background: {$paste.highlight};
}

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 25, 7:51 PM (2 h, 40 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6927545
Default Alt Text
D19165.id.diff (4 KB)

Event Timeline