[2420] | 1 | ( function( ) |
---|
| 2 | { |
---|
| 3 | var _connector = new XConnector; |
---|
[2469] | 4 | var _container = null; |
---|
| 5 | var _loading = new Image( ); |
---|
| 6 | _loading.src = URL_SERVER + '/phpgwapi/images/loading.gif'; |
---|
| 7 | |
---|
[2420] | 8 | function handler( pLink ) |
---|
| 9 | { |
---|
| 10 | var action = pLink.href; |
---|
| 11 | var a = ( action.indexOf( 'javascript:' ) === 0 ); |
---|
| 12 | a = ( a || ( action.indexOf( '#' ) === 0 ) ); |
---|
| 13 | a = ( a || ( action.indexOf( window.location + '#' ) === 0 ) ); |
---|
[2509] | 14 | a = ( a || ! ( action.indexOf( 'workflow' ) < 0 ) ); |
---|
| 15 | a = ( a || ! ( action.indexOf( 'expressoMail1_2' ) < 0 ) ); |
---|
[2420] | 16 | |
---|
| 17 | if ( ! a ) |
---|
| 18 | pLink.onclick = function( ) |
---|
| 19 | { |
---|
[2469] | 20 | _container.innerHTML = ''; |
---|
| 21 | _container.appendChild( _loading ); |
---|
[2509] | 22 | if ( pLink.hasAttribute( 'cacheit' ) && pLink.getAttribute( 'cacheit' ) === 'true' ) |
---|
| 23 | _connector.cache( ); |
---|
[2420] | 24 | var request = _connector.go( { |
---|
| 25 | 'access' : action, |
---|
| 26 | 'handler' : function( data ) |
---|
| 27 | { |
---|
| 28 | var el = document.createElement( 'div' ); |
---|
| 29 | el.innerHTML = data; |
---|
| 30 | |
---|
| 31 | var links = el.getElementsByTagName( 'a' ); |
---|
| 32 | for ( var i = 0; i < links.length; i++ ) |
---|
| 33 | handler( links.item( i ) ); |
---|
| 34 | |
---|
[2469] | 35 | _container.innerHTML = ''; |
---|
[2420] | 36 | while ( el.hasChildNodes( ) ) |
---|
[2469] | 37 | _container.appendChild( el.firstChild ); |
---|
[2420] | 38 | } |
---|
| 39 | } ); |
---|
| 40 | return false; |
---|
| 41 | }; |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | XEvents.add( window, 'onload', function( ) |
---|
| 45 | { |
---|
[2473] | 46 | var _center = document.createElement( 'center' ); |
---|
| 47 | _center.appendChild( _loading ); |
---|
| 48 | |
---|
[2469] | 49 | _container = document.getElementById( 'divAppbox' ); |
---|
[2473] | 50 | _loading = _center; |
---|
| 51 | |
---|
[2469] | 52 | document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll'; |
---|
[2473] | 53 | |
---|
[2420] | 54 | var links = document.getElementsByTagName( 'a' ); |
---|
| 55 | for ( var i = 0; i < links.length; i++ ) |
---|
| 56 | handler( links.item( i ) ); |
---|
| 57 | } ); |
---|
| 58 | } )( ); |
---|