From a3413d19d5aed6cc0ea5c35e2467738ecb852495 Mon Sep 17 00:00:00 2001 From: Cory Chaplin Date: Mon, 31 Mar 2014 14:59:33 +0200 Subject: [PATCH] Text themes : extra text theme, documentation and config fix --- client/assets/text_themes/default.json | 16 ++++++++ client/assets/text_themes/symbols.json | 55 ++++++++++++++++++++++++++ client/src/app.js | 4 +- client/src/index.html.tmpl | 1 + client/src/models/network.js | 4 +- 5 files changed, 76 insertions(+), 4 deletions(-) create mode 100644 client/assets/text_themes/symbols.json diff --git a/client/assets/text_themes/default.json b/client/assets/text_themes/default.json index 44dc8db..4df00ac 100644 --- a/client/assets/text_themes/default.json +++ b/client/assets/text_themes/default.json @@ -1,3 +1,19 @@ +/** + * TEXT THEMES SYNTAX + * + * %N: nickname + * %C[digit]: color + * %C: channel + * %J: ident + * %H: host + * %R: realname + * %B: bold + * %I: italic + * %U: underline + * %O: cancel styles + * %T: translated text + **/ + { "client_models_channel_join": "== %N %T", "client_models_channel_part": "== %N %T", diff --git a/client/assets/text_themes/symbols.json b/client/assets/text_themes/symbols.json new file mode 100644 index 0000000..32dac6f --- /dev/null +++ b/client/assets/text_themes/symbols.json @@ -0,0 +1,55 @@ +{ + "client_models_channel_join": "%C14→ %N %T", + "client_models_channel_part": "%C14← %N %T", + "client_models_channel_quit": "%C14← %N %T", + "client_models_channel_kicked": "%C4×%O %N %T", + "client_models_channel_selfkick": "%C4× %T", + "client_models_network_badpassword": "%C4× %T", + "client_views_channel_topic": "%C10ⓘ %T", + "client_models_network_mode": "%C10ⓘ %N %T", + "client_models_network_selfmode": "%C10ⓘ %N %T", + "client_models_network_banned": "%C3×%O %T", + "client_models_network_channel_badkey": "%C4⚠ %T", + "client_models_network_channel_inviteonly": "%C4⚠ %C %T", + "client_models_network_channel_alreadyin": "%C4⚠ %N %T", + "client_models_network_channel_limitreached": "%C4⚠ %C %T", + "client_models_network_nickname_alreadyinuse": "%C4⚠ %T", + "client_models_network_channel_invalid_name": "%C4⚠ %C %T", + "client_models_network_disconnected": "%C4⚠ %T", + "client_models_network_topic": "%C10ⓘ %T", + "client_models_network_channels": "%C14%T", + "client_models_network_idle_and_signon": "%C14%T", + "client_models_network_away": "%C14%T", + "client_models_network_server": "%C14%T", + "client_models_network_idle": "%C14%T", + "client_models_network_nickname_notfound": "%C10ⓘ %T", + "client_models_network_nickname_changed": "%C14ⓘ %N %T", + "client_models_application_applet_notfound": "%C4⚠ %T", + "client_models_application_has_been_invited": "%C7ⓘ %N %T", + "client_models_application_encoding_changed": "%C10ⓘ %T", + "client_models_application_encoding_invalid": "%C4⚠ %T", + "client_models_application_settings_saved": "%C10ⓘ %T", + "client_models_application_ignore_title": "%C10%T:", + "client_models_application_ignore_none": "%C10%T", + "client_models_application_ignore_nick": "%C10%T", + "client_models_application_ignore_stop_notice": "%C10%T", + "client_models_application_ignore_stopped": "%C10%T", + "chanop_privs_needed": "%C4⚠ %T", + "no_such_nick": "%C10ⓘ %N: %T", + "unknown_command": "%C10ⓘ %T", + "motd": "%T", + "privmsg": "%T", + "ctcp": "[CTCP] %T", + "notice": "%C13%T", + "action": "%C13* %T", + "whois_ident": "%C14%N [%N!%J@%H] * %T", + "whois": "%C14%T", + "who": "%N [%N!%J@%H] * %R", + "quit": "%C14%T", + "rejoin": "%T", + "set_setting": "%C10ⓘ %T", + "list_aliases": "%C10ⓘ %T", + "ignored_pattern": "%C10ⓘ %T", + "query": "%T", + "msg": "%T" +} \ No newline at end of file diff --git a/client/src/app.js b/client/src/app.js index e9c241b..1684812 100644 --- a/client/src/app.js +++ b/client/src/app.js @@ -105,7 +105,7 @@ _kiwi.global = { // Entry point to start the kiwi application start: function (opts, callback) { - var continueStart, locale; + var continueStart, locale, igniteTextTheme, text_theme; opts = opts || {}; continueStart = function (locale, s, xhr) { @@ -146,7 +146,7 @@ _kiwi.global = { $.getJSON(opts.base_path + '/assets/locales/' + locale + '.json', continueStart); } - text_theme = _kiwi.global.settings.get('text_theme'); + text_theme = opts.text_theme; if (!text_theme) { $.getJSON(opts.base_path + '/assets/text_themes/default.json', igniteTextTheme); } else { diff --git a/client/src/index.html.tmpl b/client/src/index.html.tmpl index bebcdfd..1d45d51 100644 --- a/client/src/index.html.tmpl +++ b/client/src/index.html.tmpl @@ -544,6 +544,7 @@ opts.translations = data.translations; opts.locale = data.locale; opts.themes = data.themes; + opts.text_theme = data.server_settings.client.settings.text_theme; if (typeof data.kiwi_server !== 'undefined') opts.kiwi_server = data.kiwi_server; diff --git a/client/src/models/network.js b/client/src/models/network.js index 09a226e..974bbf9 100644 --- a/client/src/models/network.js +++ b/client/src/models/network.js @@ -170,8 +170,8 @@ // If not a valid channel name, display a warning if (!that.isChannelName(channel_name)) { - that.panels.server.addMsg('', styleText('client_models_network_channel_invalid_name', {'%T': translateText('client_models_network_channel_invalid_name', []), '%C': channel_name})); - _kiwi.app.message.text(channel_name + ' ' + _kiwi.global.i18n.translate('client_models_network_channel_invalid_name').fetch(channel_name), {timeout: 5000}); + that.panels.server.addMsg('', styleText('client_models_network_channel_invalid_name', {'%T': translateText('client_models_network_channel_invalid_name'), '%C': channel_name})); + _kiwi.app.message.text(channel_name + ' ' + _kiwi.global.i18n.translate('client_models_network_channel_invalid_name').fetch(), {timeout: 5000}); return; } -- 2.25.1