[MERGE] qweb xml loading (chs)
authorAntony Lesuisse <al@openerp.com>
Tue, 8 Nov 2011 16:09:42 +0000 (17:09 +0100)
committerAntony Lesuisse <al@openerp.com>
Tue, 8 Nov 2011 16:09:42 +0000 (17:09 +0100)
bzr revid: al@openerp.com-20111108160942-lawx5l2brjq2hut8

1  2 
addons/web/static/src/js/core.js

@@@ -610,6 -615,19 +615,12 @@@ openerp.web.Connection = openerp.web.Ca
              this.on_modules_loaded();
          }
      },
+     do_load_qweb: function(files) {
+         var self = this;
+         _.each(files, function(file) {
 -            $.ajax({
 -                url: file,
 -                type: 'get',
 -                async: false,
 -                dataType: 'text',
 -            }).then(function(xml) {
 -                openerp.web.qweb.add_template(_(xml).trim());
 -            });
++            openerp.web.qweb.add_template(file);
+         });
+     },
      on_modules_loaded: function() {
          for(var j=0; j<this.module_list.length; j++) {
              var mod = this.module_list[j];
@@@ -1017,9 -1035,9 +1028,6 @@@ if ($.blockUI) 
      $.blockUI.defaults.message = '<img src="/web/static/src/img/throbber2.gif">';
  }
  
--/** Setup default connection */
--openerp.connection = new openerp.web.Connection();
--
  /** Configure default qweb */
  openerp.web._t = new openerp.web.TranslationDataBase().build_translation_function();
  openerp.web.qweb = new QWeb2.Engine();
@@@ -1041,6 -1059,6 +1049,9 @@@ openerp.web.qweb.format_text_node = fun
      return tr === ts ? s : tr;
  }
  
++/** Setup default connection */
++openerp.connection = new openerp.web.Connection();
++
  };
  
  // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: