mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 03:51:48 +00:00
ios: contacts UI improvements
This commit is contained in:
+30
-9
@@ -6,6 +6,7 @@ const uri = require('fast-uri')
|
||||
const i18n = require('eleventy-plugin-i18n')
|
||||
const fs = require("fs")
|
||||
const path = require("path")
|
||||
const matter = require('gray-matter')
|
||||
const pluginRss = require('@11ty/eleventy-plugin-rss')
|
||||
const { JSDOM } = require('jsdom')
|
||||
|
||||
@@ -388,16 +389,36 @@ module.exports = function (ty) {
|
||||
linkify: true,
|
||||
replaceLink: function (link, _env) {
|
||||
let parsed = uri.parse(link)
|
||||
if (parsed.scheme || parsed.host || !parsed.path.endsWith(".md")) {
|
||||
return link
|
||||
if (parsed.scheme || parsed.host) return link
|
||||
|
||||
let hostFile = path.resolve(_env.page.inputPath)
|
||||
let linkFile = path.resolve(hostFile, '..', parsed.path)
|
||||
if (parsed.path.startsWith('/')) {
|
||||
let srcIndex = hostFile.indexOf("/src")
|
||||
if (srcIndex !== -1) {
|
||||
linkFile = path.join(hostFile.slice(0, srcIndex + 4), parsed.path)
|
||||
}
|
||||
}
|
||||
if (parsed.path.startsWith("../../blog")) {
|
||||
parsed.path = parsed.path.replace("../../blog", "/blog")
|
||||
|
||||
if (fs.existsSync(linkFile) && fs.statSync(linkFile).isFile()) {
|
||||
// this condition works if the link is a valid website file
|
||||
const fileContent = fs.readFileSync(linkFile, 'utf8')
|
||||
parsed.path = (matter(fileContent).data?.permalink || parsed.path).replace(/\.md$/, ".html").toLowerCase()
|
||||
} else if (!fs.existsSync(linkFile)) {
|
||||
linkFile = linkFile.replace('/website/src', '')
|
||||
if (fs.existsSync(linkFile)) {
|
||||
// this condition works if the link is a valid project file
|
||||
const githubUrl = "https://github.com/simplex-chat/simplex-chat/blob/stable"
|
||||
const keyword = "/simplex-chat"
|
||||
index = linkFile.indexOf(keyword)
|
||||
linkFile = linkFile.substring(index + keyword.length)
|
||||
parsed.path = `${githubUrl}${linkFile}`
|
||||
} else {
|
||||
// if the link is not a valid website file or project file
|
||||
throw new Error(`Broken link: ${parsed.path} in ${hostFile}`)
|
||||
}
|
||||
}
|
||||
if (parsed.path.startsWith("../PRIVACY.md")) {
|
||||
parsed.path = parsed.path.replace("../PRIVACY.md", "/privacy")
|
||||
}
|
||||
parsed.path = parsed.path.replace(/\.md$/, ".html").toLowerCase()
|
||||
|
||||
return uri.serialize(parsed)
|
||||
}
|
||||
}).use(markdownItAnchor, {
|
||||
@@ -422,4 +443,4 @@ module.exports = function (ty) {
|
||||
htmlTemplateEngine: 'njk',
|
||||
dataTemplateEngine: 'njk',
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<p class="mb-[12px]">When it comes to open source privacy tools, the status quo often dictates the limitations of
|
||||
existing protocols and
|
||||
structures. However, these norms need to be challenged to radically shift how we approach genuinely
|
||||
private communication. This requires doing some uncomfortable things, like making hard choices as it relates to
|
||||
funding, alternative decentralization models, doubling down on privacy over convenience, and more.
|
||||
</p>
|
||||
|
||||
<p class="mb-[12px]">In this post we explain a bit more about why SimpleX operates and makes decisions the way it does:
|
||||
</p>
|
||||
|
||||
<ul class="mb-[12px]">
|
||||
<li>No user accounts.</li>
|
||||
<li>Privacy over convenience.</li>
|
||||
<li>Network decentralization.</li>
|
||||
<li>Funding and profitability.</li>
|
||||
<li>Company jurisdiction.</li>
|
||||
</ul>
|
||||
@@ -24,9 +24,8 @@ var TransformOperation;
|
||||
let activeCall;
|
||||
const processCommand = (function () {
|
||||
const defaultIceServers = [
|
||||
{ urls: ["stuns:stun.simplex.im:443"] },
|
||||
{ urls: ["stun:stun.simplex.im:443"] },
|
||||
{ urls: ["turns:turn.simplex.im:443"], username: "private2", credential: "Hxuq2QxUjnhj96Zq2r4HjqHRj" },
|
||||
{ urls: ["turn:turn.simplex.im:443"], username: "private", credential: "yleob6AVkiNI87hpR94Z" },
|
||||
];
|
||||
function getCallConfig(encodedInsertableStreams, iceServers, relay) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user