[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 | /* |
---|
| 12 | var a = ( action.indexOf( 'javascript:' ) === 0 ); |
---|
| 13 | a = ( a || ( action.indexOf( '#' ) === 0 ) ); |
---|
| 14 | a = ( a || ( action.indexOf( window.location + '#' ) === 0 ) ); |
---|
| 15 | */ |
---|
| 16 | var a = ( action.indexOf( 'admin/' ) > 0 || action.indexOf( '=admin.' ) > 0 ); |
---|
[2469] | 17 | a = ( a || action.indexOf( 'home' ) > 0 ); |
---|
| 18 | a = ( a || action.indexOf( 'expressoAdmin1_2' ) > 0 ); |
---|
[2470] | 19 | a = ( a || action.indexOf( 'abberit_messenger' ) > 0 ); |
---|
[2439] | 20 | a = ( a || action.indexOf( 'calendar/' ) > 0 || action.indexOf( '=calendar.' ) > 0 ); |
---|
[2420] | 21 | a = ! ( a && ! ( action.indexOf( '#' ) === 0 || action.indexOf( window.location + '#' ) === 0 || action.indexOf( 'javascript:' ) === 0 ) ); |
---|
| 22 | |
---|
| 23 | if ( ! a ) |
---|
| 24 | pLink.onclick = function( ) |
---|
| 25 | { |
---|
[2469] | 26 | _container.innerHTML = ''; |
---|
| 27 | _container.appendChild( _loading ); |
---|
[2420] | 28 | var request = _connector.go( { |
---|
| 29 | 'access' : action, |
---|
| 30 | 'handler' : function( data ) |
---|
| 31 | { |
---|
| 32 | var el = document.createElement( 'div' ); |
---|
| 33 | el.innerHTML = data; |
---|
| 34 | |
---|
| 35 | var links = el.getElementsByTagName( 'a' ); |
---|
| 36 | for ( var i = 0; i < links.length; i++ ) |
---|
| 37 | handler( links.item( i ) ); |
---|
| 38 | |
---|
[2469] | 39 | _container.innerHTML = ''; |
---|
[2420] | 40 | while ( el.hasChildNodes( ) ) |
---|
[2469] | 41 | _container.appendChild( el.firstChild ); |
---|
[2420] | 42 | } |
---|
| 43 | } ); |
---|
| 44 | return false; |
---|
| 45 | }; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | XEvents.add( window, 'onload', function( ) |
---|
| 49 | { |
---|
[2469] | 50 | _container = document.getElementById( 'divAppbox' ); |
---|
| 51 | document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll'; |
---|
[2420] | 52 | var links = document.getElementsByTagName( 'a' ); |
---|
| 53 | for ( var i = 0; i < links.length; i++ ) |
---|
| 54 | handler( links.item( i ) ); |
---|
| 55 | } ); |
---|
| 56 | } )( ); |
---|