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
502d91fc
Valider
502d91fc
rédigé
3 years ago
par
Tulir Asokan
Parcourir les fichiers
Options
Téléchargements
Plain Diff
Merge remote-tracking branch 'p1gp1g/dev'
parents
591137cc
79397933
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
web/src/index.js
+14
-8
14 ajouts, 8 suppressions
web/src/index.js
avec
14 ajouts
et
8 suppressions
web/src/index.js
+
14
−
8
Voir le fichier @
502d91fc
...
...
@@ -21,6 +21,12 @@ import * as frequent from "./frequently-used.js"
// The base URL for fetching packs. The app will first fetch ${PACK_BASE_URL}/index.json,
// then ${PACK_BASE_URL}/${packFile} for each packFile in the packs object of the index.json file.
const
PACKS_BASE_URL
=
"
packs
"
let
INDEX
=
`
${
PACKS_BASE_URL
}
/index.json`
const
params
=
new
URLSearchParams
(
document
.
location
.
search
)
if
(
params
.
has
(
'
config
'
))
{
INDEX
=
params
.
get
(
"
config
"
)
}
// This is updated from packs/index.json
let
HOMESERVER_URL
=
"
https://matrix-client.matrix.org
"
...
...
@@ -30,17 +36,12 @@ const makeThumbnailURL = mxc => `${HOMESERVER_URL}/_matrix/media/r0/thumbnail/${
// This is also used to fix scrolling to sections on Element iOS
const
isMobileSafari
=
navigator
.
userAgent
.
match
(
/
(
iPod|iPhone|iPad
)
/
)
&&
navigator
.
userAgent
.
match
(
/AppleWebKit/
)
export
const
parseQuery
=
str
=>
Object
.
fromEntries
(
str
.
split
(
"
&
"
)
.
map
(
part
=>
part
.
split
(
"
=
"
))
.
map
(([
key
,
value
=
""
])
=>
[
key
,
value
]))
const
supportedThemes
=
[
"
light
"
,
"
dark
"
,
"
black
"
]
class
App
extends
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
defaultTheme
=
par
seQuery
(
location
.
search
.
substr
(
1
)).
theme
this
.
defaultTheme
=
par
ams
.
get
(
"
theme
"
)
this
.
state
=
{
packs
:
[],
loading
:
true
,
...
...
@@ -117,7 +118,7 @@ class App extends Component {
_loadPacks
(
disableCache
=
false
)
{
const
cache
=
disableCache
?
"
no-cache
"
:
undefined
fetch
(
`
${
PACKS_BASE_URL
}
/index.json`
,
{
cache
}).
then
(
async
indexRes
=>
{
fetch
(
INDEX
,
{
cache
}).
then
(
async
indexRes
=>
{
if
(
indexRes
.
status
>=
400
)
{
this
.
setState
({
loading
:
false
,
...
...
@@ -129,7 +130,12 @@ class App extends Component {
HOMESERVER_URL
=
indexData
.
homeserver_url
||
HOMESERVER_URL
// TODO only load pack metadata when scrolled into view?
for
(
const
packFile
of
indexData
.
packs
)
{
const
packRes
=
await
fetch
(
`
${
PACKS_BASE_URL
}
/
${
packFile
}
`
,
{
cache
})
let
packRes
if
(
packFile
.
startsWith
(
"
https://
"
)
||
packFile
.
startsWith
(
"
http://
"
))
{
packRes
=
await
fetch
(
packFile
,
{
cache
})
}
else
{
packRes
=
await
fetch
(
`
${
PACKS_BASE_URL
}
/
${
packFile
}
`
,
{
cache
})
}
const
packData
=
await
packRes
.
json
()
for
(
const
sticker
of
packData
.
stickers
)
{
this
.
stickersByID
.
set
(
sticker
.
id
,
sticker
)
...
...
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