Skip to content

Commit 5e8f202

Browse files
author
p01
committed
Review fixes
1 parent d52fb7a commit 5e8f202

File tree

8 files changed

+145
-143
lines changed

8 files changed

+145
-143
lines changed

src/resource-manager/resource_detail_view.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
3939
var TEXT = document.TEXT_NODE;
4040
var ELE = document.ELEMENT_NODE;
4141
var HIGHLIGHT_CONTEXT_SIZE = 8;
42+
var CR = "\r";
43+
var LF = "\n";
4244
this._span = document.createElement("span");
4345
this._span.textContent = " ";
4446
this._line_count = 0;
@@ -49,8 +51,6 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
4951

5052
this._highlight_line = function(ele)
5153
{
52-
var CR = "\r";
53-
var LF = "\n";
5454
var child = ele.firstChild;
5555
while (child && !this._line_found)
5656
{
@@ -165,6 +165,14 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
165165
service.request_resource_data(url, this.show_resource.bind(this), data, resource);
166166
};
167167

168+
/*
169+
* the "key" can be either:
170+
* * an instance of cls.ResourceInfo
171+
* * the UID of a cls.ResourceInfo
172+
* * a URL
173+
*
174+
* That way it's easier for the other services to get a resource shown regardless of its "form".
175+
*/
168176
this.show_resource = function(key, data)
169177
{
170178
if (key instanceof cls.ResourceInfo)

src/resource-manager/resource_display_broker.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,17 @@ cls.ResourceDisplayBroker = function()
4949
{
5050
var id = Number(ele.getAttribute("data-resource-id"));
5151
var url = ele.getAttribute("data-resource-url");
52-
var line = ele.getAttribute('data-resource-line-number');
52+
var line = ele.getAttribute("data-resource-line-number");
5353
var rt_id;
5454

5555
if (id)
5656
this.show_resource_for_id(id, line);
5757
else if (url)
5858
{
5959
// resolve the URL based on that of the runtime if we only have a relative path
60-
if (url.indexOf('://') == -1)
60+
if (url.indexOf("://") == -1)
6161
{
62-
rt_id = ele.get_attr('parent-node-chain', 'rt-id');
62+
rt_id = ele.get_attr("parent-node-chain", "rt-id");
6363
if (rt_id)
6464
url = window.helpers.resolveURLS(runtimes.getURI(rt_id), url);
6565
}

0 commit comments

Comments
 (0)