From 1f535ab230801f3f087c40cdb0d33628be3c6b1c Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Thu, 18 Oct 2018 06:15:39 +0500 Subject: [PATCH] add mark promoted twists as promoted --- css/style.css | 13 +++++++++++++ js/interface_localization.js | 15 +++++++++++++++ js/twister_formatpost.js | 3 +++ theme_calm/css/style.css | 13 +++++++++++++ theme_nin/css/style.css | 13 +++++++++++++ theme_nin/sass/_postboard.sass | 12 ++++++++++++ 6 files changed, 69 insertions(+) diff --git a/css/style.css b/css/style.css index c758d00..75bcefd 100644 --- a/css/style.css +++ b/css/style.css @@ -1089,6 +1089,19 @@ ol.toptrends-list { background-color: #FFFFED; } +.post.promoted > .post-data .post-text::after { + font-size: 8px; + color: #FFF; + background-color: #E34F42CC; + margin: 0px 8px; + padding: 2px 4px; + content: attr(data-promoted); +} + +.post.promoted > .post-data:hover .post-text::after { + background-color: #E34F42; +} + .post.open { margin: 10px 0; diff --git a/js/interface_localization.js b/js/interface_localization.js index 1a6530a..196e0aa 100644 --- a/js/interface_localization.js +++ b/js/interface_localization.js @@ -344,6 +344,7 @@ if(preferredLanguage == "en"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -714,6 +715,7 @@ if(preferredLanguage == "es"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Posts normales", "Promoted posts": "Posts promocionados", + 'promoted': 'Promocionado', "Messages": "Mensajes", "Edit profile": "Editar perfil", "Top Trends": "Tendencias principales", @@ -1078,6 +1080,7 @@ if(preferredLanguage == "uk"){ "copy_to_clipboard": "Щоб скопіювати, натисніть Ctrl/Cmd+C а потім Enter щоб закрити", "Normal posts": "Твісти", "Promoted posts": "Спонсори", + 'promoted': 'Promoted', "Messages": "Повідомлення", "Edit profile": "Профіль", "Top Trends": "Тренди", @@ -1445,6 +1448,7 @@ if(preferredLanguage == "zh-CN"){ "copy_to_clipboard": "按 Ctrl/Cmd+C 复制,然后按 Enter 关闭", "Normal posts": "普通推文", "Promoted posts": "推广推文", + 'promoted': 'Promoted', "Messages": "消息", "Edit profile": "编辑个人简介", "Top Trends": "热门趋势", @@ -1816,6 +1820,7 @@ if(preferredLanguage == "nl"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -2181,6 +2186,7 @@ if(preferredLanguage == "it"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -2548,6 +2554,7 @@ if(preferredLanguage == "fr"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -2916,6 +2923,7 @@ if(preferredLanguage == "ru"){ "copy_to_clipboard": "Нажмите Ctrl/Cmd+C для копирования и Enter для закрытия", "Normal posts": "Сообщения пользователей", "Promoted posts": "Рекламные сообщения", + 'promoted': 'Продвигаемый', "Messages": "Сообщения", "Edit profile": "Изменить профиль", "Top Trends": "Топ Трендов", @@ -3289,6 +3297,7 @@ if(preferredLanguage == "de"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Nachrichten", "Edit profile": "Profil bearbeiten", "Top Trends": "Top Trends", @@ -3653,6 +3662,7 @@ if(preferredLanguage == "ja"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -4023,6 +4033,7 @@ if(preferredLanguage == "pt-BR"){ "copy_to_clipboard": "Press Ctrl/Cmd+C to copy then Enter to close", "Normal posts": "Normal posts", "Promoted posts": "Promoted posts", + 'promoted': 'Promoted', "Messages": "Messages", "Edit profile": "Edit profile", "Top Trends": "Top Trends", @@ -4388,6 +4399,7 @@ if(preferredLanguage == "tr"){ "copy_to_clipboard": "Kopyalamak için Ctrl/Cmd+C tuşlarına, kapatmak için Enter tuşuna basınız", "Normal posts": "Normal gönderiler", "Promoted posts": "Desteklenen gönderiler", + 'promoted': 'Promoted', "Messages": "İletiler", "Edit profile": "Profili düzenle", "Top Trends": "Gündem", @@ -4754,6 +4766,7 @@ if(preferredLanguage == "cs"){ "copy_to_clipboard": "Stiskněte Ctrl+C pro zkopírování, a pak Enter pro zavření tohoto okénka.", "Normal posts": "Normální příspěvky", "Promoted posts": "Přednostní příspěvky", + 'promoted': 'Promoted', "Messages": "Zprávy", "Edit profile": "Upravit profil", "Top Trends": "Hlavní trendy", @@ -5133,6 +5146,7 @@ if(preferredLanguage == "cmn"){ "copy_to_clipboard": "按下 Ctrl/Cmd+C 來拷貝,然後按下 Enter 來關閉", "Normal posts": "一般推文", "Promoted posts": "推廣推文", + 'promoted': 'Promoted', "Messages": "訊息", "Edit profile": "編輯側寫", "Top Trends": "熱門趨勢", @@ -5512,6 +5526,7 @@ if(preferredLanguage == "yue"){ "copy_to_clipboard": "撳 Ctrl/Cmd+C 來複製,跟住撳 Enter 來閂埋", "Normal posts": "一般推文", "Promoted posts": "推廣推文", + 'promoted': 'Promoted', "Messages": "口訊", "Edit profile": "編輯個人資料", "Top Trends": "熱門趨勢", diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index dfba9cd..dbde419 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -188,6 +188,9 @@ function postToElem(post, kind, promoted) { elem.find('.post-propagate').remove(); postData.attr('data-promoted', 1); postData.attr('data-screen-name', '!' + username); + } else if (!post.sig_userpost) { // .sig_userpost of promoted twists is empty so let's assume this one is promoted + elem.addClass('promoted') + .find('.post-text').attr('data-promoted', polyglot.t('promoted')); } else { setPostInfoSent(userpost.n, userpost.k, elem.find('.post-info-sent')); if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangSimulate.val) { diff --git a/theme_calm/css/style.css b/theme_calm/css/style.css index 6d538c5..4a428e3 100644 --- a/theme_calm/css/style.css +++ b/theme_calm/css/style.css @@ -1301,6 +1301,19 @@ textarea.splited-post { background-color: #FFFFED; } +.post.promoted > .post-data .post-text::after { + font-size: 10px; + color: #FFF; + background-color: #B2D67B; + margin: 0px 8px; + padding: 2px 4px; + content: attr(data-promoted); +} + +.post.promoted > .post-data:hover .post-text::after { + background-color: #B2D67BCC; +} + .post.open { margin: 10px 0; diff --git a/theme_nin/css/style.css b/theme_nin/css/style.css index 1504e1a..908613a 100644 --- a/theme_nin/css/style.css +++ b/theme_nin/css/style.css @@ -791,6 +791,19 @@ samp { color: #B4C669; } +.post.promoted > .post-data .post-text::after { + font-size: 8px; + color: #FFF; + background-color: #B4C669CC; + margin: 0px 8px; + padding: 2px 4px; + content: attr(data-promoted); +} + +.post.promoted > .post-data:hover .post-text::after { + background-color: #B4C669; +} + /* line 55, ../sass/_postboard.sass */ .post-data { padding: 10px; diff --git a/theme_nin/sass/_postboard.sass b/theme_nin/sass/_postboard.sass index 75f17a2..78d24ed 100755 --- a/theme_nin/sass/_postboard.sass +++ b/theme_nin/sass/_postboard.sass @@ -82,6 +82,18 @@ .post-info-time color: $color-green +.post.promoted + > .post-data + .post-text::after + font-size: 8px + color: #FFF + background-color: #B4C669CC + margin: 0px 8px + padding: 2px 4px + content: attr(data-promoted) + &:hover + .post-text::after + background-color: $color-green .open background: none