Comments (4)
If you look at the file "Application.ts", you will see at the bottom the following line:
qx.registry.registerMainMethod(qooxdooMain);
You will observe, that it sits outside any class or function so that it will be executed when the transpiled Javascript is loaded. Just make sure the qooxdoo.js is loaded first.
from qx-typed.
The question is not when this function will be called. For example, I want to use qooxdoo mobile with typescript. In that case, I need qooxdoo.js with another implementation of qx.registry.registerMainMethod. So, the question is how to white the bootstrap similar to registerMainMethod.
from qx-typed.
Found the solution. Thanks to JSBeautify :-) Application.js:
var a = "__app",
b = "__method",
c = "base.Application";
qx.registry = {
registerMainMethod: function(d) {
qx.registry[b] = d;
var e = qx.registry[a];
if (e) d(e);
},
registerApp: function(f) {
qx.registry[a] = f;
var g = qx.registry[b];
if (g) g(f);
}
};
plus in main:
qx.registry.registerApp(this);
qx.ui.basic.Atom;
qx.ui.basic.Image;
qx.ui.basic.Label;
// And so on...
from qx-typed.
See you figured it out your self. But indeed there are two parts:
- The registration method for the main. Done this so it makes no difference if you first load your own javascript of first load qooxdoo library.
qx.registry = {
registerMainMethod : function(mainMethod) {
qx.registry["__method"] = mainMethod;
var app = qx.registry["__app"];
if (app) mainMethod(app);
},
registerApp : function(app) {
qx.registry["__app"] = app;
var method = qx.registry["__method"];
if (method) method(app);
}
};
- Trick the compiler by including all the required classes. Please note that these are in a clause that will never be executed. Just so the qooxdoo tools put all these classes in the resulting javascript file.
var aaa = 12 * 32 / 5 + 4;
if (aaa===0) {
qx.ui.basic.Atom;
qx.ui.basic.Image;
qx.ui.basic.Label;
qx.ui.container.Composite;
...
}
from qx-typed.
Related Issues (11)
- Visual Studio Project HOT 8
- Donation HOT 12
- Tried to donate but declined twice HOT 7
- Sample Application using qx-typed (QooxDoo for TypeScript) and RequireJS HOT 7
- qx.io is not found HOT 3
- Convert Qooxdoo Dialog Library HOT 1
- Latest Update has 13 errors from 0 errors in previous HOT 3
- Upgrade qooxdoo version HOT 6
- qx.ui.mobile support?
- How to specify the main html file or customRun in the project settings HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qx-typed.