Skip to content

Commit 4d71f91

Browse files
author
p01
committed
Dead code removal
1 parent da886da commit 4d71f91

File tree

3 files changed

+0
-95
lines changed

3 files changed

+0
-95
lines changed

src/resource-manager/resource_detail_view.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,7 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
123123
this._tops = [];
124124
var _ele = container.querySelectorAll('.'+HIGHLIGHTED_LINE_CLASSNAME)[0];
125125
if (_ele)
126-
{
127126
_ele.removeClass(HIGHLIGHTED_LINE_CLASSNAME)
128-
}
129127
}
130128

131129
this.go_to_line = function(container, data)
@@ -140,17 +138,6 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
140138
}
141139
}
142140

143-
this.on_resource_data_bound = function(type, data)
144-
{
145-
var id = data[0];
146-
var resource = this._service.get_resource(id);
147-
if(resource)
148-
{
149-
resource.data = new cls.ResourceManager["1.0"].ResourceData( data );
150-
}
151-
return resource;
152-
}.bind(this);
153-
154141
this._show_resource_by_instance = function(resource)
155142
{
156143
this.resource = resource;
@@ -189,30 +176,6 @@ cls.ResourceDetailView = function(id, name, container_class, html, default_handl
189176
window.UI.instance.show_view( window.views.resource_detail_view.id );
190177
}
191178

192-
193-
// WIP
194-
this.show_resource_group = function(resourceGroup)
195-
{
196-
return;
197-
198-
this.resources = [];
199-
for( var i=0; i<group.ids.length; i++)
200-
{
201-
var id = group.ids[i];
202-
var resource = this._service.get_resource(id);
203-
if (resource)
204-
{
205-
this.resources.push( resource );
206-
if (!resource.data)
207-
{
208-
var responseType = cls.ResourceUtil.type_to_content_mode(resource.type);
209-
this._service.fetch_resource_data( this.on_resource_data_bound, id, responseType );
210-
}
211-
}
212-
}
213-
this.update();
214-
}
215-
216179
this.init(id, name, container_class, html, default_handler);
217180
};
218181

src/resource-manager/resource_service.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ cls.ResourceManagerService = function(view, network_logger)
260260
var eh = window.eventHandlers;
261261
eh.click["resources-expand-collapse"] = this._handle_expand_collapse_bound;
262262
eh.click["resource-detail"] = this._handle_resource_detail_bound;
263-
eh.click["resource-group"] = this._handle_resource_group_bound;
264263

265264
eh.click['open-resource-tab'] = function(event, target)
266265
{
@@ -301,32 +300,6 @@ cls.ResourceManagerService = function(view, network_logger)
301300
return resource && resource.last;
302301
};
303302

304-
this._fetch_resource_data = function(callback, id, type)
305-
{
306-
var resource = this.get_resource(id);
307-
308-
var typecode = {datauri: 3, string: 1}[type] || 1;
309-
var tag = window.tagManager.set_callback(null, callback);
310-
const MAX_PAYLOAD_SIZE = 10 * 1000 * 1000; // allow payloads of about 10 mb.
311-
this._res_service.requestGetResource(tag, [id, [typecode, 1, MAX_PAYLOAD_SIZE]]);
312-
};
313-
314-
this._on_resource_data_bound = function(type, data)
315-
{
316-
var id = data[0];
317-
var resource = this.get_resource(id);
318-
if(resource)
319-
{
320-
resource.data = new cls.ResourceManager["1.0"].ResourceData( data );
321-
if(resource.type=='image')
322-
{
323-
var i=new Image();
324-
i.src=resource.data.content.stringData;
325-
resource.data.meta = i.naturalWidth+'x'+i.naturalHeight;
326-
}
327-
}
328-
this._view.update();
329-
}.bind(this);
330303

331304
this.request_resource_for_url = function(url,callback)
332305
{

src/resource-manager/resource_test_view.js

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -74,37 +74,6 @@ cls.ResourceTreeView = function(id, name, container_class, html, default_handler
7474
this.update();
7575
}.bind(this);
7676

77-
78-
79-
this._type_class_map =
80-
{
81-
image: cls.ImageResourceDetail,
82-
font: cls.FontResourceDetail,
83-
script: cls.JSResourceDetail,
84-
markup: cls.MarkupResourceDetail,
85-
css: cls.CSSResourceDetail,
86-
text: cls.TextResourceDetail,
87-
};
88-
this._open_resource_views = {};
89-
90-
this._open_resource_tab = function(resource, data)
91-
{
92-
var ui = UI.get_instance();
93-
94-
if (!this._open_resource_views[resource.id])
95-
{
96-
var viewclass = this._type_class_map[resource.type]||cls.GenericResourceDetail;
97-
var view = new viewclass( resource, this._service );
98-
this._open_resource_views[resource.id] = view.id;
99-
}
100-
window.views[this._open_resource_views[resource.id]].data = data
101-
102-
ui.get_tabbar("resources").add_tab(this._open_resource_views[resource.id]);
103-
ui.show_view(this._open_resource_views[resource.id]);
104-
}
105-
106-
107-
10877
var doc_service = window.services['document-manager'];
10978
doc_service.addListener("abouttoloaddocument", this._on_abouttoloaddocument_bound);
11079
doc_service.addListener("documentloaded", this._on_documentloaded_bound);

0 commit comments

Comments
 (0)