PubNub works by calling callback functions you specify like this:
http://www.pubnub.com/account-javascript-api-include
How to integrate this properly with the Qooxdoo JS framework?
Qooxdoo application looks like this:
http://demo.qooxdoo.org/current/playground/#Hello%20World-ria
How do you load the external JS library and make the global “PUBNUB” available?
You could easily use the add-script config key, to load the pubnub-*.min.js before your app. Then add the
PUBNUB.subscribe()call anywhere in your qooxdoo code where it suits you, e.g. in themainmethod of your main class or in an event handler of a GUI element like a button.EDIT:
To add more details:
add-scriptkey in config.json, in the “jobs” section.source-scriptand thebuild-scriptjobs, or you create a separate job for the key and extend source-script and build-script with it (that would I do).config-warningskey if you wish. But this doesn’t affect the built app.Here is a fragment of the possible config.json entries: