From 42dba9338225769fa017678f184ff0412aeb2061 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 3 Apr 2022 20:53:48 +0100 Subject: [PATCH 01/16] Extra schema --- context.py | 39 +++++++++++++++++++++++++++++++++++++++ pyjsonld.py | 8 ++++++++ 2 files changed, 47 insertions(+) diff --git a/context.py b/context.py index 1eb2d2a10..8eb182d74 100644 --- a/context.py +++ b/context.py @@ -13,6 +13,7 @@ VALID_CONTEXTS = ( "https://w3id.org/identity/v1", "https://w3id.org/security/v1", "*/apschema/v1.9", + "*/apschema/v1.10", "*/apschema/v1.21", "*/apschema/v1.20", "*/litepub-0.1.jsonld", @@ -156,6 +157,44 @@ def getApschemaV1_20() -> {}: } +def getApschemaV1_10() -> {}: + # https://domain/apschema/v1.10 + return { + '@context': { + 'Hashtag': 'as:Hashtag', + 'PropertyValue': 'schema:PropertyValue', + 'commentPolicy': 'zot:commentPolicy', + 'conversation': 'ostatus:conversation', + 'diaspora': 'https://diasporafoundation.org/ns/', + 'directMessage': 'zot:directMessage', + 'emojiReaction': 'zot:emojiReaction', + 'expires': 'zot:expires', + 'guid': 'diaspora:guid', + 'id': '@id', + 'locationAddress': 'zot:locationAddress', + 'locationDeleted': 'zot:locationDeleted', + 'locationPrimary': 'zot:locationPrimary', + 'magicEnv': {'@id': 'zot:magicEnv', '@type': '@id'}, + 'manuallyApprovesFollowers': 'as:manuallyApprovesFollowers', + 'meAlgorithm': 'zot:meAlgorithm', + 'meCreator': 'zot:meCreator', + 'meData': 'zot:meData', + 'meDataType': 'zot:meDataType', + 'meEncoding': 'zot:meEncoding', + 'meSignatureValue': 'zot:meSignatureValue', + 'nomadicHubs': 'zot:nomadicHubs', + 'nomadicLocation': 'zot:nomadicLocation', + 'nomadicLocations': {'@id': 'zot:nomadicLocations', + '@type': '@id'}, + 'ostatus': 'http://ostatus.org#', + 'schema': 'http://schema.org#', + 'type': '@type', + 'value': 'schema:value', + 'zot': 'https://hubzilla.vikshepa.com/apschema#' + } + } + + def getApschemaV1_21() -> {}: # https://domain/apschema/v1.21 return { diff --git a/pyjsonld.py b/pyjsonld.py index c0e2a8f39..0d789a13c 100644 --- a/pyjsonld.py +++ b/pyjsonld.py @@ -39,6 +39,7 @@ from collections import deque, namedtuple from numbers import Integral, Real from context import getApschemaV1_9 +from context import getApschemaV1_10 from context import getApschemaV1_20 from context import getApschemaV1_21 from context import getLitepubV0_1 @@ -410,6 +411,13 @@ def load_document(url): 'document': getApschemaV1_9() } return doc + elif url.endswith('/apschema/v1.10'): + doc = { + 'contextUrl': None, + 'documentUrl': url, + 'document': getApschemaV1_10() + } + return doc elif url.endswith('/apschema/v1.20'): doc = { 'contextUrl': None, From 948a339395fb3fa00d69ec63c36276637e9d29d7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 3 Apr 2022 21:20:02 +0100 Subject: [PATCH 02/16] More locations --- locations.txt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/locations.txt b/locations.txt index 722392815..35bee37dc 100644 --- a/locations.txt +++ b/locations.txt @@ -119,6 +119,7 @@ ANNABA, ALGERIA:36.8222:7.80917:49 ANNECY, FRANCE:45.9292:6.09861:66 ANNEMASSE, FRANCE:46.1919:6.26833:4 ANNISTON, USA:33.5881:W85.8581:118 +ANSAN, KOREA:37.316667:126.833333:716 ANTALYA, TURKEY:36.9014:30.7917:1417 ANTANANARIVO, MADAGASCAR:-18.7967:47.4786:85 ANTA, PERU:-9.34722:W77.5983:202 @@ -400,7 +401,7 @@ BURGOS, SPAIN:42.3575:W3.62056:107 BURLINGTON, USA:44.4717:W73.1531:40 BURSA, TURKEY:40.2317:29.0092:1036 BURWASH, CANADA:61.3711:W139.041:30 -BUSAN, KOREA:35.1708:129.129:770 +BUSAN, KOREA:35.166667:129.066667:770 BUSHEHR, IRAN:28.9447:50.8344:50 BYDGOSZCZ, POLAND:53.121944:18.000278:175 CABALLOCOCHA, PERU:-3.91667:W70.5081 @@ -511,6 +512,7 @@ CHAMBERY, FRANCE:45.5608:5.97556 CHANDIGARH, INDIA:30.6733:76.7883 CHANDRAGARHI, NEPAL:26.5706:88.0794 CHANGCHA, CHINA:28.1889:113.219:11819 +CHANGWON, KOREA:35.270833:128.663056:747 CHANGUINOLA, PANAMA:9.45861:W82.5167 CHANIA, GREECE:35.5317:24.1494:12 CHAPACURA, BOLIVIA:-16.99:W65.1414 @@ -533,6 +535,8 @@ CHATTANOOGA, USA:35.0353:W85.2036 CHEJU, KOREA:33.5111:126.493 CHELYABINSK, RUSSIA:55.3033:61.5067:530 CHENGDU, CHINA:30.5783:103.947:14378 +CHEONAN, KOREA:36.816667:127.166667:636 +CHEONGJU, KOREA:36.633333:127.483333:940 CHERBOURG, FRANCE:49.65:W1.47028:14 CHERKASY, UKRAINE:49.444444:32.059722:69 CHERNIVTSI, UKRAINE:48.3:25.933333:153 @@ -699,7 +703,9 @@ CURUZU CUATIA, ARGENTINA:-29.7706:W57.9789 CUTBANK, USA:48.6083:W112.376 CUTRALCO, ARGENTINA:-38.9394:W69.2644 CUZCO, PERU:-13.5356:W71.9386 +DAEJEON, KOREA:36.351:127.385:539 DAET, PHILIPPINES:14.1292:122.98 +GAEGU, KOREA:35.866667:128.6:883 DAGLI, NORWAY:60.4167:8.51389 DAHRA, LIBYA:29.4697:17.9311 DAKAR, SENEGAL:14.7394:W17.49 @@ -1138,6 +1144,7 @@ GUNUNG SITOLI, INDONESIA:1.16639:97.7028 GURIAT, SAUDI ARABIA:31.4108:37.2789 GUSAU, NIGERIA:12.1717:6.69611 GWADAR, PAKISTAN:25.2331:62.3294 +GWANGJU, KOREA:35.166667:126.916667:501 GWALIOR, INDIA:26.2939:78.2275 GWERT, ZIMBABWE:-19.4367:29.8617 GWINN, USA:46.3536:W87.3958 @@ -1272,6 +1279,7 @@ HURGHADA, EGYPT:27.1839:33.7983 HURON, USA:44.385:W98.2283 HUSAVIK, ICELAND:65.9522:W17.4258 HWANGE NATIONAL PARK, ZIMBABWE:-18.6297:27.0208 +HWASEONG, KOREA:37.199722:126.831389:689 HYAKURI, JAPAN:36.1808:140.415 HYDERABAD, INDIA:17.4522:78.4611 HYDERABAD, PAKISTAN:25.3181:68.3661 @@ -1304,6 +1312,7 @@ IMPERATRIZ, BRAZIL:-5.53111:W47.46 IMPERIAL, USA:32.8342:W115.579 IMPFONDO, CONGO:1.58944:18.0469 IMPHAL, INDIA:24.7597:93.8969 +INCHEON, KOREA:37.483333:126.633333:1062 INDIANAPOLIS, USA:39.7172:W86.2942:936 INDIAN MOUNTAINS, USA:65.9928:W153.704 INDIAN SPRINGS, USA:36.5869:W115.673 @@ -1381,6 +1390,7 @@ JAYAPURA, INDONESIA:-2.57694:140.516 JEBEL DHANA, UNITED ARAB EMIRATES:24.1872:52.6139 JEDDAH, SAUDI ARABIA:21.3481:39.1728 JENA, GERMANY:50.9172:11.7136:114 +JEONJU, KOREA:35.816667:127.15:206 JEREZ, SPAIN:36.7444:W6.06 JERSEY, ENGLAND:51.7682578:W0.293425 JERUSALEM, ISRAEL:31.8667:35.2167 @@ -3036,8 +3046,7 @@ SEMBAWANG, SINGAPORE:1.42361:103.811 SEMNAN, IRAN:35.5908:53.495 SENDAI, JAPAN:38.1394:140.917 SEO DE URGEL, SPAIN:42.3386:1.40917 -SEOUL EAST, KOREA:37.4458:127.114 -SEOUL, KOREA:37.5581:126.791 +SEOUL, KOREA:37.56:126.99:605 SEPAH, IRAN:32.6208:51.6967 SEPT-ILES, CANADA:50.2233:W66.2656 SETIF, ALGERIA:36.1781:5.32444 @@ -3220,7 +3229,7 @@ SURAT, INDIA:21.115:72.7428 SURAT THANI, THAILAND:9.54778:100.062 SURGUT, RUSSIA:61.25:73.5:354 SURIN, THAILAND:14.8692:103.489 -SUWON, KOREA:37.2392:127.007 +SUWON, KOREA:37.266667:127.016667:121 SVALBARD, NORWAY:78.2461:15.4656 SVARTNES, NORWAY:70.3553:31.0447 SVEG, SWEDEN:62.0478:14.4228 From 2317d3e0d8408f51134ebf935cde13dd220f3724 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Apr 2022 10:10:30 +0100 Subject: [PATCH 03/16] Data type --- daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 87825fd28..b23dbc7ea 100644 --- a/daemon.py +++ b/daemon.py @@ -417,7 +417,7 @@ SHARES_PER_PAGE = 12 def save_domain_qrcode(base_dir: str, http_prefix: str, - domain_full: str, scale=6) -> None: + domain_full: str, scale : int = 6) -> None: """Saves a qrcode image for the domain name This helps to transfer onion or i2p domains to a mobile device """ From 22461b73efc8484b4b8b1f53951fe0855230e08d Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 4 Apr 2022 10:29:54 +0100 Subject: [PATCH 04/16] Tidying --- daemon.py | 12 +----------- qrcode.py | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 qrcode.py diff --git a/daemon.py b/daemon.py index b23dbc7ea..cc6277b8c 100644 --- a/daemon.py +++ b/daemon.py @@ -16,7 +16,6 @@ import datetime from socket import error as SocketError import errno from functools import partial -import pyqrcode # for saving images from hashlib import sha256 from hashlib import md5 @@ -389,6 +388,7 @@ from webapp_likers import html_likers_of_post from crawlers import update_known_crawlers from crawlers import blocked_user_agent from crawlers import load_known_web_bots +from qrcode import save_domain_qrcode import os @@ -416,16 +416,6 @@ FOLLOWS_PER_PAGE = 6 SHARES_PER_PAGE = 12 -def save_domain_qrcode(base_dir: str, http_prefix: str, - domain_full: str, scale : int = 6) -> None: - """Saves a qrcode image for the domain name - This helps to transfer onion or i2p domains to a mobile device - """ - qrcode_filename = base_dir + '/accounts/qrcode.png' - url = pyqrcode.create(http_prefix + '://' + domain_full) - url.png(qrcode_filename, scale) - - class PubServer(BaseHTTPRequestHandler): protocol_version = 'HTTP/1.1' diff --git a/qrcode.py b/qrcode.py new file mode 100644 index 000000000..383f415e6 --- /dev/null +++ b/qrcode.py @@ -0,0 +1,20 @@ +__filename__ = "qrcode.py" +__author__ = "Bob Mottram" +__license__ = "AGPL3+" +__version__ = "1.3.0" +__maintainer__ = "Bob Mottram" +__email__ = "bob@libreserver.org" +__status__ = "Production" +__module_group__ = "Core" + +import pyqrcode + + +def save_domain_qrcode(base_dir: str, http_prefix: str, + domain_full: str, scale: int = 6) -> None: + """Saves a qrcode image for the domain name + This helps to transfer onion or i2p domains to a mobile device + """ + qrcode_filename = base_dir + '/accounts/qrcode.png' + url = pyqrcode.create(http_prefix + '://' + domain_full) + url.png(qrcode_filename, scale) From 6c1058b5e11d28e1934d149593ebff9f5fbd9edb Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 11:22:53 +0100 Subject: [PATCH 05/16] qrcode style on purple theme --- theme/purple/icons/qrcode.png | Bin 10286 -> 5133 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/theme/purple/icons/qrcode.png b/theme/purple/icons/qrcode.png index 561ad14ffacc048f00594c9aeac690494696f474..91b85e79627028ee7d921f7ee8ce4b2ece0a1a05 100644 GIT binary patch delta 1649 zcmV-%29EizP>m>%7=Hl+0001xr{kRf00Q`WR9JLUVRs;Ka&Km7Y-J#Hd2nSQWq4_3 z004N}?Urqhs znc)Wt70V&1c`i9elvGmTih;+o)ZJ1{yWJ&SQ+R)phkJq{5`Xk^zIwj&A9A`4oL$98 zKN#|MO&re?QJThgF4FD))%Kk-tEJ zvn>x0JO?x1{ePEo(yxObc8EWCmUer7lAGQxo`SrdIlG5B$GN+jGD4cKO+B``jSQoDp#WEJT z)j|tEXg=~tcYq)DwJfdzg1W=(*kFyvY2r}2a%<(0Y|sKlMSq?(vVIvrh~QhX7-W5- zm`Ri}MPoK1#L>a0!jR+8@Bsv*${nlZB$5HgdHKdSMq8JaPciN+fWQF~1DYZgtP(CZ ze48s6SS@qUCcm?6M?ub z0!V0H%%W3D92UC8EEdM8P{t~C!RfS!fnXZMI_YNjliU-xkkTJ<;|IC0(ESZ^VWInm z+-GiIQ0wd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d~l$JKEgm|tvv9S^IscC<+J7O5SZ@a=s!j+Q8 zQfCw-3e%_66AfeZ^iVY`1394zf?L%#8%84Pk6C0Zbcb{=pC~2a=QO-vm-c1Uk_KSs zSZLlll-`biaT;-PEbqTZH*)z~fYaxlHm~m#OWe#nNLL08e<%e2cV3zPVdZRg(_`EN=ZVqIEz9aLxzUHz@_nnSyK z&f%P)q^0xH0-U^Qo=0=x_08~L@CklWeI+Wi#p?Uw}OfAlT{rCO{Z5-LrYzgJc00000NkvXXu0mjf@J(j_ From 6a0d635c87b65c453a39bd83b48a3a52c4dde737 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 11:36:20 +0100 Subject: [PATCH 06/16] Explicit default theme settings --- theme/default/theme.json | 256 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 251 insertions(+), 5 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index 62c1e5817..9275945cf 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -1,12 +1,258 @@ -{ - "post-separator-margin-top": "10px", - "post-separator-margin-bottom": "10px", +{ "newswire-publish-icon": "True", - "full-width-timeline-buttons": "False", + "full-width-timeline-buttons": "False", "icons-as-buttons": "False", "rss-icon-at-top": "True", "publish-button-at-top": "False", + "search-banner-height": "30vh", + "search-banner-height-mobile": "15vh", + "likes-names-margin": "2%", + "likes-names-size1": "30px", + "likes-names-size2": "40px", + "liker-names-margin": "2%", + "liker-names-vertical-spacing1": "50px", + "liker-names-vertical-spacing2": "100px", + "pwa-theme-color": "apple-mobile-web-app-status-bar-style", + "pwa-theme-background-color": "black-translucent", + "avatar-rounding": "10%", + "timeline-icon-width": "50px", + "timeline-icon-width-mobile": "100px", + "timeline-icon-width-tiny": "50px", + "header-bg-color": "#e6ebf0", + "main-bg-color": "#e6ebf0", + "post-bg-color": "#e6ebf0", + "column-left-color": "#e6ebf0", + "link-bg-color": "#e6ebf0", + "dropdown-fg-color": "#222", + "dropdown-bg-color": "white", + "dropdown-bg-color-hover": "lightgrey", + "dropdown-fg-color-hover": "#222", + "main-bg-color-reply": "white", + "main-bg-color-dm": "#e3dbf0", + "main-bg-color-report": "#e3dbf0", + "main-header-color-roles": "#ebebf0", + "main-fg-color": "#2d2c37", + "cw-color": "#2d2c37", + "cw-style": "normal", + "cw-weight": "bold", + "column-left-fg-color": "#2d2c37", + "column-right-fg-color": "black", + "column-right-fg-color-voted-on": "red", + "main-link-color": "darkblue", + "main-link-color-hover": "blue", + "main-visited-color": "#232c37", + "border-color": "#c0cdd9", + "border-width": "1px", + "border-width-header": "1px", + "font-size-header": "18px", + "font-size-header-mobile": "32px", + "font-size-header-tiny": "16px", + "font-color-header": "black", + "font-size-button-mobile": "26px", + "font-size-button-tiny": "13px", + "font-size-links": "14px", + "font-size-publish-button": "18px", + "font-size-newswire": "14px", + "font-size-newswire-mobile": "32px", + "font-size-newswire-tiny": "16px", + "font-size-dropdown-header": "40px", + "font-size-dropdown-header-tiny": "20px", + "font-size-mobile": "50px", + "font-size-tiny": "25px", + "font-size": "26px", + "font-size2": "20px", + "font-size3": "34px", + "font-size4": "18px", + "font-size5": "16px", + "font-size-likes": "14px", + "font-size-likes-mobile": "64px", + "font-size-likes-tiny": "16px", + "likes-margin-left-tiny": "10px", + "likes-margin-right-tiny": "10px", + "likes-margin-top-tiny": "-10px", + "likes-margin-left-mobile": "20px", + "likes-margin-right-mobile": "0px", + "likes-margin-top-mobile": "0px", + "font-size-pgp-key": "16px", + "font-size-pgp-key2": "18px", + "font-size-tox": "16px", + "font-size-tox2": "18px", + "font-size-emoji-reaction": "16px", + "font-size-emoji-reaction-mobile": "24px", + "font-size-emoji-reaction-tiny": "12px", + "follow-text-size1": "24px", + "follow-text-size2": "40px", + "follow-text-entry-width": "90%", + "time-color": "#aaa", + "time-vertical-align": "0%", + "time-vertical-align-mobile": "1.5%", + "time-vertical-align-tiny": "0.75%", + "publish-button-text": "#FFFFFF", + "button-margin": "5px", + "button-left-margin": "none", + "button-text": "#FFFFFF", + "button-selected-text": "#FFFFFF", + "publish-button-background": "#999", + "button-background": "#999", + "button-background-hover": "#777", + "button-text-hover": "white", + "button-selected": "#666", + "button-highlighted": "#2b5c6d", + "button-fg-highlighted": "#FFFFFF", + "button-selected-highlighted": "#2b5c6d", + "button-approve": "#2b5c6d", + "button-deny": "darkred", + "button-width-chars": "10ch", + "button-height": "10px", + "button-height-padding-mobile": "20px", + "button-height-padding-tiny": "10px", + "button-height-padding": "10px", + "image-corners": "10%", + "gallery-border": "#ccc", + "gallery-hover": "#777", + "gallery-text-color": "black", + "gallery-font-size": "22px", + "gallery-font-size-mobile": "35px", + "gallery-font-size-tiny": "17.5px", + "button-corner-radius": "5px", + "timeline-border-radius": "5px", + "timeline-posts-background-color": "#e6ebf0", + "icons-side": "right", + "title-color": "#2a2c37", + "focus-color": "grey", + "quote-right-margin": "0.1em", + "quote-font-weight": "normal", + "quote-font-size": "120%", + "quote-font-size-mobile": "120%", + "quote-font-size-tiny": "60%", + "line-spacing": "180%", + "line-spacing-newswire": "120%", + "newswire-item-moderated-color": "grey", + "newswire-date-moderated-color": "grey", + "column-left-width": "10vw", + "column-center-width": "80vw", + "column-right-width": "10vw", + "column-left-mobile-margin": "2%", + "column-left-tiny-margin": "1%", + "column-left-top-margin": "0", + "column-right-top-margin": "0", + "column-left-header-style": "uppercase", + "column-left-header-background": "#555", + "column-left-header-color": "#fff", + "column-left-header-size": "20px", + "column-left-header-size-mobile": "50px", + "column-left-header-size-tiny": "25px", + "column-left-border-width": "0", + "column-left-icons-margin": "0", + "column-right-border-width": "0", + "column-left-border-color": "black", + "column-left-icon-size": "2.1vw", + "column-left-icon-size-mobile": "10%", + "column-left-icon-size-tiny": "5%", + "column-left-image-width-mobile": "40vw", + "column-left-image-width-tiny": "20vw", + "column-right-image-width-mobile": "100vw", + "column-right-image-width-tiny": "50vw", + "column-right-icon-size": "2.1vw", + "column-right-icon-size-mobile": "10%", + "column-right-icon-size-tiny": "5%", + "newswire-date-color": "#00a594", + "newswire-voted-background-color": "black", + "login-button-color": "#2b5c6d", + "login-button-fg-color": "black", + "button-event-corner-radius": "60px", + "button-event-background-color": "#2b5c6d", + "button-event-fg-color": "white", + "hashtag-background-color": "grey", + "hashtag-fg-color": "white", + "tab-border-width": "0px", + "tab-border-color": "grey", + "icon-brightness-change": "150%", + "container-button-padding": "20px", + "header-button-padding": "20px", + "container-padding": "2%", + "container-padding-bottom": "1%", + "container-padding-bottom-mobile": "0%", + "container-padding-bottom-tiny": "0%", + "vertical-between-posts": "10px", + "vertical-between-posts-header": "10px", + "containericons-horizontal-spacing": "1%", + "containericons-horizontal-spacing-mobile": "3%", + "containericons-horizontal-spacing-tiny": "1.5%", + "containericons-horizontal-offset": "-1%", + "containericons-vertical-align": "0.5%", + "containericons-vertical-align-mobile": "1%", + "containericons-vertical-align-tiny": "0.5%", + "likes-count-offset": "5px", + "publish-button-vertical-offset": "10px", + "publish-button-bottom-offset": "10px", "banner-height": "20vh", "banner-height-mobile": "10vh", - "search-banner-height-mobile": "15vh" + "banner-height-tiny": "10vh", + "post-separator-background": "transparent", + "post-separator-margin-top": "10px", + "post-separator-margin-bottom": "10px", + "post-separator-width": "95%", + "separator-width-left": "95%", + "separator-width-right": "95%", + "post-separator-height": "1px", + "header-vertical-offset": "0", + "profile-background-height": "25vw", + "profile-text-align": "left", + "verticals-width": "0", + "italic-font-style": "italic", + "header-font": "'NimbusSanL'", + "button-bottom-margin": "10px", + "rendering": "normal", + "voteresult-color": "#dddddd", + "voteresult-border-color": "#aaaaaa", + "voteresult-height": "32px", + "voteresult-height-mobile": "32px", + "voteresult-height-tiny": "16px", + "voteresult-width": "80%", + "voteresult-width-mobile": "80%", + "voteresult-width-tiny": "40%", + "vcard-icon-size": "32px", + "vcard-icon-size-mobile": "80px", + "vcard-icon-size-tiny": "80px", + "calendar-bg-color": "#e6ebf0", + "lines-color": "darkblue", + "day-number": "black", + "day-number2": "#282c37", + "place-color": "black", + "event-color": "#282c37", + "event-public-color": "#282c37", + "today-foreground": "white", + "today-circle": "#03a494", + "event-background": "lightgrey", + "event-background-private": "grey", + "event-foreground": "white", + "title-text": "white", + "title-background": "#2b5c6d", + "calendar-horizontal-padding": "0", + "calendar-cell-size": "1.5vw", + "calendar-cell-size-mobile": "1.5vw", + "calendar-cell-size-tiny": "1.5vw", + "font-size-calendar": "20px", + "font-size-calendar-mobile": "30px", + "font-size-calendar-tiny": "15px", + "font-size-calendar-header": "3rem", + "font-size-calendar-day": "1rem", + "font-size-calendar-cell": "2rem", + "font-size-calendar-cell-mobile": "4rem", + "font-size-calendar-cell-tiny": "2rem", + "calendar-header-font": "'Montserrat'", + "calendar-header-font-style": "italic", + "ical-icon-size": "32px", + "ical-icon-size-mobile": "80px", + "ical-icon-size-tiny": "80px", + "hashtag-vertical-spacing1": "50px", + "hashtag-vertical-spacing2": "100px", + "hashtag-vertical-spacing3": "100px", + "hashtag-vertical-spacing4": "150px", + "hashtag-size1": "30px", + "hashtag-size2": "40px", + "hashtag-margin": "2%", + "text-entry-foreground": "#ccc", + "text-entry-background": "#111" } From 3554f0e20576f7e715c2c958eae1ed7034bd2003 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 12:10:08 +0100 Subject: [PATCH 07/16] Clear designer settings when resetting theme --- daemon.py | 8 ++++---- epicyon.py | 2 +- theme.py | 6 +++--- theme/purple/icons/qrcode.png | Bin 5133 -> 5305 bytes 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/daemon.py b/daemon.py index cc6277b8c..a94ce4032 100644 --- a/daemon.py +++ b/daemon.py @@ -2511,7 +2511,7 @@ class PubServer(BaseHTTPRequestHandler): system_language) set_theme(base_dir, theme_name, domain, allow_local_network_access, system_language, - dyslexic_font) + dyslexic_font, True) if calling_domain.endswith('.onion') and onion_domain: origin_path_str = \ @@ -5590,7 +5590,7 @@ class PubServer(BaseHTTPRequestHandler): set_theme(base_dir, self.server.theme_name, domain, allow_local_network_access, system_language, - self.server.dyslexic_font) + self.server.dyslexic_font, True) self.server.text_mode_banner = \ get_text_mode_banner(self.server.base_dir) self.server.iconsCache = {} @@ -6545,7 +6545,7 @@ class PubServer(BaseHTTPRequestHandler): set_theme(base_dir, curr_theme, domain, allow_local_network_access, system_language, - self.server.dyslexic_font) + self.server.dyslexic_font, False) self.server.text_mode_banner = \ get_text_mode_banner(base_dir) self.server.iconsCache = {} @@ -6842,7 +6842,7 @@ class PubServer(BaseHTTPRequestHandler): self.server.domain, self.server.allow_local_network_access, self.server.system_language, - self.server.dyslexic_font) + self.server.dyslexic_font, False) # low bandwidth images checkbox if path.startswith('/users/' + admin_nickname + '/') or \ diff --git a/epicyon.py b/epicyon.py index ea96d7330..1c87324bd 100644 --- a/epicyon.py +++ b/epicyon.py @@ -3399,7 +3399,7 @@ if twitter_domain: if set_theme(base_dir, theme_name, domain, args.allow_local_network_access, args.language, - args.dyslexic_font): + args.dyslexic_font, False): print('Theme set to ' + theme_name) # whether new registrations are open or closed diff --git a/theme.py b/theme.py index 0d9fc584b..3b6aac549 100644 --- a/theme.py +++ b/theme.py @@ -528,7 +528,7 @@ def set_theme_from_designer(base_dir: str, theme_name: str, domain: str, save_json(theme_params, custom_theme_filename) set_theme(base_dir, theme_name, domain, allow_local_network_access, system_language, - dyslexic_font) + dyslexic_font, False) def reset_theme_designer_settings(base_dir: str, theme_name: str, domain: str, @@ -846,7 +846,7 @@ def _set_clear_cache_flag(base_dir: str) -> None: def set_theme(base_dir: str, name: str, domain: str, allow_local_network_access: bool, system_language: str, - dyslexic_font: bool) -> bool: + dyslexic_font: bool, designer_reset: bool) -> bool: """Sets the theme with the given name as the current theme """ result = False @@ -854,7 +854,7 @@ def set_theme(base_dir: str, name: str, domain: str, prev_theme_name = get_theme(base_dir) # if the theme has changed then remove any custom settings - if prev_theme_name != name: + if prev_theme_name != name or designer_reset: reset_theme_designer_settings(base_dir, name, domain, allow_local_network_access, system_language) diff --git a/theme/purple/icons/qrcode.png b/theme/purple/icons/qrcode.png index 91b85e79627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U8I=Sm!u z5d`vzb_fOdfm&a{u?d!e0tW$*Kl9Bd^miDj@-8i3py@>bL6-tSRCO81XzR{;=`+LQ a`3K+tj-2k;|55+|002ovPDBK*LSTa6@#4b( From 0143c7c5a06b8ab8b0ec8d77459b34d3cc574316 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 12:14:37 +0100 Subject: [PATCH 08/16] Setting theme values --- theme.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/theme.py b/theme.py index 3b6aac549..d58fabb8a 100644 --- a/theme.py +++ b/theme.py @@ -867,7 +867,8 @@ def set_theme(base_dir: str, name: str, domain: str, theme_name_lower = theme_name.lower() if name == theme_name_lower: if prev_theme_name: - if prev_theme_name.lower() != theme_name_lower: + if prev_theme_name.lower() != theme_name_lower or \ + designer_reset: # change the banner and profile image # to the default for the theme _set_theme_images(base_dir, name) From 972aa3e88035a0116fb5e651a893876895e0e362 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 12:29:06 +0100 Subject: [PATCH 09/16] Setting default theme from json --- theme.py | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/theme.py b/theme.py index d58fabb8a..3ddd63353 100644 --- a/theme.py +++ b/theme.py @@ -575,24 +575,30 @@ def _set_theme_default(base_dir: str, allow_local_network_access: bool): name = 'default' _remove_theme(base_dir) _set_theme_in_config(base_dir, name) - bg_params = { - "login": "jpg", - "follow": "jpg", - "options": "jpg", - "search": "jpg" - } - theme_params = { - "newswire-publish-icon": True, - "full-width-timeline-buttons": False, - "icons-as-buttons": False, - "rss-icon-at-top": True, - "publish-button-at-top": False, - "banner-height": "20vh", - "banner-height-mobile": "10vh", - "search-banner-height-mobile": "15vh" - } - _set_theme_from_dict(base_dir, name, theme_params, bg_params, - allow_local_network_access) + + variables_file = base_dir + '/theme/' + name + '/theme.json' + if os.path.isfile(variables_file): + _read_variables_file(base_dir, name, variables_file, + allow_local_network_access) + else: + bg_params = { + "login": "jpg", + "follow": "jpg", + "options": "jpg", + "search": "jpg" + } + theme_params = { + "newswire-publish-icon": True, + "full-width-timeline-buttons": False, + "icons-as-buttons": False, + "rss-icon-at-top": True, + "publish-button-at-top": False, + "banner-height": "20vh", + "banner-height-mobile": "10vh", + "search-banner-height-mobile": "15vh" + } + _set_theme_from_dict(base_dir, name, theme_params, bg_params, + allow_local_network_access) def _set_theme_fonts(base_dir: str, theme_name: str) -> None: From d0b4216ad3ba2eec3a0e197a4463261596069715 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:08:05 +0100 Subject: [PATCH 10/16] Default theme settings --- theme/default/theme.json | 105 +++++++++++++++++++-------------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index 9275945cf..5d353e620 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -18,53 +18,19 @@ "timeline-icon-width": "50px", "timeline-icon-width-mobile": "100px", "timeline-icon-width-tiny": "50px", - "header-bg-color": "#e6ebf0", - "main-bg-color": "#e6ebf0", - "post-bg-color": "#e6ebf0", - "column-left-color": "#e6ebf0", - "link-bg-color": "#e6ebf0", - "dropdown-fg-color": "#222", - "dropdown-bg-color": "white", - "dropdown-bg-color-hover": "lightgrey", - "dropdown-fg-color-hover": "#222", - "main-bg-color-reply": "white", - "main-bg-color-dm": "#e3dbf0", - "main-bg-color-report": "#e3dbf0", - "main-header-color-roles": "#ebebf0", - "main-fg-color": "#2d2c37", - "cw-color": "#2d2c37", "cw-style": "normal", "cw-weight": "bold", - "column-left-fg-color": "#2d2c37", - "column-right-fg-color": "black", "column-right-fg-color-voted-on": "red", - "main-link-color": "darkblue", - "main-link-color-hover": "blue", - "main-visited-color": "#232c37", - "border-color": "#c0cdd9", - "border-width": "1px", - "border-width-header": "1px", "font-size-header": "18px", "font-size-header-mobile": "32px", "font-size-header-tiny": "16px", - "font-color-header": "black", - "font-size-button-mobile": "26px", "font-size-button-tiny": "13px", - "font-size-links": "14px", "font-size-publish-button": "18px", - "font-size-newswire": "14px", - "font-size-newswire-mobile": "32px", "font-size-newswire-tiny": "16px", "font-size-dropdown-header": "40px", "font-size-dropdown-header-tiny": "20px", "font-size-mobile": "50px", "font-size-tiny": "25px", - "font-size": "26px", - "font-size2": "20px", - "font-size3": "34px", - "font-size4": "18px", - "font-size5": "16px", - "font-size-likes": "14px", "font-size-likes-mobile": "64px", "font-size-likes-tiny": "16px", "likes-margin-left-tiny": "10px", @@ -97,10 +63,7 @@ "button-background-hover": "#777", "button-text-hover": "white", "button-selected": "#666", - "button-highlighted": "#2b5c6d", "button-fg-highlighted": "#FFFFFF", - "button-selected-highlighted": "#2b5c6d", - "button-approve": "#2b5c6d", "button-deny": "darkred", "button-width-chars": "10ch", "button-height": "10px", @@ -110,16 +73,10 @@ "image-corners": "10%", "gallery-border": "#ccc", "gallery-hover": "#777", - "gallery-text-color": "black", "gallery-font-size": "22px", "gallery-font-size-mobile": "35px", "gallery-font-size-tiny": "17.5px", - "button-corner-radius": "5px", - "timeline-border-radius": "5px", - "timeline-posts-background-color": "#e6ebf0", "icons-side": "right", - "title-color": "#2a2c37", - "focus-color": "grey", "quote-right-margin": "0.1em", "quote-font-weight": "normal", "quote-font-size": "120%", @@ -127,8 +84,6 @@ "quote-font-size-tiny": "60%", "line-spacing": "180%", "line-spacing-newswire": "120%", - "newswire-item-moderated-color": "grey", - "newswire-date-moderated-color": "grey", "column-left-width": "10vw", "column-center-width": "80vw", "column-right-width": "10vw", @@ -156,14 +111,10 @@ "column-right-icon-size": "2.1vw", "column-right-icon-size-mobile": "10%", "column-right-icon-size-tiny": "5%", - "newswire-date-color": "#00a594", "newswire-voted-background-color": "black", - "login-button-color": "#2b5c6d", "login-button-fg-color": "black", "button-event-corner-radius": "60px", - "button-event-background-color": "#2b5c6d", "button-event-fg-color": "white", - "hashtag-background-color": "grey", "hashtag-fg-color": "white", "tab-border-width": "0px", "tab-border-color": "grey", @@ -186,12 +137,9 @@ "likes-count-offset": "5px", "publish-button-vertical-offset": "10px", "publish-button-bottom-offset": "10px", - "banner-height": "20vh", "banner-height-mobile": "10vh", "banner-height-tiny": "10vh", "post-separator-background": "transparent", - "post-separator-margin-top": "10px", - "post-separator-margin-bottom": "10px", "post-separator-width": "95%", "separator-width-left": "95%", "separator-width-right": "95%", @@ -201,7 +149,6 @@ "profile-text-align": "left", "verticals-width": "0", "italic-font-style": "italic", - "header-font": "'NimbusSanL'", "button-bottom-margin": "10px", "rendering": "normal", "voteresult-color": "#dddddd", @@ -255,4 +202,56 @@ "hashtag-margin": "2%", "text-entry-foreground": "#ccc", "text-entry-background": "#111" + "header-bg-color": "#282c37", + "post-bg-color": "#282c37", + "column-left-color": "#282c37", + "link-bg-color": "#282c37", + "dropdown-fg-color": "#dddddd", + "dropdown-bg-color": "#111", + "dropdown-bg-color-hover": "#333", + "dropdown-fg-color-hover": "#dddddd", + "main-bg-color-reply": "#212c37", + "main-bg-color-dm": "#222", + "main-bg-color-report": "#221c27", + "main-header-color-roles": "#282237", + "main-fg-color": "#dddddd", + "cw-color": "#dddddd", + "column-left-fg-color": "#dddddd", + "column-right-fg-color": "yellow", + "main-link-color": "#999", + "main-link-color-hover": "#bbb", + "main-visited-color": "#888", + "border-color": "#505050", + "border-width": "2px", + "border-width-header": "2px", + "font-color-header": "#ccc",; + "font-size-button-mobile": "34px", + "font-size-links: 18px", + "font-size-newswire": "18px", + "font-size-newswire-mobile": "38px", + "font-size": "30px", + "font-size2": "24px", + "font-size3": "38px", + "font-size4": "22px", + "font-size5": "20px", + "font-size-likes": "20px", + "button-highlighted": "green", + "button-selected-highlighted": "darkgreen", + "button-approve": "darkgreen", + "gallery-text-color": "#ccc", + "button-corner-radius": "15px", + "timeline-border-radius": "30px", + "timeline-posts-background-color": "#282c37", + "title-color": "#999", + "focus-color": "white", + "newswire-item-moderated-color": "white", + "newswire-date-moderated-color": "white", + "newswire-date-color": "white", + "login-button-color": "#2965", + "button-event-background-color": "green", + "hashtag-background-color": "black", + "banner-height": "15vh", + "post-separator-margin-top": "0", + "post-separator-margin-bottom": "0", + "header-font": "Arial, Helvetica, sans-serif" } From 84ddda9fadd5d06d2695134df861cec77841e444 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:11:51 +0100 Subject: [PATCH 11/16] Fix json --- theme/default/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index 5d353e620..f39e891cb 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -201,7 +201,7 @@ "hashtag-size2": "40px", "hashtag-margin": "2%", "text-entry-foreground": "#ccc", - "text-entry-background": "#111" + "text-entry-background": "#111", "header-bg-color": "#282c37", "post-bg-color": "#282c37", "column-left-color": "#282c37", @@ -224,9 +224,9 @@ "border-color": "#505050", "border-width": "2px", "border-width-header": "2px", - "font-color-header": "#ccc",; + "font-color-header": "#ccc", "font-size-button-mobile": "34px", - "font-size-links: 18px", + "font-size-links": "18px", "font-size-newswire": "18px", "font-size-newswire-mobile": "38px", "font-size": "30px", From a8ec9cbc83481324b2913f943968d7546a184aee Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:16:00 +0100 Subject: [PATCH 12/16] Background color --- theme/default/theme.json | 1 + 1 file changed, 1 insertion(+) diff --git a/theme/default/theme.json b/theme/default/theme.json index f39e891cb..be064bb69 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -210,6 +210,7 @@ "dropdown-bg-color": "#111", "dropdown-bg-color-hover": "#333", "dropdown-fg-color-hover": "#dddddd", + "main-bg-color": "#282c37", "main-bg-color-reply": "#212c37", "main-bg-color-dm": "#222", "main-bg-color-report": "#221c27", From 532122ef61d990b800f462c88b469072a9c715f2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:28:16 +0100 Subject: [PATCH 13/16] Calendar background --- theme/default/theme.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index be064bb69..ee9d75709 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -162,9 +162,7 @@ "vcard-icon-size": "32px", "vcard-icon-size-mobile": "80px", "vcard-icon-size-tiny": "80px", - "calendar-bg-color": "#e6ebf0", "lines-color": "darkblue", - "day-number": "black", "day-number2": "#282c37", "place-color": "black", "event-color": "#282c37", @@ -211,11 +209,13 @@ "dropdown-bg-color-hover": "#333", "dropdown-fg-color-hover": "#dddddd", "main-bg-color": "#282c37", + "calendar-bg-color": "#282c37", "main-bg-color-reply": "#212c37", "main-bg-color-dm": "#222", "main-bg-color-report": "#221c27", "main-header-color-roles": "#282237", "main-fg-color": "#dddddd", + "day-number": "#dddddd", "cw-color": "#dddddd", "column-left-fg-color": "#dddddd", "column-right-fg-color": "yellow", From 70df41678e02b617d98f168e33ea543011bc0548 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:35:04 +0100 Subject: [PATCH 14/16] Calendar style --- theme/default/theme.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index ee9d75709..e3c1bb484 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -162,13 +162,12 @@ "vcard-icon-size": "32px", "vcard-icon-size-mobile": "80px", "vcard-icon-size-tiny": "80px", - "lines-color": "darkblue", - "day-number2": "#282c37", + "lines-color": "grey", "place-color": "black", "event-color": "#282c37", "event-public-color": "#282c37", - "today-foreground": "white", - "today-circle": "#03a494", + "today-foreground": "black", + "today-circle": "grey", "event-background": "lightgrey", "event-background-private": "grey", "event-foreground": "white", @@ -216,6 +215,7 @@ "main-header-color-roles": "#282237", "main-fg-color": "#dddddd", "day-number": "#dddddd", + "day-number2": "#bbbbbb", "cw-color": "#dddddd", "column-left-fg-color": "#dddddd", "column-right-fg-color": "yellow", From a736f5bb4b2e37fc198f1a1b8060bc02e0990dc1 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:42:15 +0100 Subject: [PATCH 15/16] Calendar event color --- theme/default/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index e3c1bb484..89d12457d 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -168,7 +168,7 @@ "event-public-color": "#282c37", "today-foreground": "black", "today-circle": "grey", - "event-background": "lightgrey", + "event-background": "black", "event-background-private": "grey", "event-foreground": "white", "title-text": "white", From 426eea838a9b57cc50bc974816359aa1acbe6a06 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 5 Apr 2022 13:49:08 +0100 Subject: [PATCH 16/16] Event background color --- theme/default/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/theme/default/theme.json b/theme/default/theme.json index 89d12457d..b75a33daa 100644 --- a/theme/default/theme.json +++ b/theme/default/theme.json @@ -164,15 +164,15 @@ "vcard-icon-size-tiny": "80px", "lines-color": "grey", "place-color": "black", - "event-color": "#282c37", + "event-color": "grey", "event-public-color": "#282c37", "today-foreground": "black", "today-circle": "grey", "event-background": "black", - "event-background-private": "grey", + "event-background-private": "#222", "event-foreground": "white", "title-text": "white", - "title-background": "#2b5c6d", + "title-background": "grey", "calendar-horizontal-padding": "0", "calendar-cell-size": "1.5vw", "calendar-cell-size-mobile": "1.5vw",