ultimix

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

request_manager.js
Go to the documentation of this file.
1
6 if( !ultimix )
7 {
8 ultimix = {};
9 }
10
16 if( !ultimix.request_manager )
17 {
18 ultimix.request_manager = {};
19 }
20
30 ultimix.request_manager.compile_opener_data = function( Obj , Type )
31 {
32 var OpenerData = {};
33
34 OpenerData.OpenIn = Type;
35 OpenerData.TabControl = jQuery( Obj ).attr( 'tab_control' );
36 OpenerData.Title = jQuery( Obj ).attr( 'title' );
37 OpenerData.URL = jQuery( Obj ).attr( 'url' );
38
39 return( OpenerData );
40 }
41
49 ultimix.request_manager.add_iframe_tab_opener = function( Obj )
50 {
51 var OpenerData = ultimix.request_manager.compile_opener_data( Obj , 'iframe_tab' );
52
53 jQuery( Obj ).attr( 'href' , 'javascript:void(0);' );
54
55 jQuery( Obj ).click(
56 function( EventObject )
57 {
58 var Opener = OpenerData;
59 ultimix.tab_control.add_iframe_tab(
60 OpenerData.TabControl , OpenerData.Title , -1 , OpenerData.URL , true , 400
61 );
62 }
63 );
64 }
65
73 ultimix.request_manager.add_ajax_tab_opener = function( Obj )
74 {
75 var OpenerData = ultimix.request_manager.compile_opener_data( Obj , 'ajax_tab' );
76
77 jQuery( Obj ).attr( 'href' , 'javascript:void(0);' );
78
79 jQuery( Obj ).click(
80 function()
81 {
82 var Opener = OpenerData;
83 ultimix.tab_control.add_simple_tab_from_content( Opener.TabControl , Opener.Title , -1 , '' );
84 ultimix.tab_control.set_closable( Opener.TabControl );
85
86 var Selector = '#' + Opener.TabControl;
87 var Tab = jQuery( Selector ).find( 'div.ui-tabs-panel' ).last();
88 ultimix.ajax_gate.DirectViewComposer( Tab , {} , Opener.URL , {} );
89 }
90 );
91 }
92
93 jQuery(
94 function()
95 {
96 jQuery( 'a' ).each(
97 function( i , Obj )
98 {
99 var OpenIn = jQuery( Obj ).attr( 'open_in' );
100 if( OpenIn == '' )
101 {
102 return; // no special action
103 }
104
105 switch( OpenIn )
106 {
107 case( 'iframe_tab' ):ultimix.request_manager.add_iframe_tab_opener( Obj );
108 case( 'ajax_tab' ):ultimix.request_manager.add_ajax_tab_opener( Obj );
109 }
110 }
111 );
112 }
113 );