Browse Source

add checkbox to skip modal inline warning

readme-update
Simon Grim 8 years ago
parent
commit
1b1ba77e28
  1. 5
      css/style.css
  2. 3
      home.html
  3. 21
      js/interface_common.js
  4. 13
      js/interface_localization.js
  5. 5
      js/options.js
  6. 5
      theme_calm/css/style.css
  7. 5
      theme_nin/css/style.css

5
css/style.css

@ -1663,6 +1663,11 @@ ol.toptrends-list {
font-size: 0.8em; font-size: 0.8em;
} }
.inline-warn .options {
font-size: 0.8em;
text-align: right;
}
/************************************* /*************************************
******** DIRECT MESSAGES MODAL ******* ******** DIRECT MESSAGES MODAL *******
**************************************/ **************************************/

3
home.html

@ -430,6 +430,9 @@
<div class="inline-warn"> <div class="inline-warn">
<div class="close">&times;</div> <div class="close">&times;</div>
<div class="text"></div> <div class="text"></div>
<div class="options">
<div><input type="checkbox" class="never-again" /><span>don't show it again</span></div>
</div>
</div> </div>
</div> </div>

21
js/interface_common.js

@ -63,10 +63,13 @@ function openModal(modal) {
else else
modal.content = modal.self.find('.modal-content'); modal.content = modal.self.find('.modal-content');
if (modal.warn) if (modal.warn && modal.warn.name && modal.warn.text)
twister.tmpl.modalComponentWarn.clone(true) twister.tmpl.modalComponentWarn.clone(true)
.attr('data-warn-name', modal.warn.name)
.toggle(!$.Options.get('skipWarn' + modal.warn.name))
.insertBefore(modal.content) .insertBefore(modal.content)
.find('.text').html(modal.warn) .find('.text').html(modal.warn.text)
.siblings('.options').find('.never-again + span').text(polyglot.t('do_not_show_it_again'))
; ;
modal.self.appendTo('body').fadeIn('fast'); // FIXME maybe it's better to append it to some container inside body modal.self.appendTo('body').fadeIn('fast'); // FIXME maybe it's better to append it to some container inside body
@ -78,7 +81,8 @@ function openModal(modal) {
modal.drapper = $('<div>').appendTo(twister.html.detached); // here modal goes instead detaching modal.drapper = $('<div>').appendTo(twister.html.detached); // here modal goes instead detaching
modal.content.outerHeight(modal.self.height() - modal.self.find('.modal-header').outerHeight() modal.content.outerHeight(modal.self.height() - modal.self.find('.modal-header').outerHeight()
- modal.self.find('.inline-warn').outerHeight()); - modal.self.find('.inline-warn').outerHeight()
* (modal.warn && !$.Options.get('skipWarn' + modal.warn.name) ? 1 : 0));
var windowHeight = $(window).height(); var windowHeight = $(window).height();
if (modal.self.outerHeight() > windowHeight) { if (modal.self.outerHeight() > windowHeight) {
@ -618,7 +622,10 @@ function openFollowersModal(peerAlias) {
classAdd: 'followers-modal', classAdd: 'followers-modal',
content: twister.tmpl.followersList.clone(true), content: twister.tmpl.followersList.clone(true),
title: title, title: title,
warn: txtAlert warn: {
name: 'FollowersNotAll',
text: txtAlert
}
}); });
appendFollowersToElem(modal.content.find('ol'), followers); appendFollowersToElem(modal.content.find('ol'), followers);
@ -2484,6 +2491,12 @@ function initInterfaceCommon() {
} }
} }
); );
twister.tmpl.modalComponentWarn.find('.options .never-again').on('change',
function(event) {
$.Options.set('skipWarn' + $(event.target).closest('.inline-warn')
.attr('data-warn-name'), event.target.checked); // e.g. 'skipWarnFollowersNotAll'
}
);
twister.tmpl.commonDMsList = extractTemplate('#template-direct-messages-list'); twister.tmpl.commonDMsList = extractTemplate('#template-direct-messages-list');
twister.tmpl.uriShortenerMC = extractTemplate('#template-uri-shortener-modal-content'); twister.tmpl.uriShortenerMC = extractTemplate('#template-uri-shortener-modal-content');
twister.tmpl.uriShortenerMC twister.tmpl.uriShortenerMC

13
js/interface_localization.js

@ -74,6 +74,7 @@ if(preferredLanguage == "en"){
"display_mentions": "Display mentions", "display_mentions": "Display mentions",
"Display retransmissions": "Display retransmissions", "Display retransmissions": "Display retransmissions",
"DNS to obtain list of peers:": "DNS to obtain list of peers:", "DNS to obtain list of peers:": "DNS to obtain list of peers:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Downloading block chain, please wait before continuing (block chain is %{days} days old).", "downloading_block_chain": "Downloading block chain, please wait before continuing (block chain is %{days} days old).",
"download_posts_status": "Downloaded %{portion} posts", // Downloaded 10/30 posts "download_posts_status": "Downloaded %{portion} posts", // Downloaded 10/30 posts
"Enable": "Enable", "Enable": "Enable",
@ -416,6 +417,7 @@ if(preferredLanguage == "es"){
"display_mentions": "Visualización de menciones", "display_mentions": "Visualización de menciones",
"Display retransmissions": "Visualización de retransmisiones", "Display retransmissions": "Visualización de retransmisiones",
"DNS to obtain list of peers:": "DNS para obtener la lista de los pares:", "DNS to obtain list of peers:": "DNS para obtener la lista de los pares:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Descarga de la cadena de bloques, por favor espere antes de continuar (la cadena de bloques esta %{days} días).", "downloading_block_chain": "Descarga de la cadena de bloques, por favor espere antes de continuar (la cadena de bloques esta %{days} días).",
"download_posts_status": "Post %{portion} descargados", // Downloaded 10/30 posts "download_posts_status": "Post %{portion} descargados", // Downloaded 10/30 posts
"Enable": "Permitir", "Enable": "Permitir",
@ -755,6 +757,7 @@ if(preferredLanguage == "uk"){
"display_mentions": "Показати сповіщення", "display_mentions": "Показати сповіщення",
"Display retransmissions": "Показати пересилання", "Display retransmissions": "Показати пересилання",
"DNS to obtain list of peers:": "DNS для отримання пірів:", "DNS to obtain list of peers:": "DNS для отримання пірів:",
"do_not_show_it_again": "don't show it again",
"dns address": "адреса DNS", "dns address": "адреса DNS",
"downloading_block_chain": "Завантаження ланцюга блоків, будь ласка, зачекайте перед продовженням (ланцюг блоків віком %{days} днів).", "downloading_block_chain": "Завантаження ланцюга блоків, будь ласка, зачекайте перед продовженням (ланцюг блоків віком %{days} днів).",
"download_posts_status": "Завантажено %{portion} твістів", // Downloaded 10/30 posts "download_posts_status": "Завантажено %{portion} твістів", // Downloaded 10/30 posts
@ -1092,6 +1095,7 @@ if(preferredLanguage == "zh-CN"){
"display_mentions": "显示", "display_mentions": "显示",
"Display retransmissions": "显示转发", "Display retransmissions": "显示转发",
"DNS to obtain list of peers:": "用DNS获取节点列表:", "DNS to obtain list of peers:": "用DNS获取节点列表:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "区块链下载中,请等待下载完成(区块链仍落后 %{days} 天)。", "downloading_block_chain": "区块链下载中,请等待下载完成(区块链仍落后 %{days} 天)。",
"download_posts_status": "已下载 %{portion} 推文", // Downloaded 10/30 posts "download_posts_status": "已下载 %{portion} 推文", // Downloaded 10/30 posts
"Enable": "开启", "Enable": "开启",
@ -1434,6 +1438,7 @@ if(preferredLanguage == "nl"){
"display_mentions": "Toon vermeldingen", "display_mentions": "Toon vermeldingen",
"Display retransmissions": "Toon retransmissions", "Display retransmissions": "Toon retransmissions",
"DNS to obtain list of peers:": "DNS om peers lijst op te halen:", "DNS to obtain list of peers:": "DNS om peers lijst op te halen:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Bezig met downloaden block chain, wacht a.u.b. voordat je doorgaat (block chain is %{days} dagen oud).", "downloading_block_chain": "Bezig met downloaden block chain, wacht a.u.b. voordat je doorgaat (block chain is %{days} dagen oud).",
"download_posts_status": "%{portion} berichten gedownload", // Downloaded 10/30 posts "download_posts_status": "%{portion} berichten gedownload", // Downloaded 10/30 posts
"Enable": "Activeren", "Enable": "Activeren",
@ -1773,6 +1778,7 @@ if(preferredLanguage == "it"){
"display_mentions": "Mostra le menzioni", "display_mentions": "Mostra le menzioni",
"Display retransmissions": "Mostra Ripubblicazioni", "Display retransmissions": "Mostra Ripubblicazioni",
"DNS to obtain list of peers:": "DNS per la lista dei nodi:", "DNS to obtain list of peers:": "DNS per la lista dei nodi:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Scaricamento della catena di blocchi in corso, attendere prego (la catena risale a %{days} giorni fa).", "downloading_block_chain": "Scaricamento della catena di blocchi in corso, attendere prego (la catena risale a %{days} giorni fa).",
"download_posts_status": "Scaricati %{portion} messaggi", // Downloaded 10/30 posts "download_posts_status": "Scaricati %{portion} messaggi", // Downloaded 10/30 posts
"Enable": "Attivato", "Enable": "Attivato",
@ -2110,6 +2116,7 @@ if(preferredLanguage == "fr"){
"display_mentions": "Afficher les mentions", "display_mentions": "Afficher les mentions",
"Display retransmissions": "Afficher les retransmissions", "Display retransmissions": "Afficher les retransmissions",
"DNS to obtain list of peers:": "DNS où obtenir une liste des pairs:", "DNS to obtain list of peers:": "DNS où obtenir une liste des pairs:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Téléchargement de la chaîne de blocs, veuillez patienter avant de continuer (la chaîne de blocs a %{days} jours de retard).", "downloading_block_chain": "Téléchargement de la chaîne de blocs, veuillez patienter avant de continuer (la chaîne de blocs a %{days} jours de retard).",
"download_posts_status": "%{portion} billets téléchargés", // Downloaded 10/30 posts "download_posts_status": "%{portion} billets téléchargés", // Downloaded 10/30 posts
"Enable": "Activer", "Enable": "Activer",
@ -2451,6 +2458,7 @@ if(preferredLanguage == "ru"){
"display_mentions": "Показать упоминания", "display_mentions": "Показать упоминания",
"Display retransmissions": "Показать репосты", "Display retransmissions": "Показать репосты",
"DNS to obtain list of peers:": "DNS адрес для получения пиров:", "DNS to obtain list of peers:": "DNS адрес для получения пиров:",
"do_not_show_it_again": "не показывать больше",
"downloading_block_chain": "Загрузка цепочки блоков, пожалуйста подождите, (Цепочка блоков устарела на %{days} дней).", "downloading_block_chain": "Загрузка цепочки блоков, пожалуйста подождите, (Цепочка блоков устарела на %{days} дней).",
"download_posts_status": "Загружено %{portion} постов", // Downloaded 10/30 posts "download_posts_status": "Загружено %{portion} постов", // Downloaded 10/30 posts
"Enable": "Включено", "Enable": "Включено",
@ -2794,6 +2802,7 @@ if(preferredLanguage == "de"){
"display_mentions": "Zeige Erwähnungen", // Ist das richtig? Ich weiß nicht, in welchem Zusammenhang das benutzt wird. "display_mentions": "Zeige Erwähnungen", // Ist das richtig? Ich weiß nicht, in welchem Zusammenhang das benutzt wird.
"Display retransmissions": "Weiterleitungen anzeigen", "Display retransmissions": "Weiterleitungen anzeigen",
"DNS to obtain list of peers:": "DNS um Peer-Liste abzurufen:", "DNS to obtain list of peers:": "DNS um Peer-Liste abzurufen:",
"do_not_show_it_again": "don't show it again",
"dns address": "DNS-Adresse", "dns address": "DNS-Adresse",
"downloading_block_chain": "Block-Chain wird heruntergeladen, bitte warten (Block-Chain ist %{days} Tage alt).", "downloading_block_chain": "Block-Chain wird heruntergeladen, bitte warten (Block-Chain ist %{days} Tage alt).",
"download_posts_status": "%{portion} Posts heruntergeladen", // Downloaded 10/30 posts "download_posts_status": "%{portion} Posts heruntergeladen", // Downloaded 10/30 posts
@ -3135,6 +3144,7 @@ if(preferredLanguage == "ja"){
"display_mentions": "メンションを表示する", "display_mentions": "メンションを表示する",
"Display retransmissions": "リトランスミットを表示する", "Display retransmissions": "リトランスミットを表示する",
"DNS to obtain list of peers:": "ピア取得用のDNS:", "DNS to obtain list of peers:": "ピア取得用のDNS:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "ブロックチェインをダウンロードしています。しばらくお待ちください。(ブロックチェーンは%{days}日送れています)", "downloading_block_chain": "ブロックチェインをダウンロードしています。しばらくお待ちください。(ブロックチェーンは%{days}日送れています)",
"download_posts_status": "ダウンロード済みの投稿 %{portion}", // Downloaded 10/30 posts "download_posts_status": "ダウンロード済みの投稿 %{portion}", // Downloaded 10/30 posts
"Enable": "有効", "Enable": "有効",
@ -3472,6 +3482,7 @@ if(preferredLanguage == "pt-BR"){
"display_mentions": "Exibir menções", "display_mentions": "Exibir menções",
"Display retransmissions": "Exibir retransmissões", "Display retransmissions": "Exibir retransmissões",
"DNS to obtain list of peers:": "DNS para obter a lista de nós:", "DNS to obtain list of peers:": "DNS para obter a lista de nós:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Baixando a Cadeia de Blocos, por favor aguarde (A Cadeia de Blocos está %{days} dias desatualizada).", "downloading_block_chain": "Baixando a Cadeia de Blocos, por favor aguarde (A Cadeia de Blocos está %{days} dias desatualizada).",
"download_posts_status": "%{portion} postagens carregadas.", // Downloaded 10/30 posts "download_posts_status": "%{portion} postagens carregadas.", // Downloaded 10/30 posts
"Enable": "Habilitado", "Enable": "Habilitado",
@ -3813,6 +3824,7 @@ if(preferredLanguage == "tr"){
"display_mentions": "Bahsedenleri göster", "display_mentions": "Bahsedenleri göster",
"Display retransmissions": "Tekrar iletimleri göster", "Display retransmissions": "Tekrar iletimleri göster",
"DNS to obtain list of peers:": "Eş listesini almak için DNS:", "DNS to obtain list of peers:": "Eş listesini almak için DNS:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Blok zinciri indiriliyor, devam edebilmek için lütfen bekleyiniz (blok zinciri %{days} günlük).", "downloading_block_chain": "Blok zinciri indiriliyor, devam edebilmek için lütfen bekleyiniz (blok zinciri %{days} günlük).",
"download_posts_status": "Göderilerin indirilme oranı: %{portion}", // Downloaded 10/30 posts "download_posts_status": "Göderilerin indirilme oranı: %{portion}", // Downloaded 10/30 posts
"Enable": "Kullanılabilir", "Enable": "Kullanılabilir",
@ -4151,6 +4163,7 @@ if(preferredLanguage == "cs"){
"display_mentions": "Zobrazit zmínky", "display_mentions": "Zobrazit zmínky",
"Display retransmissions": "Zobrazit přeposlané", "Display retransmissions": "Zobrazit přeposlané",
"DNS to obtain list of peers:": "DNS pro načtení seznamu uzlů:", "DNS to obtain list of peers:": "DNS pro načtení seznamu uzlů:",
"do_not_show_it_again": "don't show it again",
"downloading_block_chain": "Stahuji blockchain, prosím počkejte (blockchain je %{days} dnů starý).", "downloading_block_chain": "Stahuji blockchain, prosím počkejte (blockchain je %{days} dnů starý).",
"download_posts_status": "Staženo %{portion} příspěvků", // Downloaded 10/30 posts "download_posts_status": "Staženo %{portion} příspěvků", // Downloaded 10/30 posts
"Enable": "Zapnuto", "Enable": "Zapnuto",

5
js/options.js

@ -309,6 +309,11 @@ function twisterOptions() {
name: 'WebTorrentAutoDownload', name: 'WebTorrentAutoDownload',
valDefault: 'enable' valDefault: 'enable'
}); });
this.add({
name: 'skipWarnFollowersNotAll',
type: 'checkbox',
valDefault: false
});
} }
twisterOptions.prototype.add = function (option) { twisterOptions.prototype.add = function (option) {

5
theme_calm/css/style.css

@ -2036,6 +2036,11 @@ textarea.splited-post {
font-size: 0.8em; font-size: 0.8em;
} }
.inline-warn .options {
font-size: 0.8em;
text-align: right;
}
/************************************* /*************************************
******** DIRECT MESSAGES MODAL ******* ******** DIRECT MESSAGES MODAL *******
**************************************/ **************************************/

5
theme_nin/css/style.css

@ -2600,6 +2600,11 @@ ol.toptrends-list a:hover {
font-size: 0.8em; font-size: 0.8em;
} }
.inline-warn .options {
font-size: 0.8em;
text-align: right;
}
/************************************* /*************************************
*********** CONFIRM POPUP ************ *********** CONFIRM POPUP ************
**************************************/ **************************************/

Loading…
Cancel
Save