From d26a40c6801e236a56373edf27ac92fc39b70b7f Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Sun, 10 Nov 2013 18:47:17 +0000 Subject: [PATCH] Make the window title configurable --- client/src/app.js | 3 +++ client/src/index.html.tmpl | 2 +- client/src/views/application.js | 2 +- config.example.js | 5 +++++ server/httphandler.js | 7 +++++++ 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/client/src/app.js b/client/src/app.js index c6eba1a..7fd8e80 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -133,6 +133,9 @@ _kiwi.global = { _kiwi.global.settings = _kiwi.model.DataStore.instance('kiwi.settings'); _kiwi.global.settings.load(); + // Set the window title + window.document.title = opts.server_settings.window_title || 'Kiwi IRC'; + locale = _kiwi.global.settings.get('locale'); if (!locale) { $.getJSON(opts.base_path + '/assets/locales/magic.json', continueStart); diff --git a/client/src/index.html.tmpl b/client/src/index.html.tmpl index e31a71e..aeed33d 100644 --- a/client/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -5,7 +5,7 @@ - KiwiIRC + Kiwi IRC diff --git a/client/src/views/application.js b/client/src/views/application.js index 2f0af27..1e09500 100644 --- a/client/src/views/application.js +++ b/client/src/views/application.js @@ -192,7 +192,7 @@ _kiwi.view.Application = Backbone.View.extend({ var tmr; var has_focus = true; var state = 0; - var default_title = 'Kiwi IRC'; + var default_title = _kiwi.app.server_settings.window_title; var title = 'Kiwi IRC'; this.setTitle = function (new_title) { diff --git a/config.example.js b/config.example.js index a86fdb1..355cc02 100644 --- a/config.example.js +++ b/config.example.js @@ -78,6 +78,11 @@ conf.default_encoding = 'utf8'; */ //conf.default_gecos = 'Web IRC Client'; +/* +* Window title +*/ +conf.window_title = 'Kiwi IRC'; + /* * Client side plugins diff --git a/server/httphandler.js b/server/httphandler.js index ee8b7e1..0aef2c0 100644 --- a/server/httphandler.js +++ b/server/httphandler.js @@ -306,6 +306,13 @@ function generateSettings(request, debug, callback) { vars.server_settings.client = config.get().client; } + // Get the window title + if (config.get().window_title) { + vars.server_settings.window_title = config.get().window_title; + } else { + vars.server_settings.window_title = 'Kiwi IRC'; + } + // Any client plugins? if (config.get().client_plugins && config.get().client_plugins.length > 0) { vars.client_plugins = config.get().client_plugins; -- 2.25.1