]> jfr.im git - irc/quakenet/qwebirc.git/blobdiff - js/ui/baseui.js
Add feedback support.
[irc/quakenet/qwebirc.git] / js / ui / baseui.js
index 2e82a903c438e9595f4f60c27d5824b47a0e02c6..03f637d6ebb31f762ab7358a17c24035db01f3b8 100644 (file)
@@ -7,13 +7,9 @@ qwebirc.ui.WINDOW_MESSAGES = 6;
 qwebirc.ui.CUSTOM_CLIENT = "custom";
 
 qwebirc.ui.BaseUI = new Class({
-  Implements: [Events, Options],
-  options: {
-    appTitle: "QuakeNet Web IRC",
-    singleWindow: true
-  },
+  Implements: [Events],
   initialize: function(parentElement, windowClass, uiName, options) {
-    this.setOptions(options);
+    this.options = options;
     
     this.windows = {};
     this.clients = {};
@@ -38,7 +34,7 @@ qwebirc.ui.BaseUI = new Class({
     if(!this.firstClient) {
       this.firstClient = true;
       w.addLine("", "qwebirc v" + qwebirc.VERSION);
-      w.addLine("", "Copyright (C) 2008 Chris Porter. All rights reserved.");
+      w.addLine("", "Copyright (C) 2008-2009 Chris Porter. All rights reserved.");
       w.addLine("", "http://webchat.quakenet.org/");
       w.addLine("", "This is BETA quality software, please report bugs to slug@quakenet.org");
     }
@@ -146,12 +142,19 @@ qwebirc.ui.BaseUI = new Class({
       tricked into getting themselves glined
     */
   loginBox: function(callback, initialNickname, initialChannels, autoConnect, autoNick) {
-    qwebirc.ui.GenericLoginBox(this.parentElement, callback, initialNickname, initialChannels, autoConnect, autoNick);
+    qwebirc.ui.GenericLoginBox(this.parentElement, callback, initialNickname, initialChannels, autoConnect, autoNick, this.options.networkName);
   }
 });
 
 qwebirc.ui.StandardUI = new Class({
   Extends: qwebirc.ui.BaseUI,
+  UICommands: [
+    ["Options", "options"],
+    ["Add webchat to your site", "embedded"],
+    ["Privacy policy", "privacy"],
+    ["Feedback", "feedback"],
+    ["About qwebirc", "about"]
+  ],
   initialize: function(parentElement, windowClass, uiName, options) {
     this.parent(parentElement, windowClass, uiName, options);
 
@@ -254,7 +257,7 @@ qwebirc.ui.StandardUI = new Class({
     }.bind(this));
   },
   embeddedWindow: function() {
-    this.addCustomWindow("Embedded Wizard", qwebirc.ui.EmbedWizard, "embeddedwizard");
+    this.addCustomWindow("Embedding wizard", qwebirc.ui.EmbedWizard, "embeddedwizard");
   },
   optionsWindow: function() {
     this.addCustomWindow("Options", qwebirc.ui.OptionsPane, "optionspane", this.uiOptions);
@@ -262,6 +265,12 @@ qwebirc.ui.StandardUI = new Class({
   aboutWindow: function() {
     this.addCustomWindow("About", qwebirc.ui.AboutPane, "aboutpane", this.uiOptions);
   },
+  privacyWindow: function() {
+    this.addCustomWindow("Privacy policy", qwebirc.ui.PrivacyPolicyPane, "privacypolicypane", this.uiOptions);
+  },
+  feedbackWindow: function() {
+    this.addCustomWindow("Feedback", qwebirc.ui.FeedbackPane, "feedbackpane", this.uiOptions);
+  },
   urlDispatcher: function(name) {
     if(name == "embedded")
       return ["a", this.embeddedWindow.bind(this)];
@@ -353,6 +362,6 @@ qwebirc.ui.NewLoginUI = new Class({
       callbackfn(args);
     };
     
-    qwebirc.ui.GenericLoginBox(w.lines, callback, initialNickname, initialChannels, autoConnect, autoNick);
+    qwebirc.ui.GenericLoginBox(w.lines, callback, initialNickname, initialChannels, autoConnect, autoNick, this.options.networkName);
   }
 });