Skip to content
This repository has been archived by the owner on Jan 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #810 from just-boris/master
Browse files Browse the repository at this point in the history
update uri viewer
  • Loading branch information
baev committed May 29, 2016
2 parents 46285b3 + 77ac200 commit 10fa52c
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Link to image
data/8e86c8ae-c2cd-49d4-a1b8-87592aa6de02-attachment.png

# Other link
data/aae99fa5-af39-461f-b218-b1e4f2a88e56-attachment.webm
#
19 changes: 9 additions & 10 deletions allure-report-face/src/components/attachment/AttachmentView.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,15 @@
</video>
</div>
{{else if (eq type "uri")}}
<table class="table attachment__table">
<tbody>
{{#each content}}
<tr>
<td><a href="{{.}}" target="_blank">{{.}}</a></td>
</tr>
{{/each}}
</tbody>
</table>
{{#each content}}
<p class="{{b 'attachment' 'url' comment=comment}}">
{{#if comment}}
{{text}}
{{else}}
<a href="{{text}}" target="_blank" class="link">{{text}}</a>
{{/if}}
</p>
{{/each}}
{{else}}
<iframe class="attachment__iframe" frameborder="0" src="{{sourceUrl}}"></iframe>
{{/if}}

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import './styles.css';
import d3 from 'd3';
import highlight from '../../util/highlight';
import splitUriList from '../../helpers/splitUriList';
import {ItemView} from 'backbone.marionette';
import $ from 'jquery';
import router from '../../router';
Expand Down Expand Up @@ -41,7 +40,13 @@ class AttachmentView extends ItemView {
if(this.type === 'csv') {
this.content = d3.csv.parseRows(responseText);
} else if(this.type === 'uri') {
this.content = splitUriList(responseText);
this.content = responseText.split('\n')
.map(line => line.trim())
.filter(line => line.length > 0)
.map(line => ({
comment: line.startsWith('#'),
text: line
}));
} else {
this.content = responseText;
}
Expand Down
7 changes: 7 additions & 0 deletions allure-report-face/src/components/attachment/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@
padding: 10px 15px;
}
}
&__url {
padding: 0 $gap-size;
margin: 0.5em 0;
&_comment {
color: $text-muted-color;
}
}
&__embed, &__media {
max-width: 100%;
}
Expand Down
6 changes: 0 additions & 6 deletions allure-report-face/src/helpers/splitUriList.js

This file was deleted.

6 changes: 3 additions & 3 deletions allure-report-face/src/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ $sidebar-text-shadow-color: #000;

/* Links */

$link-color: #1976D2;
$link-color: #1976D2;
$link-color-hover: #f00;

/* Pane set */

$pane-bg-color: #fff;
$pane-border-color: #cdd0d2;
$pane-overlay-bg: rgba(240, 240, 240, 0.4);
$pane-overlay-bg-hover: rgba(240, 240, 240, 0.2);
$pane-overlay-bg: rgba(240, 240, 240, 0.4);
$pane-overlay-bg-hover: rgba(240, 240, 240, 0.2);

0 comments on commit 10fa52c

Please sign in to comment.