From: Jack Allnutt Date: Fri, 25 Oct 2013 13:35:18 +0000 (+0100) Subject: Auto-generate 'thumbnail' previews of themes in settings applet X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=5664b269ad3bf0a5cfb52e21f16e8728563563fc;p=KiwiIRC.git Auto-generate 'thumbnail' previews of themes in settings applet --- diff --git a/client/assets/src/app.js b/client/assets/src/app.js index 7002e0b..d70e0ab 100644 --- a/client/assets/src/app.js +++ b/client/assets/src/app.js @@ -116,7 +116,7 @@ _kiwi.global = { if (opts.server_settings.client.themes) { _.each(opts.server_settings.client.themes, function (theme) { - link = $.parseHTML(''); + link = $.parseHTML(''); link.disabled = true; $(link).appendTo($('head')); }); diff --git a/client/assets/src/applets/settings.js b/client/assets/src/applets/settings.js index 32bf855..6fb7cb1 100644 --- a/client/assets/src/applets/settings.js +++ b/client/assets/src/applets/settings.js @@ -8,24 +8,28 @@ }, initialize: function (options) { - var text = { - tabs: _kiwi.global.i18n.translate('client_applets_settings_channelview_tabs').fetch(), - list: _kiwi.global.i18n.translate('client_applets_settings_channelview_list').fetch(), - large_amounts_of_chans: _kiwi.global.i18n.translate('client_applets_settings_channelview_list_notice').fetch(), - join_part: _kiwi.global.i18n.translate('client_applets_settings_notification_joinpart').fetch(), - timestamps: _kiwi.global.i18n.translate('client_applets_settings_timestamp').fetch(), - mute: _kiwi.global.i18n.translate('client_applets_settings_notification_sound').fetch(), - emoticons: _kiwi.global.i18n.translate('client_applets_settings_emoticons').fetch(), - scroll_history: _kiwi.global.i18n.translate('client_applets_settings_history_length').fetch(), - languages: _kiwi.app.translations, - default_client: _kiwi.global.i18n.translate('client_applets_settings_default_client').fetch(), - make_default: _kiwi.global.i18n.translate('client_applets_settings_default_client_enable').fetch(), - locale_restart_needed: _kiwi.global.i18n.translate('client_applets_settings_locale_restart_needed').fetch(), - default_note: _kiwi.global.i18n.translate('client_applets_settings_default_client_notice').fetch('chrome://settings/handlers'), - html5_notifications: _kiwi.global.i18n.translate('client_applets_settings_html5_notifications').fetch(), - enable_notifications: _kiwi.global.i18n.translate('client_applets_settings_enable_notifications').fetch() - }; - this.$el = $(_.template($('#tmpl_applet_settings').html().trim(), text)); + var template_vars = { + tabs: _kiwi.global.i18n.translate('client_applets_settings_channelview_tabs').fetch(), + list: _kiwi.global.i18n.translate('client_applets_settings_channelview_list').fetch(), + large_amounts_of_chans: _kiwi.global.i18n.translate('client_applets_settings_channelview_list_notice').fetch(), + join_part: _kiwi.global.i18n.translate('client_applets_settings_notification_joinpart').fetch(), + timestamps: _kiwi.global.i18n.translate('client_applets_settings_timestamp').fetch(), + mute: _kiwi.global.i18n.translate('client_applets_settings_notification_sound').fetch(), + emoticons: _kiwi.global.i18n.translate('client_applets_settings_emoticons').fetch(), + scroll_history: _kiwi.global.i18n.translate('client_applets_settings_history_length').fetch(), + languages: _kiwi.app.translations, + default_client: _kiwi.global.i18n.translate('client_applets_settings_default_client').fetch(), + make_default: _kiwi.global.i18n.translate('client_applets_settings_default_client_enable').fetch(), + locale_restart_needed: _kiwi.global.i18n.translate('client_applets_settings_locale_restart_needed').fetch(), + default_note: _kiwi.global.i18n.translate('client_applets_settings_default_client_notice').fetch('chrome://settings/handlers'), + html5_notifications: _kiwi.global.i18n.translate('client_applets_settings_html5_notifications').fetch(), + enable_notifications: _kiwi.global.i18n.translate('client_applets_settings_enable_notifications').fetch(), + theme_thumbnails: _.map(_kiwi.app.server_settings.client.themes, function (theme) { + return _.template($('#tmpl_theme_thumbnail').html().trim(), theme); + }) + }; + + this.$el = $(_.template($('#tmpl_applet_settings').html().trim(), template_vars)); if (!navigator.registerProtocolHandler) { this.$el.find('.protocol_handler').remove(); diff --git a/client/assets/src/index.html.tmpl b/client/assets/src/index.html.tmpl index 61c6efc..ba206e4 100644 --- a/client/assets/src/index.html.tmpl +++ b/client/assets/src/index.html.tmpl @@ -173,28 +173,22 @@ + +