[IMP] Removed old JavaScript module loading system in the 'web' addons. Still has some retro-compatibility for other addons.

bzr revid: nicolas.vanhoren@openerp.com-20130806125022-bzjbtn0nqk40ak4g
This commit is contained in:
niv-openerp 2013-08-06 14:50:22 +02:00
parent c63a86c593
commit baef37aec6
16 changed files with 85 additions and 55 deletions

View File

@ -54,8 +54,8 @@ This module provides the core of the OpenERP Web Client.
"static/src/js/data.js",
"static/src/js/data_export.js",
"static/src/js/search.js",
"static/src/js/view_form.js",
"static/src/js/view_list.js",
"static/src/js/view_form.js",
"static/src/js/view_list_editable.js",
"static/src/js/view_tree.js",
],

View File

@ -36,7 +36,6 @@
if (inited)
throw new Error("OpenERP was already inited");
inited = true;
init_web_modules();
for(var i=0; i < modules.length; i++) {
if (modules[i] === "web")
continue;
@ -53,22 +52,5 @@
return openerp;
}
});
/*---------------------------------------------------------
* OpenERP Web web module split
*---------------------------------------------------------*/
function init_web_modules() {
var files = ["pyeval","core","dates","formats","chrome","data","views","search","list","form","list_editable","web_mobile","view_tree","data_export","data_import"];
for(var i=0; i<files.length; i++) {
var fct = openerp.web[files[i]];
if(typeof(fct) === "function") {
openerp.web[files[i]] = {};
for (var k in fct) {
openerp.web[files[i]][k] = fct[k];
}
fct(openerp, openerp.web[files[i]]);
}
}
}
})();

View File

@ -1,7 +1,11 @@
/*---------------------------------------------------------
* OpenERP Web chrome
*---------------------------------------------------------*/
openerp.web.chrome = function(instance) {
(function() {
var instance = openerp;
openerp.web.chrome = {};
var QWeb = instance.web.qweb,
_t = instance.web._t;
@ -1619,6 +1623,6 @@ instance.web.embed = function (origin, dbname, login, key, action, options) {
client.insertAfter(currentScript);
};
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,17 +1,18 @@
(function() {
if (typeof(console) === "undefined") {
// Even IE9 only exposes console object if debug window opened
window.console = {};
('log error debug info warn assert clear dir dirxml trace group'
+ ' groupCollapsed groupEnd time timeEnd profile profileEnd count'
+ ' exception').split(/\s+/).forEach(function(property) {
console[property] = _.identity;
});
}
})();
openerp.web.core = function(instance) {
if (typeof(console) === "undefined") {
// Even IE9 only exposes console object if debug window opened
window.console = {};
('log error debug info warn assert clear dir dirxml trace group'
+ ' groupCollapsed groupEnd time timeEnd profile profileEnd count'
+ ' exception').split(/\s+/).forEach(function(property) {
console[property] = _.identity;
});
}
var instance = openerp;
openerp.web.core = {};
var ControllerMixin = {
/**
@ -796,6 +797,6 @@ instance.web.unblockUI = function() {
*/
instance.web.client_actions = new instance.web.Registry();
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,5 +1,8 @@
openerp.web.data = function(instance) {
(function() {
var instance = openerp;
openerp.web.data = {};
/**
* Serializes the sort criterion array of a dataset into a form which can be
@ -1086,6 +1089,6 @@ instance.web.DropMisordered = instance.web.Class.extend({
}
});
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,4 +1,9 @@
openerp.web.data_export = function(instance) {
(function() {
var instance = openerp;
openerp.web.data_export = {};
var QWeb = instance.web.qweb,
_t = instance.web._t;
instance.web.DataExport = instance.web.Dialog.extend({
@ -408,4 +413,4 @@ instance.web.DataExport = instance.web.Dialog.extend({
}
});
};
})();

View File

@ -1,5 +1,9 @@
openerp.web.dates = function(instance) {
(function() {
var instance = openerp;
openerp.web.dates = {};
var _t = instance.web._t;
/**
@ -152,4 +156,4 @@ instance.web.time_to_str = function(obj) {
+ zpad(obj.getSeconds(),2);
};
};
})();

View File

@ -1,5 +1,9 @@
openerp.web.formats = function(instance) {
(function() {
var instance = openerp;
openerp.web.formats = {};
var _t = instance.web._t;
/**
@ -345,4 +349,4 @@ instance.web.round_decimals = function(value, decimals){
return instance.web.round_precision(value, Math.pow(10,-decimals));
};
};
})();

View File

@ -1,7 +1,10 @@
/*
* py.js helpers and setup
*/
openerp.web.pyeval = function (instance) {
(function() {
var instance = openerp;
instance.web.pyeval = {};
var obj = function () {};
@ -864,4 +867,4 @@ openerp.web.pyeval = function (instance) {
}
}, 0); });
};
};
})();

View File

@ -1,4 +1,9 @@
openerp.web.search = function(instance) {
(function() {
var instance = openerp;
openerp.web.search = {};
var QWeb = instance.web.qweb,
_t = instance.web._t,
_lt = instance.web._lt;
@ -2179,6 +2184,6 @@ instance.web.search.custom_filters = new instance.web.Registry({
'id': 'instance.web.search.ExtendedSearchProposition.Id'
});
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,4 +1,7 @@
(function() {
openerp.test_support = {
setup_session: function (session) {
var origin = location.protocol+"//"+location.host;
_.extend(session, {
@ -76,3 +79,5 @@ openerp.test_support = {
});
}
};
})();

View File

@ -1,4 +1,6 @@
openerp.web.form = function (instance) {
(function() {
var instance = openerp;
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
@ -5664,6 +5666,6 @@ instance.web.form.tags = new instance.web.Registry({
instance.web.form.custom_widgets = new instance.web.Registry({
});
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -1,4 +1,7 @@
openerp.web.list = function (instance) {
(function() {
var instance = openerp;
openerp.web.list = {};
var _t = instance.web._t,
_lt = instance.web._lt;
var QWeb = instance.web.qweb;
@ -2318,5 +2321,5 @@ instance.web.list.Many2Many = instance.web.list.Column.extend({
return this._super(row_data, options);
}
});
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -2,7 +2,10 @@
* handles editability case for lists, because it depends on form and forms already depends on lists it had to be split out
* @namespace
*/
openerp.web.list_editable = function (instance) {
(function() {
var instance = openerp;
openerp.web.list_editable = {};
var _t = instance.web._t;
// editability status of list rows
@ -834,4 +837,4 @@ openerp.web.list_editable = function (instance) {
return null;
}
});
};
})();

View File

@ -2,7 +2,10 @@
* OpenERP web library
*---------------------------------------------------------*/
openerp.web.view_tree = function(instance) {
(function() {
var instance = openerp;
openerp.web.view_tree = {};
var QWeb = instance.web.qweb,
_lt = instance.web._lt;
@ -265,4 +268,4 @@ instance.web.TreeView = instance.web.View.extend(/** @lends instance.web.TreeVie
this.hidden = true;
}
});
};
})();

View File

@ -2,7 +2,10 @@
* OpenERP web library
*---------------------------------------------------------*/
openerp.web.views = function(instance) {
(function() {
var instance = openerp;
openerp.web.views = {};
var QWeb = instance.web.qweb,
_t = instance.web._t;
@ -1616,6 +1619,6 @@ instance.web.xml_to_str = function(node) {
*/
instance.web.views = new instance.web.Registry();
};
})();
// vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: