[% WRAPPER templates/rapidapp/ext_page.tt %]

<!-- Fields required for history management -->
<form id="history-form" class="x-hidden">
    <input type="hidden" id="x-history-field" />
    <iframe id="x-history-frame"></iframe>
</form>

<script type="text/javascript">

  Ext.onReady(function(){

    Ext.ux.RapidApp.HistoryInit();

    [% IF onReady_first %] [% onReady_first %] [% END %]

    var config_url = '[% config_url %]';
    var config_params = [% IF config_params %] [% config_params %] [% ELSE %] {} [% END %] ;

    new Ext.Viewport({
      plugins: ['ra-link-click-catcher'],
      layout : 'fit',
      hideBorders : true,
      defaults : {
        frame : true,
        plit : true
      },
      items : {
        xtype: 'dyncontainer',
        layout: 'fit',
        id: 'maincontainer',
        itemsurl: config_url,
        urlparams: config_params,
        autoEl: {},
        items: {
          autoEl: {},
          html: 'Loading, please wait...'
        }
      }
    });
  });

</script>

[% END %]