| ///// /www/luci-static/resources/remake/test1.js
'require baseclass';
'require view';
'require poll';
'require fs';
var Junk = baseclass.extend({
__init__: function(something) {
return view.extend({
render: function() {
return E([
E('h4', {}, _('Oh boi, javascript is delightful...'))
]);
},
handleSave: null,
handleSaveApply: null,
handleReset: null
});
}
});
return Junk;
//////////////// view file
'use strict';
'require ui';
'require view';
'require remake.test1 as test1';
// Different attempts, only one of them in the file at a time...
return test1.Junk("blah"); // "test1.Junk is not a function"
return new test1.Junk("blah"); // "test1.Junk is not a constructor"....
return view.extend({
render: function() {
var m = new test1.Junk("blah"); // same, test1.Junk is not a constructor...
return m.render();
}
});
|