Skip to content

Commit 6270e5e

Browse files
author
p01
committed
Second phase of DFL-3645, Improved same_origin indication in the ResourceTree.
1 parent 32c7ea5 commit 6270e5e

File tree

2 files changed

+17
-28
lines changed

2 files changed

+17
-28
lines changed

src/resource-manager/resource_style.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,10 @@
203203
{
204204
padding:8px;
205205
}
206+
.resource-detail-image-container
207+
{
208+
text-align:center;
209+
}
206210
.resource-detail-error
207211
{
208212
color:red;
@@ -250,12 +254,6 @@ a.external:hover
250254
}
251255

252256

253-
/* ---------- */
254-
.resource-different-origin
255-
{/* note: same color as the .string class */
256-
color:#a54;
257-
}
258-
259257
/* ------------------ */
260258
.resource-tree
261259
{
@@ -315,6 +313,7 @@ span.resource-domain
315313
{
316314
color:#999;
317315
}
316+
318317
span.resource-tree-window-label,
319318
span.resource-tree-document-label,
320319
span.resource-tree-group-label

src/resource-manager/resource_templates.js

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,9 @@ templates.resource_tree =
137137
'('+resources.length+')',
138138
'class','resource-tree-count'
139139
],
140-
'class','resource-tree-document'+(d.sameOrigin?'':' resource-different-origin')
140+
' ',
141+
d.sameOrigin?[]:['span',d.url.host,'class','resource-domain'],
142+
'class','resource-tree-document',
141143
].concat( extras.tpl.h2 ),
142144
( resources.length == 0 || extras.collapsed )?[]:
143145
[
@@ -214,33 +216,21 @@ templates.resource_tree =
214216

215217
resource:function(context, depth, r)
216218
{
217-
var resourceName =
218-
[
219-
'span',
220-
(r.filename || r.short_distinguisher || r.url || 'NO URL'),
221-
'class','resource-tree-resource-label',
222-
'style', 'margin-left:'+ (1+depth)*this.DEPTH_IDENTATION +'px;',
223-
'data-tooltip','js-script-select',
224-
'data-tooltip-text',r.url
225-
];
226219
var tpl =
227220
['li',
228221
['h2',
229-
(
230-
r.sameOrigin
231-
?
232-
resourceName
233-
:
234-
[resourceName,' ',
235-
['span',
236-
'('+r.host+')',
237-
'class','resource-domain'
238-
]]),
239-
222+
['span',
223+
(r.filename || r.short_distinguisher || r.url || 'NO URL'),
224+
'class','resource-tree-resource-label',
225+
'style', 'margin-left:'+ (1+depth)*this.DEPTH_IDENTATION +'px;',
226+
'data-tooltip','js-script-select',
227+
'data-tooltip-text',r.url
228+
],
229+
' ',
230+
r.sameOrigin?[]:['span',r.host,'class','resource-domain'],
240231
'handler','resource-detail',
241232
'data-resource-uid',String(r.uid),
242233
'class','resource-tree-resource'
243-
// +(r.sameOrigin?'':' resource-different-origin')
244234
+(context.selectedResourceUID==r.uid?' resource-highlight':'')
245235
]
246236
];

0 commit comments

Comments
 (0)