diff options
author | 2020-04-21 20:25:06 +0000 | |
---|---|---|
committer | 2020-04-21 20:25:06 +0000 | |
commit | 9f371fd118e5d74e54985a2fb21a286cc78c4bdb (patch) | |
tree | 5fcee15c31f142263c516d6bb1a1e043939960d8 /uncompressed/telegram | |
parent | Repackage archives not passing the checks (#131) (diff) | |
download | ferdium-recipes-9f371fd118e5d74e54985a2fb21a286cc78c4bdb.tar.gz ferdium-recipes-9f371fd118e5d74e54985a2fb21a286cc78c4bdb.tar.zst ferdium-recipes-9f371fd118e5d74e54985a2fb21a286cc78c4bdb.zip |
Switch back to original Telegram, add Telegram React (#132)
Diffstat (limited to 'uncompressed/telegram')
-rw-r--r-- | uncompressed/telegram/README.md | 8 | ||||
-rw-r--r-- | uncompressed/telegram/package.json | 6 | ||||
-rw-r--r-- | uncompressed/telegram/service.css | 151 | ||||
-rw-r--r-- | uncompressed/telegram/webview.js | 21 |
4 files changed, 171 insertions, 15 deletions
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 @@ | |||
1 | # Telegram for Ferdi | 1 | # Telegram for Franz |
2 | 2 | This is the official Franz recipe for Telegram | |
3 | This is the official Ferdi recipe for Telegram | ||
4 | 3 | ||
5 | ### How to create your own Franz recipes: | 4 | ### How to create your own Franz recipes: |
6 | 5 | * [Read the documentation](https://github.com/meetfranz/plugins) | |
7 | - [Read the documentation](https://github.com/getferdi/recipes/tree/master/docs) | ||
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 @@ | |||
1 | { | 1 | { |
2 | "id": "telegram", | 2 | "id": "telegram", |
3 | "name": "Telegram", | 3 | "name": "Telegram", |
4 | "version": "2.0.0", | 4 | "version": "3.0.0", |
5 | "description": "Telegram", | 5 | "description": "Telegram", |
6 | "main": "index.js", | 6 | "main": "index.js", |
7 | "author": "Amine Mouafik <amine@mouafik.fr>", | 7 | "author": "Stefan Malzner <stefan@adlk.io>", |
8 | "license": "MIT", | 8 | "license": "MIT", |
9 | "config": { | 9 | "config": { |
10 | "serviceURL": "https://evgeny-nadymov.github.io/telegram-react/", | 10 | "serviceURL": "https://web.telegram.org", |
11 | "hasDirectMessages": true, | 11 | "hasDirectMessages": true, |
12 | "hasNotificationSound": true | 12 | "hasNotificationSound": true |
13 | } | 13 | } |
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 @@ | |||
1 | .tg_head_split { | ||
2 | max-width: 100% !important; | ||
3 | } | ||
4 | |||
5 | .im_page_wrap { | ||
6 | max-width: 100% !important; | ||
7 | } | ||
8 | |||
9 | .im_dialogs_col_wrap { | ||
10 | width: 320px !important; | ||
11 | } | ||
12 | |||
13 | .im_history_col_wrap { | ||
14 | width: calc(100% - 320px) !important; | ||
15 | } | ||
16 | |||
17 | .im_message_wrap { | ||
18 | max-width: inherit !important; | ||
19 | } | ||
20 | |||
21 | .im_message_body { | ||
22 | max-width: 580px !important; | ||
23 | } | ||
24 | |||
25 | body.darkTheme, | ||
26 | .darkTheme .modal-content { | ||
27 | color: #bbb !important; | ||
28 | background: #252525 !important; | ||
29 | } | ||
30 | .darkTheme a.tg_checkbox { | ||
31 | color: #bbb !important; | ||
32 | } | ||
33 | .darkTheme .im_page_wrap { | ||
34 | /*background color of contentwrapper under header*/ | ||
35 | |||
36 | background-color: #303030 !important; | ||
37 | border-left: 1px solid #4d4d4d !important; | ||
38 | border-right: 1px solid #4d4d4d !important; | ||
39 | border-bottom: 1px solid #4d4d4d !important; | ||
40 | box-shadow: none; | ||
41 | } | ||
42 | .darkTheme .im_message_body, | ||
43 | .darkTheme .im_attach, | ||
44 | .darkTheme .im_media_attach, | ||
45 | .darkTheme .im_record, | ||
46 | .darkTheme .im_message_document_thumbed { | ||
47 | background: inherit !important; | ||
48 | } | ||
49 | .darkTheme .im_dialog_peer { | ||
50 | /*peer nickname unselected*/ | ||
51 | |||
52 | color: #bbb !important; | ||
53 | } | ||
54 | .darkTheme .contacts_modal_members_list a.contacts_modal_contact { | ||
55 | /*nicknames in contactlist via hamburger menu*/ | ||
56 | |||
57 | color: #bbb; | ||
58 | } | ||
59 | .darkTheme .active a.im_dialog { | ||
60 | /*selected peer */ | ||
61 | |||
62 | background-color: #4d4d4d !important; | ||
63 | } | ||
64 | .darkTheme .tg_head_split, | ||
65 | .darkTheme .md_modal_head { | ||
66 | /*page header block*/ | ||
67 | |||
68 | background-color: #4d4d4d !important; | ||
69 | } | ||
70 | .darkTheme .dropdown.open .tg_head_btn, | ||
71 | .darkTheme .tg_head_btn:hover { | ||
72 | background: #4d4d4d !important; | ||
73 | } | ||
74 | .darkTheme .form-control { | ||
75 | /*input field*/ | ||
76 | |||
77 | background-color: #0e0e0e !important; | ||
78 | color: #bbb !important; | ||
79 | } | ||
80 | .darkTheme .composer_rich_textarea { | ||
81 | background: #303030 !important; | ||
82 | border-color: #bbb !important; | ||
83 | } | ||
84 | .darkTheme .im_dialogs_col_wrap { | ||
85 | /*contactlist right border*/ | ||
86 | |||
87 | border-right: 2px solid #4d4d4d; | ||
88 | } | ||
89 | .darkTheme .im_dialogs_col .nano > .nano-pane > .nano-slider { | ||
90 | /*scrollbarbutton when hover*/ | ||
91 | |||
92 | background-color: #4d4d4d !important; | ||
93 | } | ||
94 | .darkTheme .tg_head_split { | ||
95 | background-color: #151515; | ||
96 | } | ||
97 | .darkTheme .im_submit { | ||
98 | color: #4d4d4d; | ||
99 | } | ||
100 | .darkTheme .im_message_mymention { | ||
101 | background: #1d1d1d; | ||
102 | } | ||
103 | .darkTheme .im_message_focus .im_message_outer_wrap { | ||
104 | background-color: #4d4d4d; | ||
105 | } | ||
106 | .darkTheme .im_message_selected .im_message_outer_wrap { | ||
107 | background: #4d4d4d; | ||
108 | } | ||
109 | .darkTheme a:hover { | ||
110 | background-color: #282828 !important; | ||
111 | } | ||
112 | .darkTheme .im_message_unread_split { | ||
113 | background: #4d4d4d; | ||
114 | } | ||
115 | @keyframes im_message_focus_fade { | ||
116 | 0% { | ||
117 | background-color: #2d2d2d; | ||
118 | } | ||
119 | } | ||
120 | .darkTheme .btn-primary { | ||
121 | background-color: #4d4d4d; | ||
122 | } | ||
123 | .darkTheme .im_history_select_active .im_message_outer_wrap:hover { | ||
124 | background: #4d4d4d; | ||
125 | } | ||
126 | .darkTheme .im_dialog_chat_from_wrap, | ||
127 | .darkTheme .im_dialog_message_service { | ||
128 | color: #6ac; | ||
129 | } | ||
130 | .darkTheme .composer_rich_textarea, | ||
131 | .darkTheme .composer_textarea { | ||
132 | box-shadow: 0px 3px 1px #ddd; | ||
133 | } | ||
134 | .darkTheme .composer_rich_textarea:focus { | ||
135 | box-shadow: 0px 3px 1px #ddd !important; | ||
136 | } | ||
137 | .darkTheme .tg_head_logo_dropdown .dropdown-menu > li > a { | ||
138 | color: #ddd; | ||
139 | } | ||
140 | .darkTheme .btn-primary.disabled, | ||
141 | .darkTheme .btn-primary[disabled] { | ||
142 | background: #4d4d4d none repeat scroll 0% 0%; | ||
143 | } | ||
144 | /*emoji*/ | ||
145 | |||
146 | .darkTheme .composer_emoji_tooltip, | ||
147 | .darkTheme .icon-tooltip-tail, | ||
148 | .darkTheme .dropdown-menu { | ||
149 | background-color: #4d4d4d !important; | ||
150 | border-color: #5d5d5d; | ||
151 | } | ||
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 @@ | |||
1 | "use strict"; | 1 | 'use strict'; |
2 | 2 | ||
3 | const path = require("path"); | 3 | const path = require('path'); |
4 | 4 | ||
5 | module.exports = Franz => { | 5 | module.exports = Franz => { |
6 | const getMessages = function getMessages() { | 6 | const getMessages = function getMessages() { |
7 | let count = 0; | 7 | let count = 0; |
8 | const elements = document.querySelectorAll(".dialog-badge-text"); | 8 | const searchElement = document.querySelector('.im_dialogs_search_field'); |
9 | if (elements) { | 9 | if (searchElement && searchElement.value === '') { |
10 | for (let i = 0; i < elements.length; i += 1) { | 10 | const elements = document.querySelectorAll('.im_dialog_badge:not(.ng-hide):not(.im_dialog_badge_muted)'); |
11 | if (elements[i].innerHTML !== 0) { | 11 | if (elements) { |
12 | count += parseInt(elements[i].innerHTML); | 12 | for (let i = 0; i < elements.length; i += 1) { |
13 | if (elements[i].innerHTML !== 0) { | ||
14 | count += 1; | ||
15 | } | ||
13 | } | 16 | } |
14 | } | 17 | } |
15 | } | 18 | } |
19 | |||
16 | Franz.setBadge(count); | 20 | Franz.setBadge(count); |
17 | }; | 21 | }; |
22 | |||
23 | Franz.injectCSS(path.join(__dirname, 'service.css')); | ||
18 | Franz.loop(getMessages); | 24 | Franz.loop(getMessages); |
19 | }; | 25 | }; |
26 | //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRlbGVncmFtL3dlYnZpZXcuanMiXSwibmFtZXMiOlsicGF0aCIsInJlcXVpcmUiLCJtb2R1bGUiLCJleHBvcnRzIiwiRnJhbnoiLCJnZXRNZXNzYWdlcyIsImNvdW50Iiwic2VhcmNoRWxlbWVudCIsImRvY3VtZW50IiwicXVlcnlTZWxlY3RvciIsInZhbHVlIiwiZWxlbWVudHMiLCJxdWVyeVNlbGVjdG9yQWxsIiwiaSIsImxlbmd0aCIsImlubmVySFRNTCIsInNldEJhZGdlIiwiaW5qZWN0Q1NTIiwiam9pbiIsIl9fZGlybmFtZSIsImxvb3AiXSwibWFwcGluZ3MiOiI7O0FBQUEsTUFBTUEsT0FBT0MsUUFBUSxNQUFSLENBQWI7O0FBRUFDLE9BQU9DLE9BQVAsR0FBa0JDLEtBQUQsSUFBVztBQUMxQixRQUFNQy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