Changeset 2703


Ignore:
Timestamp:
05/04/10 15:25:37 (14 years ago)
Author:
rodsouza
Message:

Ticket #1058 - Adicionando o javascript ExpressoLivre? e delegando ao mesmo o que é de seu dever.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/inc/class.uimainscreen.inc.php

    r2698 r2703  
    137137                                $GLOBALS['phpgw']->template->set_var('tr_color',$tr_color); 
    138138                                $GLOBALS['phpgw']->template->set_var('value','<input type="submit" value="' . lang('Edit') 
    139                                         . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="XLink( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) . '\' )">'); 
     139                                        . '"><input type="button" name="cancel" value="'. lang('cancel') .'" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/index.php' ) . '\' )">'); 
    140140                                $GLOBALS['phpgw']->template->fp('rows','row_2',True); 
    141141                        } 
  • trunk/admin/templates/default/application_form.tpl

    r2686 r2703  
    1515   <td nowrap> 
    1616    <input type="submit" name="save" value="{lang_save_button}"> &nbsp; 
    17     <input type="button" name="cancel" value="{lang_cancel_button}" onclick="XLink( '{cancel_button}' )" /> 
     17    <input type="button" name="cancel" value="{lang_cancel_button}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    1818   </td> 
    1919   <td align="right">&nbsp; 
  • trunk/admin/templates/default/applications.tpl

    r2686 r2703  
    2929  <tr> 
    3030   <td align="left" nobreak> 
    31     <input type="button" value="{lang_add}" onclick="XLink( '{new_action}' )" /> 
     31    <input type="button" value="{lang_add}" onclick="ExpressoLivre.link( '{new_action}' )" /> 
    3232   </td> 
    3333   <td> 
  • trunk/admin/templates/default/category_form.tpl

    r2686 r2703  
    6060        <input type="hidden" id="idgroup" name="idgroup" value="{cat_id_group}"> 
    6161        <td><input onclick="return verifyCatOwners('td_group')" type="submit" name="save" value="{lang_save}"></td> 
    62                 <td><input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /></td> 
    63                 <td align="right"><input type="button" name="delete" value="{lang_delete}" onclick="XLink( '{delete_button}' )" /></td> 
     62                <td><input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /></td> 
     63                <td align="right"><input type="button" name="delete" value="{lang_delete}" onclick="ExpressoLivre.link( '{delete_button}' )" /></td> 
    6464        </tr> 
    6565</table> 
  • trunk/admin/templates/default/config.tpl

    r2698 r2703  
    236236    <td colspan="2" align="center"> 
    237237      <input type="submit" name="submit" value="{lang_submit}"> 
    238       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     238      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    239239                  <br> 
    240240    </td> 
  • trunk/admin/templates/default/delete_cat.tpl

    r2686 r2703  
    2020                                </td> 
    2121                                <td align="center"> 
    22                                         <input type="button" name="cancel" value="{lang_no}" onclick="XLink( '{no_button}' )"> 
     22                                        <input type="button" name="cancel" value="{lang_no}" onclick="ExpressoLivre.link( '{no_button}' )"> 
    2323                                </td> 
    2424<!-- END delete --> 
  • trunk/admin/templates/default/delete_common.tpl

    r2686 r2703  
    88   <tr> 
    99    <td width="50%" align="center"> 
    10      <input type="button" name="no" value="{no}" onclick="XLink( '{no_button}' )" > 
     10     <input type="button" name="no" value="{no}" onclick="ExpressoLivre.link( '{no_button}' )" > 
    1111    </td> 
    1212    <td width="50%" align="center"> 
  • trunk/admin/templates/default/listcats.tpl

    r2686 r2703  
    5858                                <td> 
    5959                                        <!form method="POST" action="{action_url}"> 
    60                                                 <input type="button" name="add" value="{lang_add}" onclick="XLink( '{add_button}' )" /> &nbsp; 
    61                                                 <input type="button" name="done" value="{lang_cancel}" onclick="XLink( '{done_button}' )" /> 
     60                                                <input type="button" name="add" value="{lang_add}" onclick="ExpressoLivre.link( '{add_button}' )" /> &nbsp; 
     61                                                <input type="button" name="done" value="{lang_cancel}" onclick="ExpressoLivre.link( '{done_button}' )" /> 
    6262                                        <!/form> 
    6363                                </td> 
  • trunk/admin/templates/default/voip.tpl

    r2698 r2703  
    6262                <td colspan="2" align="center"> 
    6363                  <input type="submit" name="save" value="{lang_save}" onclick="javascript:voip.select_();"> 
    64                   <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )"> 
     64                  <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )"> 
    6565                  <br> 
    6666                </td> 
  • trunk/calendar/inc/class.uicustom_fields.inc.php

    r2698 r2703  
    8282                                'action_url'   => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicustom_fields.submited'), 
    8383                                'save_button'  => $this->html->submit_button('save','Save'), 
    84                                 'cancel_button'=> '<input type="button" value="' . lang( 'Cancel' ) . '" onclick="XLink( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/' ) . '\' )" />' 
     84                                'cancel_button'=> '<input type="button" value="' . lang( 'Cancel' ) . '" onclick="ExpressoLivre.link( \'' . $GLOBALS[ 'phpgw' ] -> link( '/admin/' ) . '\' )" />' 
    8585                        )); 
    8686 
  • trunk/calendar/templates/classic/config.tpl

    r2698 r2703  
    100100    <td colspan="2" align="center"> 
    101101      <input type="submit" name="submit" value="{lang_submit}"> 
    102       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     102      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    103103     </td> 
    104104  </tr> 
  • trunk/calendar/templates/default/config.tpl

    r2698 r2703  
    100100    <td colspan="2" align="center"> 
    101101      <input type="submit" name="submit" value="{lang_submit}"> 
    102       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     102      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    103103     </td> 
    104104  </tr> 
  • trunk/contactcenter/templates/classic/config.tpl

    r2698 r2703  
    112112                <td colspan="2" align="center"> 
    113113                        <input type="submit" name="submit" value="{lang_submit}"> 
    114                         <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     114                        <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    115115                </td> 
    116116        </tr> 
  • trunk/contactcenter/templates/default/config.tpl

    r2698 r2703  
    145145                <td colspan="2" align="center"> 
    146146                        <input type="submit" name="submit" value="{lang_submit}"> 
    147                         <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     147                        <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    148148                </td> 
    149149        </tr> 
  • trunk/expressoAdmin1_2/templates/default/config.tpl

    r2698 r2703  
    203203                <td colspan="2" align="center"> 
    204204                        <input type="submit" name="submit" value="{lang_submit}"> 
    205                         <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )"> 
     205                        <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )"> 
    206206                </td> 
    207207        </tr> 
  • trunk/expressoMail1_2/templates/classic/config.tpl

    r2698 r2703  
    106106    <td colspan="2" align="center"> 
    107107      <input type="submit" name="submit" value="{lang_submit}"> 
    108       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     108      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    109109    </td> 
    110110  </tr> 
  • trunk/expressoMail1_2/templates/default/config.tpl

    r2698 r2703  
    100100    <td colspan="2" align="center"> 
    101101      <input type="submit" name="submit" value="{lang_submit}"> 
    102       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     102      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    103103    </td> 
    104104  </tr> 
  • trunk/filemanager/templates/default/config.tpl

    r2698 r2703  
    3636    <td colspan="2" align="center"> 
    3737      <input type="submit" name="submit" value="{lang_submit}"> 
    38       <input type="button" name="cancel" value="{lang_cancel}" onclick="XLink( '{cancel_button}' )" /> 
     38      <input type="button" name="cancel" value="{lang_cancel}" onclick="ExpressoLivre.link( '{cancel_button}' )" /> 
    3939    </td> 
    4040  </tr> 
  • trunk/index.php

    r2691 r2703  
    7272                $target = '( function( ){ var target = window.location.hash; target = (' 
    7373                        . '( arguments.length && ( target && target.length > 1 ) ) ?' 
    74                         . 'URL_SERVER + target.substr( 1 ) : "' . $GLOBALS[ 'phpgw' ] -> link( $target ). '" ); XLink( target ); } )'; 
     74                        . 'URL_SERVER + target.substr( 1 ) : "' . $GLOBALS[ 'phpgw' ] -> link( $target ). '" ); ExpressoLivre.link( target ); } )'; 
    7575 
    7676                if ( array_key_exists( 'HTTP_BACKGROUNDREQUEST', $_SERVER ) || array_key_exists( 'BackgroundRequest', $_GET ) ) 
     
    137137                } 
    138138 
    139                 echo '<script>XLink( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );</script>'; 
     139                echo '<script>ExpressoLivre.link( "' . $GLOBALS[ 'phpgw' ] -> link( '/home.php' ) . '", true );</script>'; 
    140140                exit; 
    141141        } 
  • trunk/news_admin/templates/default/acl.tpl

    r2698 r2703  
    4242    <td colspan="3" align="center"> 
    4343     <input type="submit" name="btnSave" value="{lang_save}"> &nbsp; 
    44      <input type="submit" name="btnDone" value="{lang_done}" onclick="XLink( '{done_button}' )" /> 
     44     <input type="submit" name="btnDone" value="{lang_done}" onclick="ExpressoLivre.link( '{done_button}' )" /> 
    4545    </td> 
    4646   </tr> 
  • trunk/news_admin/templates/default/export.tpl

    r2698 r2703  
    5353    <td colspan="3" align="center"> 
    5454     <input type="submit" name="btnSave" value="{lang_save}"> &nbsp; 
    55      <input type="submit" name="btnDone" value="{lang_done}" onclick="XLink( '{done_button}' )" /> 
     55     <input type="submit" name="btnDone" value="{lang_done}" onclick="ExpressoLivre.link( '{done_button}' )" /> 
    5656    </td> 
    5757   </tr> 
  • trunk/phpgwapi/inc/class.common.inc.php

    r2677 r2703  
    392392                                                $webserver_url .= '/'; 
    393393 
     394                                        $expressolivre = CreateObject( 'phpgwapi.expressolivre' ); 
     395 
    394396                                        $GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= '<script type="text/javascript">' 
    395397                                                . 'var URL_SERVER = window.location.protocol + "//" + window.location.host + "' . $webserver_url . '";' 
    396                                                 . 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";</script>'; 
     398                                                . 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";' 
     399                                                . 'var ExpressoLivre = function ExpressoLivre( ) { return String( \'' . $expressolivre -> configuration( ) . '\' ); };' 
     400                                                . '</script>'; 
    397401 
    398402                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'wz_dragdrop', 'wz_dragdrop', NULL, true ); 
    399403                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'expressoAjax', NULL, true ); 
    400404                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'dom', NULL, true ); 
     405                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressolivre','expressolivre', NULL, true ); 
    401406                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xlink', NULL, true ); 
    402407                                        $GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xscript', NULL, true ); 
  • trunk/phpgwapi/js/tools/xlink.js

    r2700 r2703  
    11( function( ) 
    22{ 
    3         if ( window.location.protocol + '//' + window.location.host + window.location.pathname != URL_SERVER ) 
    4                 window.location.href = URL_SERVER + ( 
    5                         ( window.location.hash ) ? 
    6                                 window.location.hash : '#' + String( window.location.protocol + '//' + window.location.host + window.location.pathname ).substr( URL_SERVER.length ) 
    7                 ); 
     3        var _path = null; 
     4        var _last_request = null; 
    85 
    9         var _connector = new XConnector; 
    10         var _script = null; 
     6        var _connector = null; 
     7        var _script = new XScript; 
    118 
    129        var _container = null; 
    1310        var _divAppboxHeader = null; 
     11 
    1412        var _loading = new Image( ); 
    15         _loading.src = URL_SERVER + 'phpgwapi/images/loading.gif'; 
    16  
    17         var _last_request = null; 
    1813 
    1914        function _click( _action, _cache ) 
     
    4742 
    4843                window.location = '#' + ( 
    49                         ( _action.indexOf( URL_SERVER ) < 0 ) ? 
    50                                 _action : _action.substr( _action.indexOf( URL_SERVER ) + URL_SERVER.length ) 
     44                        ( _action.indexOf( _path ) < 0 ) ? 
     45                                _action : _action.substr( _action.indexOf( _path ) + URL_SERVER.length ) 
    5146                ); 
    5247        } 
     
    116111                                _script.add( 
    117112                                        _new_scripts[ _count ][ 2 ].substr( 
    118                                                 URL_SERVER.length - 1, 
    119                                                 _new_scripts[ _count ][ 2 ].length - URL_SERVER.length + 1 - ( 
     113                                                _path.length - 1, 
     114                                                _new_scripts[ _count ][ 2 ].length - _path.length + 1 - ( 
    120115                                                        ( _new_scripts[ _count ][ 2 ].indexOf( '?' ) < 0 ) ? 
    121116                                                                0 : ( _new_scripts[ _count ][ 2 ].length - _new_scripts[ _count ][ 2 ].indexOf( '?' ) ) 
     
    137132        function Link( ) 
    138133        { 
     134                _path = ( arguments.length && arguments[ 0 ].constructor == String ) ? arguments[ 0 ] : '/'; 
     135 
     136                if ( window.location.protocol + '//' + window.location.host + window.location.pathname != _path ) 
     137                        window.location.href = _path + ( 
     138                                ( window.location.hash ) ? 
     139                                        window.location.hash : '#' + String( window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search ).substr( _path.length ) 
     140                        ); 
     141 
     142                _loading.src = _path + 'phpgwapi/images/loading.gif'; 
     143                _connector = new XConnector; 
     144        } 
     145 
     146        Link.prototype.click = function( ) 
     147        { 
    139148                _click( arguments[ 0 ], 
    140149                        ( 
     
    143152                        ) 
    144153                ); 
    145         } 
     154        }; 
     155        Link.prototype.intercept = _intercept; 
    146156 
    147157        window.XLink = Link; 
     
    149159        XEvents.add( window, 'onload', function( ) 
    150160        { 
    151                 var _scripts = document.getElementsByTagName( 'head' ).item( 0 ).getElementsByTagName( 'script' ); 
    152                 var _loaded = [ ]; 
    153  
    154                 for ( var i = 0; i < _scripts.length; i++ ) 
    155                         if ( _scripts.item( i ).getAttribute( 'src' ) != null ) 
    156                                 _loaded[ _loaded.length ] = _scripts.item( i ).getAttribute( 'src' ).substr( 
    157                                         URL_SERVER.length - 1, 
    158                                         _scripts.item( i ).getAttribute( 'src' ).indexOf( '?' ) - URL_SERVER.length + 1 
    159                                 ); 
    160  
    161                 _script = new XScript( _loaded ); 
    162  
    163161                _divAppboxHeader = document.getElementById( 'divAppboxHeader' ); 
    164162                _divAppboxHeader.innerHTML = ''; 
    165163 
    166164                _container = document.getElementById( 'divAppbox' ); 
    167  
    168                 document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll'; 
    169  
    170                 var _links = document.getElementsByTagName( 'a' ); 
    171                 for ( var i = 0; i < _links.length; i++ ) 
    172                         _intercept( _links.item( i ) ); 
    173165        } ); 
    174166} )( ); 
  • trunk/phpgwapi/js/tools/xscript.js

    r2642 r2703  
    11( function( ) 
    22{ 
    3         var _connector = null; 
     3        var _connector = new XConnector; 
    44        var _loaded = [ ]; 
    55        var _new = [ ]; 
     
    6565 
    6666        window.XScript = Script; 
    67  
    68         XEvents.add( window, 'onload', function( ) 
    69         { 
    70                 _connector = new XConnector; 
    71         } ); 
    7267} )( ); 
Note: See TracChangeset for help on using the changeset viewer.