Now has a good amd wrapper for qweb
bzr revid: nicolas.vanhoren@openerp.com-20130819122459-45alsxp7m8zphc6v
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
|
||||
(function() {
|
||||
|
||||
var tmpQWeb2 = window.QWeb2;
|
||||
|
||||
require.config({
|
||||
context: "oelivesupport",
|
||||
baseUrl: {{url | json}},
|
||||
@@ -18,7 +22,8 @@ require.config({
|
||||
},
|
||||
qweb2: {
|
||||
init: function() {
|
||||
// TODO: better solution to avoid contamination of global namespace
|
||||
var QWeb2 = window.QWeb2;
|
||||
window.QWeb2 = tmpQWeb2;
|
||||
return QWeb2;
|
||||
},
|
||||
},
|
||||
@@ -37,3 +42,5 @@ require.config({
|
||||
userName: {{userName | json}} || undefined,
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
import sys
|
||||
import json
|
||||
|
||||
file_name = sys.argv[1]
|
||||
function_name = sys.argv[2]
|
||||
|
||||
with open(file_name) as file_:
|
||||
content = file_.read()
|
||||
|
||||
print "window.%s(%s);" % (function_name, json.dumps(content))
|
||||
|
||||
@@ -25,6 +25,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
// TODO: line number -> https://bugzilla.mozilla.org/show_bug.cgi?id=618650
|
||||
// TODO: templates orverwritten could be called by t-call="__super__" ?
|
||||
// TODO: t-set + t-value + children node == scoped variable ?
|
||||
|
||||
(function() {
|
||||
|
||||
var QWeb2 = {
|
||||
expressions_cache: {},
|
||||
RESERVED_WORDS: 'true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,this,typeof,eval,void,Math,RegExp,Array,Object,Date'.split(','),
|
||||
@@ -727,3 +730,7 @@ QWeb2.Element = (function() {
|
||||
});
|
||||
return Element;
|
||||
})();
|
||||
|
||||
window.QWeb2 = QWeb2;
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user