From bedfc48dcfb066e61209337235e339975dd093d0 Mon Sep 17 00:00:00 2001 From: Antony Lesuisse Date: Mon, 5 Sep 2011 13:03:09 +0200 Subject: rename base into web part1 bzr revid: al@openerp.com-20110905110309-egx167t1ni1fzho1 --- addons/web/static/src/js/boot.js | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 addons/web/static/src/js/boot.js (limited to 'addons/web/static/src/js/boot.js') diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js new file mode 100644 index 00000000000..c5d8bbfc1ca --- /dev/null +++ b/addons/web/static/src/js/boot.js @@ -0,0 +1,67 @@ +/*--------------------------------------------------------- + * OpenERP Web Boostrap Code + *---------------------------------------------------------*/ + +/** + * @name openerp + * @namespace openerp + * @namespace window.openerp + */ +(function() { + if (this.openerp) + return; + var session_counter = 0; + + var openerp = this.openerp = { + // Per session namespace + // openerp. will map to + // openerp.sessions.sessionname. using a closure + sessions: {}, + /** + * OpenERP instance constructor + * + * @param {Boolean} skip_init if true, skips the built-in initialization + */ + init: function(skip_init) { + var new_instance = { + // links to the global openerp + _openerp: openerp, + // Only web will be loaded, the rest will be by loaded by + // openerp.web.Connection on the first connection + _modules_loaded: false, + // this unique id will be replaced by hostname_databasename by + // openerp.web.Connection on the first connection + _session_id: "session" + session_counter++, + web: {}, + web_mobile: {} + }; + openerp.sessions[new_instance._session_id] = new_instance; + if (!skip_init){ + openerp.web(new_instance); + } + return new_instance; + } + }; +})(); + +/*--------------------------------------------------------- + * OpenERP Web web module split + *---------------------------------------------------------*/ + +openerp.web = function(instance) { + openerp.web.core(instance); + if (openerp.web.dates) { + openerp.web.dates(instance); + } + openerp.web.formats(instance); + openerp.web.chrome(instance); + openerp.web.data(instance); + files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export"]; + for(i=0; i Date: Tue, 6 Sep 2011 11:31:39 +0200 Subject: [FIX] implicit globals: missing 'var' declarations did not touch gantt.js, this thing's a swap, there are implicit globals which are actually used globally bzr revid: xmo@openerp.com-20110906093139-uermn7a9vo38l3kf --- addons/web/static/src/js/boot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/web/static/src/js/boot.js') diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index c5d8bbfc1ca..2c00eb3d5a5 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -56,8 +56,8 @@ openerp.web = function(instance) { openerp.web.formats(instance); openerp.web.chrome(instance); openerp.web.data(instance); - files = ["views","search","list","form","list_editable","web_mobile","view_tree","data_export"]; - for(i=0; i Date: Mon, 12 Sep 2011 12:35:03 +0200 Subject: [FIX] jsdoc v3 fixes: @constructs needs an explicit name, @lends is mandatory to not make free-floating methods (interpreted as globals) bzr revid: xmo@openerp.com-20110912103503-0gpou4t50i2stycp --- addons/web/static/src/js/boot.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/boot.js') diff --git a/addons/web/static/src/js/boot.js b/addons/web/static/src/js/boot.js index 2c00eb3d5a5..b9d5180b5c4 100644 --- a/addons/web/static/src/js/boot.js +++ b/addons/web/static/src/js/boot.js @@ -5,7 +5,6 @@ /** * @name openerp * @namespace openerp - * @namespace window.openerp */ (function() { if (this.openerp) @@ -48,6 +47,9 @@ * OpenERP Web web module split *---------------------------------------------------------*/ +/** + * @namespace + */ openerp.web = function(instance) { openerp.web.core(instance); if (openerp.web.dates) { -- cgit v1.2.3