From 9f371fd118e5d74e54985a2fb21a286cc78c4bdb Mon Sep 17 00:00:00 2001 From: Amine Date: Tue, 21 Apr 2020 20:25:06 +0000 Subject: Switch back to original Telegram, add Telegram React (#132) --- uncompressed/telegram-react/README.md | 7 ++ uncompressed/telegram-react/icon.png | Bin 0 -> 15968 bytes uncompressed/telegram-react/icon.svg | 27 ++++++ uncompressed/telegram-react/index.js | 4 + uncompressed/telegram-react/package.json | 14 +++ uncompressed/telegram-react/webview.js | 19 ++++ uncompressed/telegram/README.md | 8 +- uncompressed/telegram/package.json | 6 +- uncompressed/telegram/service.css | 151 +++++++++++++++++++++++++++++++ uncompressed/telegram/webview.js | 21 +++-- 10 files changed, 242 insertions(+), 15 deletions(-) create mode 100644 uncompressed/telegram-react/README.md create mode 100644 uncompressed/telegram-react/icon.png create mode 100644 uncompressed/telegram-react/icon.svg create mode 100644 uncompressed/telegram-react/index.js create mode 100644 uncompressed/telegram-react/package.json create mode 100644 uncompressed/telegram-react/webview.js create mode 100644 uncompressed/telegram/service.css (limited to 'uncompressed') diff --git a/uncompressed/telegram-react/README.md b/uncompressed/telegram-react/README.md new file mode 100644 index 0000000..fbd7ca6 --- /dev/null +++ b/uncompressed/telegram-react/README.md @@ -0,0 +1,7 @@ +# Telegram for Ferdi + +This is the official Ferdi recipe for Telegram + +### How to create your own Franz recipes: + +- [Read the documentation](https://github.com/getferdi/recipes/tree/master/docs) diff --git a/uncompressed/telegram-react/icon.png b/uncompressed/telegram-react/icon.png new file mode 100644 index 0000000..3a3135e Binary files /dev/null and b/uncompressed/telegram-react/icon.png differ diff --git a/uncompressed/telegram-react/icon.svg b/uncompressed/telegram-react/icon.svg new file mode 100644 index 0000000..5cfd9c5 --- /dev/null +++ b/uncompressed/telegram-react/icon.svg @@ -0,0 +1,27 @@ + + + + telegram + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/uncompressed/telegram-react/index.js b/uncompressed/telegram-react/index.js new file mode 100644 index 0000000..6343150 --- /dev/null +++ b/uncompressed/telegram-react/index.js @@ -0,0 +1,4 @@ +"use strict"; + +module.exports = Franz => Franz; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlbGVncmFtL2luZGV4LmpzIl0sIm5hbWVzIjpbIm1vZHVsZSIsImV4cG9ydHMiLCJGcmFueiJdLCJtYXBwaW5ncyI6Ijs7QUFBQUEsT0FBT0MsT0FBUCxHQUFpQkMsU0FBU0EsS0FBMUIiLCJmaWxlIjoidGVsZWdyYW0vaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJtb2R1bGUuZXhwb3J0cyA9IEZyYW56ID0+IEZyYW56O1xuIl19 \ No newline at end of file diff --git a/uncompressed/telegram-react/package.json b/uncompressed/telegram-react/package.json new file mode 100644 index 0000000..8a00a5b --- /dev/null +++ b/uncompressed/telegram-react/package.json @@ -0,0 +1,14 @@ +{ + "id": "telegram-react", + "name": "Telegram React", + "version": "1.0.0", + "description": "Telegram React", + "main": "index.js", + "author": "Amine Mouafik ", + "license": "MIT", + "config": { + "serviceURL": "https://evgeny-nadymov.github.io/telegram-react/", + "hasDirectMessages": true, + "hasNotificationSound": true + } +} diff --git a/uncompressed/telegram-react/webview.js b/uncompressed/telegram-react/webview.js new file mode 100644 index 0000000..1727953 --- /dev/null +++ b/uncompressed/telegram-react/webview.js @@ -0,0 +1,19 @@ +"use strict"; + +const path = require("path"); + +module.exports = Franz => { + const getMessages = function getMessages() { + let count = 0; + const elements = document.querySelectorAll(".dialog-badge-text"); + if (elements) { + for (let i = 0; i < elements.length; i += 1) { + if (elements[i].innerHTML !== 0) { + count += parseInt(elements[i].innerHTML); + } + } + } + Franz.setBadge(count); + }; + Franz.loop(getMessages); +}; diff --git a/uncompressed/telegram/README.md b/uncompressed/telegram/README.md index fbd7ca6..7a192ab 100644 --- a/uncompressed/telegram/README.md +++ b/uncompressed/telegram/README.md @@ -1,7 +1,5 @@ -# Telegram for Ferdi - -This is the official Ferdi recipe for Telegram +# Telegram for Franz +This is the official Franz recipe for Telegram ### How to create your own Franz recipes: - -- [Read the documentation](https://github.com/getferdi/recipes/tree/master/docs) +* [Read the documentation](https://github.com/meetfranz/plugins) diff --git a/uncompressed/telegram/package.json b/uncompressed/telegram/package.json index ce21700..a169b8d 100644 --- a/uncompressed/telegram/package.json +++ b/uncompressed/telegram/package.json @@ -1,13 +1,13 @@ { "id": "telegram", "name": "Telegram", - "version": "2.0.0", + "version": "3.0.0", "description": "Telegram", "main": "index.js", - "author": "Amine Mouafik ", + "author": "Stefan Malzner ", "license": "MIT", "config": { - "serviceURL": "https://evgeny-nadymov.github.io/telegram-react/", + "serviceURL": "https://web.telegram.org", "hasDirectMessages": true, "hasNotificationSound": true } diff --git a/uncompressed/telegram/service.css b/uncompressed/telegram/service.css new file mode 100644 index 0000000..69291a1 --- /dev/null +++ b/uncompressed/telegram/service.css @@ -0,0 +1,151 @@ +.tg_head_split { + max-width: 100% !important; +} + +.im_page_wrap { + max-width: 100% !important; +} + +.im_dialogs_col_wrap { + width: 320px !important; +} + +.im_history_col_wrap { + width: calc(100% - 320px) !important; +} + +.im_message_wrap { + max-width: inherit !important; +} + +.im_message_body { + max-width: 580px !important; +} + +body.darkTheme, +.darkTheme .modal-content { + color: #bbb !important; + background: #252525 !important; +} +.darkTheme a.tg_checkbox { + color: #bbb !important; +} +.darkTheme .im_page_wrap { + /*background color of contentwrapper under header*/ + + background-color: #303030 !important; + border-left: 1px solid #4d4d4d !important; + border-right: 1px solid #4d4d4d !important; + border-bottom: 1px solid #4d4d4d !important; + box-shadow: none; +} +.darkTheme .im_message_body, +.darkTheme .im_attach, +.darkTheme .im_media_attach, +.darkTheme .im_record, +.darkTheme .im_message_document_thumbed { + background: inherit !important; +} +.darkTheme .im_dialog_peer { + /*peer nickname unselected*/ + + color: #bbb !important; +} +.darkTheme .contacts_modal_members_list a.contacts_modal_contact { + /*nicknames in contactlist via hamburger menu*/ + + color: #bbb; +} +.darkTheme .active a.im_dialog { + /*selected peer */ + + background-color: #4d4d4d !important; +} +.darkTheme .tg_head_split, +.darkTheme .md_modal_head { + /*page header block*/ + + background-color: #4d4d4d !important; +} +.darkTheme .dropdown.open .tg_head_btn, +.darkTheme .tg_head_btn:hover { + background: #4d4d4d !important; +} +.darkTheme .form-control { + /*input field*/ + + background-color: #0e0e0e !important; + color: #bbb !important; +} +.darkTheme .composer_rich_textarea { + background: #303030 !important; + border-color: #bbb !important; +} +.darkTheme .im_dialogs_col_wrap { + /*contactlist right border*/ + + border-right: 2px solid #4d4d4d; +} +.darkTheme .im_dialogs_col .nano > .nano-pane > .nano-slider { + /*scrollbarbutton when hover*/ + + background-color: #4d4d4d !important; +} +.darkTheme .tg_head_split { + background-color: #151515; +} +.darkTheme .im_submit { + color: #4d4d4d; +} +.darkTheme .im_message_mymention { + background: #1d1d1d; +} +.darkTheme .im_message_focus .im_message_outer_wrap { + background-color: #4d4d4d; +} +.darkTheme .im_message_selected .im_message_outer_wrap { + background: #4d4d4d; +} +.darkTheme a:hover { + background-color: #282828 !important; +} +.darkTheme .im_message_unread_split { + background: #4d4d4d; +} +@keyframes im_message_focus_fade { + 0% { + background-color: #2d2d2d; + } +} +.darkTheme .btn-primary { + background-color: #4d4d4d; +} +.darkTheme .im_history_select_active .im_message_outer_wrap:hover { + background: #4d4d4d; +} +.darkTheme .im_dialog_chat_from_wrap, +.darkTheme .im_dialog_message_service { + color: #6ac; +} +.darkTheme .composer_rich_textarea, +.darkTheme .composer_textarea { + box-shadow: 0px 3px 1px #ddd; +} +.darkTheme .composer_rich_textarea:focus { + box-shadow: 0px 3px 1px #ddd !important; +} +.darkTheme .tg_head_logo_dropdown .dropdown-menu > li > a { + color: #ddd; +} +.darkTheme .btn-primary.disabled, +.darkTheme .btn-primary[disabled] { + background: #4d4d4d none repeat scroll 0% 0%; +} +/*emoji*/ + +.darkTheme .composer_emoji_tooltip, +.darkTheme .icon-tooltip-tail, +.darkTheme .dropdown-menu { + background-color: #4d4d4d !important; + border-color: #5d5d5d; +} diff --git a/uncompressed/telegram/webview.js b/uncompressed/telegram/webview.js index 1727953..6610c7c 100644 --- a/uncompressed/telegram/webview.js +++ b/uncompressed/telegram/webview.js @@ -1,19 +1,26 @@ -"use strict"; +'use strict'; -const path = require("path"); +const path = require('path'); module.exports = Franz => { const getMessages = function getMessages() { let count = 0; - const elements = document.querySelectorAll(".dialog-badge-text"); - if (elements) { - for (let i = 0; i < elements.length; i += 1) { - if (elements[i].innerHTML !== 0) { - count += parseInt(elements[i].innerHTML); + const searchElement = document.querySelector('.im_dialogs_search_field'); + if (searchElement && searchElement.value === '') { + const elements = document.querySelectorAll('.im_dialog_badge:not(.ng-hide):not(.im_dialog_badge_muted)'); + if (elements) { + for (let i = 0; i < elements.length; i += 1) { + if (elements[i].innerHTML !== 0) { + count += 1; + } } } } + Franz.setBadge(count); }; + + Franz.injectCSS(path.join(__dirname, 'service.css')); Franz.loop(getMessages); }; +//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlbGVncmFtL3dlYnZpZXcuanMiXSwibmFtZXMiOlsicGF0aCIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImNvdW50Iiwic2VhcmNoRWxlbWVudCIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvciIsInZhbHVlIiwiZWxlbWVudHMiLCJxdWVyeVNlbGVjdG9yQWxsIiwiaSIsImxlbmd0aCIsImlubmVySFRNTCIsInNldEJhZGdlIiwiaW5qZWN0Q1NTIiwiam9pbiIsIl9fZGlybmFtZSIsImxvb3AiXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTUEsT0FBT0MsUUFBUSxNQUFSLENBQWI7O0FBRUFDLE9BQU9DLE9BQVAsR0FBa0JDLEtBQUQsSUFBVztBQUMxQixRQUFNQyxjQUFjLFNBQVNBLFdBQVQsR0FBdUI7QUF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