diff --git a/clients.toml b/clients.toml index ec31587..99ec396 100644 --- a/clients.toml +++ b/clients.toml @@ -448,20 +448,14 @@ resources = [ ] [leechcraft] -title = "LeechCraft" +title = "Leech Craft" about = """ -LeechCraft is a free open source cross-platform modular live environment. +LeechCraft is a free open source cross-platform modular live environment and \ +internet-client. -It has modules for everything, which include an HTML browser; a multiprotocol \ -modular IM client with support for encryption and audio calls; a \ -collection-oriented media player with social features like recommended artists \ -and nearby events; a BitTorrent client; a document viewer (ePUB, DjVu, PDF, \ -MOBI, etc.); an RSS feed reader with extensive support for Broadcatching and \ -podcasts ; a package manager with its own repository of plugins, themes, icons \ -and much more. - -The “Summary” tab that displays all your downloads, updates and statuses (like \ -new articles in news feeds). +LeechCraft allows to chat, browse the internet, read Atom/RSS feeds, download \ +files via BitTorrent, FTP, HTTP and DC, automatically download, play or stream \ +podcasts (and other media files) and much more. LeechCraft is a modular system, and by installing different modules you can \ customize the feature set, keeping off the things you do not need and have a \ diff --git a/css/stylesheet.css b/css/stylesheet.css index c65bf2a..7d395a3 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -12,7 +12,7 @@ div, h1, h2, h3, h4, h5 { font-family: system-ui; } -h1, h2, h3 { +h1, h2 { text-align: center; margin: 0; padding: 1em; @@ -58,12 +58,64 @@ div:has(#bar) { } */ -#subject { +#conference, +#pubsub { + text-align: initial; +} + +#subject pre { margin: auto; max-height: 30vh; overflow: auto; padding: 1em; - width: 90vw; +} + +#entries, +#messages, +#subject { + padding: 0 2em 0 2em; +} + +.entry, +.message, +#subject { + margin-bottom: 1em; +} + +.entry > .link a, +.entry > a, +.message > a { + text-decoration: none; +} + +.entry .summary { + padding: 1em 0 0 1em; +} + +#subject pre, +#vcard-note, +#vcard-note-full { + color: #505050; + margin-left: 5em; + margin-right: 5em; + /* overflow: hidden; */ + padding: 0 2em 2em 2em; + text-align: center; + /* text-overflow: ellipsis; + white-space: nowrap; */ +} + +#subject pre { + font-size: 120%; + text-align: initial; + margin: unset; +} + +#subject pre, +.message .content { + overflow-wrap: break-word; + padding: 1em 0 0 1em; + white-space: pre-wrap; } #bar, @@ -156,14 +208,21 @@ label, #input, .vcard-link, .system-menu { - border-radius: 2em; font-size: 1.34em; +} + +#download, +#input, +.vcard-link { + border-radius: 2em; padding: 0.5em; } +/* #system-title > * { width: 18%; } +*/ #profile-top, #system-title { @@ -271,17 +330,20 @@ h1 { text-overflow: ellipsis; } +/* #count { margin: 1em; - /* min-height: 1.5em; */ -} - -/* -#count > a:before { - content: ' • '; } */ +#count > a:after { + content: ' • '; +} + +#count > a:last-child:after { + content: ''; +} + #graphics, #photo { border-radius: 50px; @@ -317,12 +379,26 @@ h1 { display: grid; } +#vcard-links-extra > a { + border: 1px solid #434a53; + border-radius: 1em; + margin: 1em auto; + padding: 1em; + text-decoration: none; + width: 50%; +} + +#vcard-links > a:hover, +#vcard-links-extra > a:hover { + background: #ebebeb; +} + #vcard-links { padding-bottom: 1em; } .vcard-link { - filter: drop-shadow(0 0 0 black); + /* filter: drop-shadow(0 0 0 black); */ margin: 1em; outline: solid; outline-color: #cfcfcf; @@ -468,25 +544,6 @@ h1 { display: block; /* Show details upon checked checkbox */ } -#vcard-note-full { - color: #505050; - margin-left: 5em; - margin-right: 5em; - padding: 0 2em 2em 2em; - text-align: center; -} - -#vcard-note { - color: #505050; - margin-left: 5em; - margin-right: 5em; - /* overflow: hidden; */ - padding: 2em; - text-align: center; - /* text-overflow: ellipsis; - white-space: nowrap; */ -} - #vcard-note:hover { overflow: unset; white-space: unset; @@ -517,7 +574,7 @@ h1 { padding: 1em; text-align: center; text-decoration: none; - width: 12.2%; + /* width: 12.2%; */ } #software-menu img { @@ -653,11 +710,6 @@ h1 { width: 80%; } -#entries { - /* padding: 2em; */ - text-align: left; -} - /* .entry > * { margin-bottom: 1em; @@ -679,6 +731,7 @@ h1 { text-decoration: none; } +.entry > .link a, #count > a, #preview { color: #5c5656; @@ -688,6 +741,9 @@ h1 { #count > a:hover, #preview:hover { color: #000; +} + +#preview:hover { text-decoration: underline; } @@ -890,10 +946,16 @@ h1 { } #action > #add, - #action-bar > #add { + #action-bar > #add, + #system-title > h1 { display: none; } + #system-title { + padding-bottom: 2em; + padding-top: 2em; + } + body { background: #f5f5f5; } @@ -916,6 +978,7 @@ h1 { padding-bottom: unset; } + #container-of-selection, #profile { border-radius: unset; filter: unset; @@ -995,3 +1058,11 @@ h1 { } } + +@media (max-width: 480px) { + + #security-notices > .notice { + width: 300px; + } + +} diff --git a/fasi.py b/fasi.py index 49ac43b..a394c1d 100644 --- a/fasi.py +++ b/fasi.py @@ -109,7 +109,6 @@ class HttpInstance: exception = jid_vcard = messages_10 = note = node_title = \ node_note = number_of_pages = page_number = previous = \ selection = services_sorted = subject = None - node_name = 'urn:xmpp:microblog:0' link_href = 'xmpp:{}?join'.format(jid_bare) link_text = 'Join' xmpp_uri = '{}'.format(jid_bare) @@ -119,7 +118,7 @@ class HttpInstance: jid_details = Data.open_file_toml(filename) else: jid_details = await FileUtilities.cache_jid_data( - jabber_id, password, jid_bare, node_name, alias=alias) + jabber_id, password, jid_bare, alias=alias) count = jid_details['count'] items = jid_details['items'] @@ -157,7 +156,7 @@ class HttpInstance: if jid_kind: # Action and instance type - action, instance = XmppUtilities.set_action_instance_type(jid_kind, node_name) + action, instance = XmppUtilities.set_action_instance_type(jid_kind) else: # jid_info['error'] action = 'Contact' instance = view_href = '' @@ -166,10 +165,10 @@ class HttpInstance: # Query URI links print('Query URI links') - links = XmppUtilities.get_query_uri_links(jid_bare, jid_kind, node_name) - link_href = XmppUtilities.get_link_href(jid_bare, jid_kind, node_name) - view_href = XmppUtilities.get_view_href(jid_bare, jid_kind, node_name) - xmpp_uri = XmppUtilities.get_xmpp_uri(jid_bare, jid_kind, node_name) + links = XmppUtilities.get_query_uri_links(jid_bare, jid_kind) + link_href = XmppUtilities.get_link_href(jid_bare, jid_kind) + view_href = XmppUtilities.get_view_href(jid_bare, jid_kind) + xmpp_uri = XmppUtilities.get_xmpp_uri(jid_bare, jid_kind) # Graphic files filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard, link_href) @@ -202,7 +201,6 @@ class HttpInstance: 'messages' : messages_10, 'node_title' : node_title, 'node_note' : node_note, - 'node_name' : node_name, 'number_of_pages' : number_of_pages, 'page_number' : page_number, 'previous' : previous, @@ -241,7 +239,7 @@ class HttpInstance: directory = 'xep_0060/{}/{}/'.format(jid_bare, node_name_vcard4) filename = directory + item_id_vcard4 + '.xml' if os.path.exists(filename) and os.path.getsize(filename) > 0: - jid_details = Data.open_file_xml(filename) + xml_data = Data.open_file_xml(filename) else: await FileUtilities.cache_vcard_data( jabber_id, password, jid_bare, node_name_vcard4, item_id_vcard4) @@ -255,13 +253,30 @@ class HttpInstance: # Action and instance type action = 'Profile' + filename = 'details/{}.toml'.format(jid_bare) + if os.path.exists(filename) and os.path.getsize(filename) > 0: + jid_details = Data.open_file_toml(filename) + else: + jid_details = await FileUtilities.cache_jid_data( + jabber_id, password, jid_bare, alias=alias) + + # Set node name to 'urn:xmpp:microblog:0' + jid_kind = jid_details['kind'] + nodes = jid_details['nodes'] + if (jid_kind not in ('conference', 'mix', 'muc') and + '@' in jid_bare and + 'urn:xmpp:microblog:0' in nodes): + node_name = 'urn:xmpp:microblog:0' + # Query URI links print('Query URI links') jid_kind = 'account' + link_href = XmppUtilities.get_link_href(jid_bare, jid_kind) xmpp_uri = XmppUtilities.get_xmpp_uri(jid_bare, jid_kind, node_name_vcard4) + links = XmppUtilities.get_query_uri_links(jid_bare, jid_kind, node_name) # Graphic files - #filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard, link_href) + filename, filepath, filetype, selection = FileUtilities.handle_photo(jid_bare, jid_vcard, link_href) #except Exception as e: else: @@ -297,11 +312,12 @@ class HttpInstance: 'chat_client' : chat_client, 'entries' : entries, 'exception' : exception, - #'filename' : filename, + 'filename' : filename, 'jid_bare' : jid, 'jid_note' : note, #'jid_title' : title, #'node_title' : node_title, + 'links' : links, 'node_name' : node_name_vcard4, 'number_of_pages' : number_of_pages, 'page_number' : page_number, @@ -658,7 +674,7 @@ class HttpInstance: 'type' : jid_details['image_type']} messages = jid_details['messages'] #note = nodes[node_name]['title'] if node_name in nodes else jid_details['note'] - note = jid_details['note'] + #note = jid_details['note'] # vCard4 node_name_vcard4 = 'urn:xmpp:vcard4' @@ -673,7 +689,7 @@ class HttpInstance: vcard_info = Syndication.extract_vcard4_items(child_element) title = vcard_info['fn'] alias = vcard_info['alias'] - note = vcard_info['note'] + #note = vcard_info['note'] else: await FileUtilities.cache_vcard_data( jabber_id, password, jid_bare, node_name_vcard4, item_id_vcard4) @@ -690,12 +706,14 @@ class HttpInstance: await FileUtilities.cache_node_data( jabber_id, password, jid_bare, node_name) - # Node items - entries = [] - node_items = os.listdir(directory) - if 'urn:xmpp:avatar:metadata.xml' in node_items: - node_items.remove('urn:xmpp:avatar:metadata.xml') - count_item = len(node_items) + # JID or node items + if jid_kind in ('mix', 'muc', 'conference', 'server'): + count_item = jid_details['count'] + elif jid_kind in ('account', 'pubsub'): + node_items = os.listdir(directory) + if 'urn:xmpp:avatar:metadata.xml' in node_items: + node_items.remove('urn:xmpp:avatar:metadata.xml') + count_item = len(node_items) # if ('@' in jid_bare and # 'urn:xmpp:microblog:0' not in nodes and @@ -747,8 +765,8 @@ class HttpInstance: jid_vcard = jid_kind = links = message = selection = url = \ vcard4 = None - note_500 = note[:500] - note = note_500 + ' …' if note_500 < note else note_500 + #note_500 = note[:500] + #note = note_500 + ' …' if note_500 < note else note_500 # NOTE Handling of variables "title" and "note" in case of '/j/{jid}/{node_name}' is confusing. # TODO Add new keys that are of 'node' and be utilized for nodes, instead of reusing a variable for several roles. @@ -1555,24 +1573,17 @@ class Syndication: else: url = '' - extra_resources = { - 'code' : [], - 'gallery' : [], - 'journal' : [], - 'movim' : [], - 'peertube' : [], - } - for res in extra_resources: - #for element in xml_data.findall(namespace + 'group[contains(@name, "{}")]'.format(res)): - #for element in xml_data.findall(namespace + 'group[strats-with(@name, "{}")]'.format(res)): - matching_elements = [group for group in xml_data.findall(namespace + "group") if res in group.get('name', '')] - for element in matching_elements: - for i in element.find(namespace + 'x-ablabel'): - txt = i.text - for i in element.find(namespace + 'url'): - uri = i.text - extra_resources[res].append({'label' : txt, 'uri' : uri}) - vcard[res] = extra_resources[res] + vcard['extras'] = {} + for element in xml_data.findall(namespace + "group"): + category = '?' + for i in element.find(namespace + 'x-ablabel'): + txt = i.text + for i in element.find(namespace + 'url'): + uri = i.text + for i in element.find(namespace + 'url/' + namespace + 'parameters/' + namespace + 'type'): + category = i.text + if not category in vcard['extras']: vcard['extras'][category] = [] + vcard['extras'][category].append({'label' : txt, 'uri' : uri}) vcard['alias'] = alias vcard['email'] = email diff --git a/xhtml/conference.xhtml b/xhtml/conference.xhtml index 20a7826..662c1f3 100644 --- a/xhtml/conference.xhtml +++ b/xhtml/conference.xhtml @@ -6,20 +6,55 @@ - {{brand_name}}: {{action}} {% if title %}{{title}}{% else %}{{jid_bare}}{% endif %} - + {{brand_name}}: {{action}} {% if alias %}{{alias}}{% else %}{{title}}{% endif %} + - + - + + {% if selection %} + + {% endif %}
@@ -32,9 +67,29 @@
-
+
+

{{title}}

+ {% if filename %} +
+ + + + +
+ {% endif %} +
+ {% if note %}{{note}}{% endif %} +
+ + {% if exception %} +
+ {{exception}} +
+ {% endif %} {% if links %} -
+ {% endif %} -
- {% if filename %} - + -
- {% if subject %} -
{{subject}}
- {% endif %} -
- {% if messages %} -
- {% for message in messages %} -
+ {% for message in messages %} +
+ 💬️ {{message['alias']}} -
{{message['body']}}
-
{{message['timestamp']}}
+
{{message['body']}}
+
- {% endfor %} + {% endfor %} +
+ {% endif %} +
+ {% if number_of_pages %} +
+ {% if number_of_pages > 3 %} + {% if page_number < 2 %} + First + Back + {% else %} + First + Back + {% endif %} + {{page_number}} + {% if page_number == number_of_pages %} + Proceed + Last + {% else %} + Proceed + Last + {% endif %} + {% else %} + {% for number in range(number_of_pages) %} + {{number+1}} + {% endfor %} + {% endif %}
{% endif %} - {% if exception %} -
- {{exception}} + {% if previous %} + {% endif %}
-
- {% if number_of_pages %} -
- {% if number_of_pages > 3 %} - {% if page_number < 2 %} - First - Back +
+ If you already have {% if news_client and jid_kind == 'pubsub' %}{{news_client}}{% elif chat_client %}{{chat_client}}{% else %}an XMPP Client{% endif %} you can +
+ {% if jid_kind in ('conference', 'mix', 'muc') %} + join to + {% elif jid_kind == 'pubsub' %} + subscribe to + {% elif jid_kind == 'bot' %} + try + {% elif jid_kind == 'server' %} + explore {% else %} - First - Back + talk with {% endif %} - {{page_number}} - {% if page_number == number_of_pages %} - Proceed - Last - {% else %} - Proceed - Last - {% endif %} - {% else %} - {% for number in range(number_of_pages) %} - {{number+1}} - {% endfor %} - {% endif %} + {{title}} + right now. +
- {% endif %} - {% if previous %} -
- Previous -
- {% endif %} {% if message %}
{{message}}
{% endif %} diff --git a/xhtml/download.xhtml b/xhtml/download.xhtml index 825339d..a14c723 100644 --- a/xhtml/download.xhtml +++ b/xhtml/download.xhtml @@ -36,7 +36,7 @@ < Systems

{{title}}

{% if skipped %} - All clients > + Clients > {% elif not featured %} Featured > {% else %} @@ -72,12 +72,12 @@ + Recommended: We advise installing an XMPP client with the F-Droid repository, to ensure that you are always using the most updated and secure version of your XMPP chat client of choice, with the latest and best that XMPP has to offer. - (recommended) @@ -85,13 +85,13 @@ + Optional: We further suggest using an updated Android system. If your smartphone manufacturer has ceased to provide updates, then you can install DivestOS Mobile, GrapheneOS or find another custom ROM for your device at CustomRomBay. - (optional)
@@ -175,6 +175,7 @@
+ {{client['name']}}
diff --git a/xhtml/jid.xhtml b/xhtml/jid.xhtml index 5c76085..ee54fb2 100644 --- a/xhtml/jid.xhtml +++ b/xhtml/jid.xhtml @@ -103,12 +103,27 @@
- {% if count_item or count_message %} - {% if count_item %}{{count_item}} {{instance}}{% elif count_message %}Preview{% endif %} - + {% if jid_kind in ('conference', 'mix', 'muc') %} + {% if count_message %} + + {% if count_item %} + {{count_item}} {{instance}} + {% else %} + Preview + {% endif %} + + {% else %} + + {{count_item}} {{instance}} + + {% endif %} + {% elif count_item %} + + {{instance}} + {% endif %} {% if vcard4 %} - my profile + interests {% endif %}
diff --git a/xhtml/node.xhtml b/xhtml/node.xhtml index 648fb7e..2859691 100644 --- a/xhtml/node.xhtml +++ b/xhtml/node.xhtml @@ -6,20 +6,55 @@ - {{brand_name}}: {{action}} {% if title %}{{title}}{% else %}{{jid_bare}}{% endif %} - + {{brand_name}}: {{action}} {% if alias %}{{alias}}{% else %}{{title}}{% endif %} + - + - + + {% if selection %} + + {% endif %}
@@ -32,9 +67,29 @@
-
+
+

{{title}}

+ {% if filename %} +
+ + + + +
+ {% endif %} +
+ {% if note %}{{note}}{% endif %} +
+ + {% if exception %} +
+ {{exception}} +
+ {% endif %} {% if links %} -
+ {% endif %} -
- {% if filename %} - - {% endif %} - -

{{node_title}}

-
-

{{jid_title}}

-
- {% if node_note %} -

- {{node_note}} -

- {% endif %} - - -
- {% if entries %} -
- {% for entry in entries %} -
- {{entry['title']}} -
{{entry['content'] or entry['summary']}}
-
{{entry['updated'] or entry['published']}}
- {% if entry['tags'] %} -
- Tags: - {% for tag in entry['tags'] %} - {{tag}} - {% endfor %} +
+ {% if entries %} +
+ {% for entry in entries %} +
+

+ 📜️ + {{entry['title']}} +

+
{{entry['content'] or entry['summary']}}
+ + {% if entry['tags'] %} +
+ Tags: + {% for tag in entry['tags'] %} + {{tag}} + {% endfor %} +
+ {% endif %} + - {% endif %} - -
- {% endfor %} -
- {% endif %} - {% if exception %} -
- {{exception}} -
- {% endif %} + {% endfor %} +
+ {% endif %} +
{% if number_of_pages %}
{% if number_of_pages > 3 %} @@ -117,23 +156,26 @@ {% endif %} {% if previous %} {% endif %} - - - +
+
+ If you already have {% if news_client and jid_kind == 'pubsub' %}{{news_client}}{% elif chat_client %}{{chat_client}}{% else %}an XMPP Client{% endif %} you can +
+ {% if jid_kind in ('conference', 'mix', 'muc') %} + join to + {% elif jid_kind == 'pubsub' %} + subscribe to + {% elif jid_kind == 'bot' %} + try + {% elif jid_kind == 'server' %} + explore + {% else %} + talk with + {% endif %} + {{title}} + right now.
{% if message %} diff --git a/xhtml/vcard.xhtml b/xhtml/vcard.xhtml index 3689dc8..e67ce93 100644 --- a/xhtml/vcard.xhtml +++ b/xhtml/vcard.xhtml @@ -20,6 +20,41 @@ + {% if selection %} + + {% endif %}
@@ -36,65 +71,26 @@

{% if 'fn' in vcard_info and vcard_info['fn'] %} {{vcard_info['fn']}} + {% elif title %} + {{title}} {% else %} {{jid_bare}} {% endif %}

- {% if 'org' in vcard_info and vcard_info['org'] %} -

{{vcard_info['org']}}

+ {% if filename %} +
+ + + + +
{% endif %} - {% if 'note' in vcard_info and vcard_info['note'] %} -
{{vcard_info['note']}}
- {% endif %} - - -
- {% for i in vcard_info %} - - {% endfor %} +
+ {% if note %}{{note}}{% endif %}
+ {% if exception %}
{{exception}} @@ -109,23 +105,57 @@ {% endfor %}
{% endif %} - - {% if count or jid_kind in ('conference', 'mix', 'muc') %} -
- - {% if count %} - {{count}} {{instance}} - {% elif jid_kind in ('conference', 'mix', 'muc') %} - Preview - {% endif %} - +
+ {% if 'org' in vcard_info and vcard_info['org'] %} +

{{vcard_info['org']}}

+ {% endif %} + {% if 'note' in vcard_info and vcard_info['note'] %} +
{{vcard_info['note']}}
+ {% endif %} + + +
+ {% if previous %} + {% endif %}
+
+ If you already have {% if news_client and jid_kind == 'pubsub' %}{{news_client}}{% elif chat_client %}{{chat_client}}{% else %}an XMPP Client{% endif %} you can +
+ {% if jid_kind in ('conference', 'mix', 'muc') %} + join to + {% elif jid_kind == 'pubsub' %} + subscribe to + {% elif jid_kind == 'bot' %} + try + {% elif jid_kind == 'server' %} + explore + {% else %} + talk with + {% endif %} + {{title}} + right now. +
{% if message %}
{{message}}