11window . cls || ( window . cls = { } ) ;
22
3- cls . OpenSingleResource = function ( resource_manager , url , data )
3+ cls . OpenSingleResource = function ( view , manager , url , data )
44{
5- this . _resman = resource_manager ;
5+ this . _view = view ;
6+ this . _manager = manager ;
67 this . _url = url ;
78 this . _data = data ;
89
@@ -24,7 +25,8 @@ cls.OpenSingleResource.prototype = new function()
2425
2526 this . _show_resource = function ( )
2627 {
27- if ( ! this . _resman . show_resource_for_url ( this . _url , this . _data ) )
28+ if ( ! this . _manager . get_resource_for_url ( this . _url ) )
29+ //if (!this._view.show_resource_for_url(this._url, this._data))
2830 {
2931 if ( this . _service . requestGetResourceID )
3032 {
@@ -39,6 +41,33 @@ cls.OpenSingleResource.prototype = new function()
3941 } ;
4042
4143 this . _on_resolve_url = function ( status , message )
44+ {
45+ if ( status )
46+ {
47+ if ( this . _service . requestCreateRequest )
48+ {
49+ var debugContext = window . window_manager_data . get_debug_context ( ) ;
50+ var tag = this . _tagman . set_callback ( this , this . _on_resolve_url_request ) ;
51+ this . _service . requestCreateRequest ( tag , [ debugContext , this . _url , 'GET' ] ) ;
52+ }
53+ else
54+ {
55+ this . _fallback ( ) ;
56+ }
57+ }
58+ else
59+ {
60+ const RESOURCE_ID = 0 ;
61+ this . _rid = message [ RESOURCE_ID ] ;
62+ // if (!this._view.show_resource_for_id(this._rid))
63+ {
64+ var tag = this . _tagman . set_callback ( this , this . _on_mime_type ) ;
65+ this . _service . requestGetResource ( tag , [ this . _rid , [ TRANSPORT_OFF ] ] ) ;
66+ }
67+ }
68+ } ;
69+
70+ this . _on_resolve_url_request = function ( status , message )
4271 {
4372 if ( status )
4473 {
@@ -48,7 +77,7 @@ cls.OpenSingleResource.prototype = new function()
4877 {
4978 const RESOURCE_ID = 0 ;
5079 this . _rid = message [ RESOURCE_ID ] ;
51- if ( ! this . _resman . show_resource_for_id ( this . _rid ) )
80+ // if (!this._view .show_resource_for_id(this._rid))
5281 {
5382 var tag = this . _tagman . set_callback ( this , this . _on_mime_type ) ;
5483 this . _service . requestGetResource ( tag , [ this . _rid , [ TRANSPORT_OFF ] ] ) ;
@@ -80,6 +109,7 @@ cls.OpenSingleResource.prototype = new function()
80109 this . _service . requestGetResource ( tag , msg ) ;
81110 }
82111 } ;
112+ .001
83113
84114 this . _on_resource = function ( status , message )
85115 {
@@ -89,8 +119,10 @@ cls.OpenSingleResource.prototype = new function()
89119 }
90120 else
91121 {
92- this . _res . update ( "urlfinished" , new this . _ResourceData ( message ) ) ;
93- this . _resman . open_resource_tab ( this . _res , this . _data ) ;
122+ //this._res.update("urlfinished", new this._ResourceData(message));
123+ this . _res . update ( "responsefinished" , message ) ;
124+ this . _view . open_resource_tab ( this . _res , this . _data ) ;
125+ window . UI . instance . show_view ( this . _view . id ) ;
94126 }
95127 } ;
96128
0 commit comments