Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
stickerpicker
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneur
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
stickerpicker
Validations
f245eb78
Valider
f245eb78
rédigé
1 year ago
par
salixor
Validation de
salixor
Il y a 11 mois
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Provide a config for a homeserver with animated media support
parent
333567f4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
packs/README.md
+2
-1
2 ajouts, 1 suppression
packs/README.md
web/src/index.js
+16
-6
16 ajouts, 6 suppressions
web/src/index.js
avec
18 ajouts
et
7 suppressions
packs/README.md
+
2
−
1
Voir le fichier @
f245eb78
...
@@ -9,7 +9,8 @@ array. The index.json file should look something like this:
...
@@ -9,7 +9,8 @@ array. The index.json file should look something like this:
```
json
```
json
{
{
"homeserver_url"
:
"https://example.com"
,
"homeserver_url"
:
"https://example.com"
,
//
required
"homeserver_animated_url"
:
"https://example.com"
,
//
optional
:
the
URL
of
a
webserver
which
provides
a
media
repo
with
animated
media
support
"packs"
:
[
"packs"
:
[
"your_telegram_imported_pack.json"
,
"your_telegram_imported_pack.json"
,
"another_telegram_imported_pack.json"
,
"another_telegram_imported_pack.json"
,
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
web/src/index.js
+
16
−
6
Voir le fichier @
f245eb78
...
@@ -29,10 +29,19 @@ const params = new URLSearchParams(document.location.search)
...
@@ -29,10 +29,19 @@ const params = new URLSearchParams(document.location.search)
if
(
params
.
has
(
'
config
'
))
{
if
(
params
.
has
(
'
config
'
))
{
INDEX
=
params
.
get
(
"
config
"
)
INDEX
=
params
.
get
(
"
config
"
)
}
}
// This is updated from packs/index.json
// This is updated from packs/index.json
let
HOMESERVER_URL
=
"
https://matrix-client.matrix.org
"
let
HOMESERVER_URL
=
"
https://matrix-client.matrix.org
"
let
HOMESERVER_ANIMATED_URL
=
HOMESERVER_URL
const
isAnimated
=
(
content
)
=>
{
return
content
.
info
[
"
mimetype
"
]
===
"
image/gif
"
;
};
const
makeThumbnailURL
=
mxc
=>
`
${
HOMESERVER_URL
}
/_matrix/media/v3/thumbnail/
${
mxc
.
slice
(
6
)}
?height=128&width=128&method=scale`
const
makeThumbnailURL
=
(
content
)
=>
{
const
homeServerUrl
=
isAnimated
(
content
)
?
HOMESERVER_ANIMATED_URL
:
HOMESERVER_URL
;
return
`
${
homeServerUrl
}
/_matrix/media/v3/thumbnail/
${
content
.
url
.
slice
(
6
)}
?height=128&width=128&method=scale`
;
};
// We need to detect iOS webkit because it has a bug related to scrolling non-fixed divs
// We need to detect iOS webkit because it has a bug related to scrolling non-fixed divs
// This is also used to fix scrolling to sections on Element iOS
// This is also used to fix scrolling to sections on Element iOS
...
@@ -166,6 +175,7 @@ class App extends Component {
...
@@ -166,6 +175,7 @@ class App extends Component {
}
}
const
indexData
=
await
indexRes
.
json
()
const
indexData
=
await
indexRes
.
json
()
HOMESERVER_URL
=
indexData
.
homeserver_url
||
HOMESERVER_URL
HOMESERVER_URL
=
indexData
.
homeserver_url
||
HOMESERVER_URL
HOMESERVER_ANIMATED_URL
=
indexData
.
homeserver_animated_url
||
HOMESERVER_URL
if
(
indexData
.
giphy_api_key
!==
undefined
)
{
if
(
indexData
.
giphy_api_key
!==
undefined
)
{
setGiphyAPIKey
(
indexData
.
giphy_api_key
,
indexData
.
giphy_mxc_prefix
)
setGiphyAPIKey
(
indexData
.
giphy_api_key
,
indexData
.
giphy_mxc_prefix
)
}
}
...
@@ -376,7 +386,7 @@ const NavBarItem = ({pack, iconOverride = null, onClickOverride = null, extraCla
...
@@ -376,7 +386,7 @@ const NavBarItem = ({pack, iconOverride = null, onClickOverride = null, extraCla
${
iconOverride
?
html
`
${
iconOverride
?
html
`
<span class="icon icon-
${
iconOverride
}
"/>
<span class="icon icon-
${
iconOverride
}
"/>
`
:
html
`
`
:
html
`
<img src=
${
makeThumbnailURL
(
pack
.
stickers
[
0
]
.
url
)}
<img src=
${
makeThumbnailURL
(
pack
.
stickers
[
0
])}
alt=
${
pack
.
stickers
[
0
].
body
}
class="visible" />
alt=
${
pack
.
stickers
[
0
].
body
}
class="visible" />
`
}
`
}
</div>
</div>
...
@@ -388,15 +398,15 @@ const Pack = ({pack, send}) => html`
...
@@ -388,15 +398,15 @@ const Pack = ({pack, send}) => html`
<h1>
${
pack
.
title
}
</h1>
<h1>
${
pack
.
title
}
</h1>
<div class="sticker-list">
<div class="sticker-list">
${
pack
.
stickers
.
map
(
sticker
=>
html
`
${
pack
.
stickers
.
map
(
sticker
=>
html
`
<
${
Sticker
}
key=
${
sticker
.
id
}
content
=
${
sticker
}
send=
${
send
}
/>
<
${
Sticker
}
key=
${
sticker
.
id
}
sticker
=
${
sticker
}
send=
${
send
}
/>
`
)}
`
)}
</div>
</div>
</section>
</section>
`
`
const
Sticker
=
({
content
,
send
})
=>
html
`
const
Sticker
=
({
sticker
,
send
})
=>
html
`
<div class="sticker" onClick=
${
send
}
data-sticker-id=
${
content
.
id
}
>
<div class="sticker" onClick=
${
send
}
data-sticker-id=
${
sticker
.
id
}
>
<img data-src=
${
makeThumbnailURL
(
content
.
url
)}
alt=
${
content
.
body
}
title=
${
content
.
body
}
/>
<img data-src=
${
makeThumbnailURL
(
sticker
)}
alt=
${
sticker
.
body
}
title=
${
sticker
.
body
}
/>
</div>
</div>
`
`
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter