Changeset 746d98a in Klonkt for src/services
- Timestamp:
- 09/30/2026 09:08:48 AM (4 hours ago)
- Branches:
- main
- Parents:
- 31680c3
- Location:
- src/services
- Files:
-
- 2 edited
-
PlatformIcons.js (modified) (1 diff)
-
i18n.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/services/PlatformIcons.js
r31680c3 r746d98a 127 127 } 128 128 129 export default { PLATFORMS, PLATFORM_ORDER, listPlatforms, CONTACT_PLATFORMS, linkHref }; 129 /** 130 * De profiellinks uit een formulier (profile_link_platform[] + profile_link_url[]) 131 * als de JSON die in sites.profile_links staat, of null als er niets over is. 132 * 133 * Stond in routes/admin-sites.js, toen de links op de Appearance-pagina stonden. 134 * Sinds 30-9 bewerk je ze bij je profiel (/account), en een tweede kopie van 135 * deze keuring loopt gegarandeerd uit de pas -- dus hij staat hier. 136 */ 137 export function buildProfileLinks(body) { 138 const platforms = (body && body.profile_link_platform) || []; 139 const urls = (body && body.profile_link_url) || []; 140 const arr = []; 141 const platformsArr = Array.isArray(platforms) ? platforms : [platforms]; 142 const urlsArr = Array.isArray(urls) ? urls : [urls]; 143 for (let i = 0; i < platformsArr.length; i++) { 144 const p = (platformsArr[i] || '').toString().trim(); 145 const u = (urlsArr[i] || '').toString().trim(); 146 if (!p || !u) continue; 147 if (!PLATFORMS[p]) continue; 148 if (!/^https?:\/\//i.test(u) && p !== 'email') continue; 149 if (p === 'email' && !/^mailto:|^[^\s@]+@[^\s@]+$/i.test(u)) continue; 150 arr.push({ platform: p, url: u }); 151 } 152 return arr.length ? JSON.stringify(arr) : null; 153 } 154 155 /** sites.profile_links terug als lijst; een kapotte waarde is een lege lijst. */ 156 export function parseProfileLinks(json) { 157 if (!json) return []; 158 try { const a = JSON.parse(json); return Array.isArray(a) ? a : []; } catch { return []; } 159 } 160 161 export default { PLATFORMS, PLATFORM_ORDER, listPlatforms, CONTACT_PLATFORMS, linkHref, buildProfileLinks, parseProfileLinks }; -
src/services/i18n.js
r31680c3 r746d98a 843 843 'acct.tagline': 'Tagline', 844 844 'acct.tagline_hint': '— korte oneliner (optioneel)', 845 ' acct.site_save': 'Site opslaan',845 'ward.followers_only': 'Berichten van {name} zijn alleen te zien voor volgers.', 'asite.links_moved': 'Je profiellinks staan nu bij je profiel.', 'asite.links_moved_link': 'Naar je profiel', 'acct.links_save': 'Links opslaan', 'acct.link_platform': 'Platform', 'acct.link_url': 'Adres', 'acct.link_remove': 'Link weghalen', 'acct.site_save': 'Site opslaan', 846 846 'acct.password_change': 'Wachtwoord wijzigen', 847 847 'acct.password_current': 'Huidig wachtwoord', … … 1852 1852 'acct.tagline': 'Tagline', 1853 1853 'acct.tagline_hint': '— short one-liner (optional)', 1854 ' acct.site_save': 'Save site',1854 'ward.followers_only': 'Posts by {name} are only visible to followers.', 'asite.links_moved': 'Your profile links now live with your profile.', 'asite.links_moved_link': 'Go to your profile', 'acct.links_save': 'Save links', 'acct.link_platform': 'Platform', 'acct.link_url': 'Address', 'acct.link_remove': 'Remove link', 'acct.site_save': 'Save site', 1855 1855 'acct.password_change': 'Change password', 1856 1856 'acct.password_current': 'Current password', … … 2861 2861 'acct.tagline': 'Slogan', 2862 2862 'acct.tagline_hint': '— kurzer Einzeiler (optional)', 2863 ' acct.site_save': 'Seite speichern',2863 'ward.followers_only': 'Beiträge von {name} sind nur für Follower sichtbar.', 'asite.links_moved': 'Deine Profil-Links findest du jetzt bei deinem Profil.', 'asite.links_moved_link': 'Zum Profil', 'acct.links_save': 'Links speichern', 'acct.link_platform': 'Plattform', 'acct.link_url': 'Adresse', 'acct.link_remove': 'Link entfernen', 'acct.site_save': 'Seite speichern', 2864 2864 'acct.password_change': 'Passwort ändern', 2865 2865 'acct.password_current': 'Aktuelles Passwort',
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)