Switch to using a table of config options (will allow for easier configuration later)

Thu, 18 Mar 2010 15:49:52 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 18 Mar 2010 15:49:52 +0000
changeset 16
ebc14a22a0c1
parent 15
071c513502d1
child 17
6344a9a20da2

Switch to using a table of config options (will allow for easier configuration later)

js/supportchat.js file | annotate | diff | comparison | revisions
--- a/js/supportchat.js	Thu Mar 18 15:49:13 2010 +0000
+++ b/js/supportchat.js	Thu Mar 18 15:49:52 2010 +0000
@@ -1,8 +1,13 @@
 /* Config */
-var LOGIN_DOMAIN = "anon.localhost";
-var BOSH_URL = "/http-bind";
 
-/*** Helper functions */
+var support_config = {
+	login_domain: "anon.localhost",
+	bosh_url: "/http-bind",
+	team_rooms: {
+		"Sales": "sales@support.localhost",
+		"Technical": "technical@support.localhost"
+	}
+};
 
 /*** XMPP handling */
 var conn = null;
@@ -24,11 +29,11 @@
 /* Initiate the connection to the XMPP server */
 function start_connection()
 {
-	conn = new Strophe.Connection(BOSH_URL);
+	conn = new Strophe.Connection(support_config.bosh_url);
 	var ret = true;
 	try
 	{
-		conn.connect(LOGIN_DOMAIN, null, handle_connection_status, 50);
+		conn.connect(support_config.login_domain, null, handle_connection_status, 50);
 	}
 	catch(e)
 	{

mercurial