.idea
*.iml
.virtualenv
+venv
baseURL=config.BASE_URL,
staticBaseURL=config.STATIC_BASE_URL,
dynamicBaseURL=config.DYNAMIC_BASE_URL,
+ dynamicConfiguration=False,
validateNickname=False,
customMenuItems=[]
)
if hasattr(config, "ACCOUNT_WHOIS_COMMAND") and config.ACCOUNT_WHOIS_COMMAND:
options["accountWhoisCommand"] = config.ACCOUNT_WHOIS_COMMAND
+ if hasattr(config, "DYNAMIC_CONFIGURATION") and config.DYNAMIC_CONFIGURATION:
+ options["dynamicConfiguration"] = True
+
return json.dumps(options)
# instances on the same host.
DYNAMIC_BASE_URL = ""
+# OPTION: DYNAMIC_CONFIGURATION
+# If True then request configuration from the backend when we
+# initially connect.
+DYNAMIC_CONFIGURATION = False
+
# OPTION: CONNECTION_RESOLVER
# A list of (ip, port) tuples of resolvers to use for looking
# the SRV record(s) used for connecting to the name set in
r.send("s=" + this.sessionid + "&n=" + this.__subSeqNo);
},
connect: function() {
+ qwebirc.ui.requireDynamicConfiguration(this.__innerConnect.bind(this));
+ },
+ __innerConnect: function() {
this.cacheAvoidance = qwebirc.util.randHexString(16);
-
+
var r = this.newRequest("n");
r.addEvent("complete", function(o) {
if(!o) {
this.__wsSupported = false;
this.__decideTransport(transports);
}.bind(this));
-
+
var postdata = "nick=" + encodeURIComponent(this.initialNickname);
if($defined(this.options.serverPassword))
postdata+="&password=" + encodeURIComponent(this.options.serverPassword);
nickValidation: null,
dynamicBaseURL: "/",
staticBaseURL: "/",
+ dynamicConfiguration: false,
cloak: false,
logoURL: null,
accountWhoisCommand: null
/* HACK */
qwebirc.global = {
dynamicBaseURL: options.dynamicBaseURL,
+ dynamicConfiguration: options.dynamicConfiguration,
staticBaseURL: options.staticBaseURL,
baseURL: options.baseURL,
- nicknameValidator: $defined(options.nickValidation) ? new qwebirc.irc.NicknameValidator(options.nickValidation) : new qwebirc.irc.DummyNicknameValidator()
+ nicknameValidator: $defined(options.nickValidation) ? new qwebirc.irc.NicknameValidator(options.nickValidation) : new qwebirc.irc.DummyNicknameValidator(),
+ dynamicConfigurationLoaded: false
};
window.addEvent("domready", function() {
return channel;
}
});
+
+qwebirc.ui.requireDynamicConfiguration = function(callback) {
+ if (!qwebirc.global.dynamicConfiguration || qwebirc.global.dynamicConfigurationLoaded) {
+ callback();
+ return;
+ }
+
+ var r = new Request.JSON({url: qwebirc.global.dynamicBaseURL + "configuration", onSuccess: function(data) {
+ qwebirc.global.dynamicBaseURL = data["dynamicBaseURL"];
+
+ callback();
+ }});
+ r.get();
+};