Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
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
facil
parlote-facil
Validations
94ad9264
Valider
94ad9264
rédigé
il y a 13 ans
par
danielgrippi
Validation de
Dennis Collinson
il y a 13 ans
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
DG DH; wip
parent
168d6cbd
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
public/javascripts/vendor/jquery.mentionsInput.js
+17
-18
17 ajouts, 18 suppressions
public/javascripts/vendor/jquery.mentionsInput.js
public/stylesheets/sass/mentions.scss
+6
-5
6 ajouts, 5 suppressions
public/stylesheets/sass/mentions.scss
avec
23 ajouts
et
23 suppressions
public/javascripts/vendor/jquery.mentionsInput.js
+
17
−
18
Voir le fichier @
94ad9264
...
@@ -28,8 +28,8 @@
...
@@ -28,8 +28,8 @@
autocompleteListItemAvatar
:
_
.
template
(
'
<img src="<%= avatar %>" />
'
),
autocompleteListItemAvatar
:
_
.
template
(
'
<img src="<%= avatar %>" />
'
),
autocompleteListItemIcon
:
_
.
template
(
'
<div class="icon <%= icon %>"></div>
'
),
autocompleteListItemIcon
:
_
.
template
(
'
<div class="icon <%= icon %>"></div>
'
),
mentionsOverlay
:
_
.
template
(
'
<div class="mentions"><div></div></div>
'
),
mentionsOverlay
:
_
.
template
(
'
<div class="mentions"><div></div></div>
'
),
mentionItemSyntax
:
_
.
template
(
'
@[<%=
valu
e %>](<%= type %>:<%= id %>)
'
),
mentionItemSyntax
:
_
.
template
(
'
@[<%=
nam
e %>](<%= type %>:<%= id %>)
'
),
mentionItemHighlight
:
_
.
template
(
'
<strong><span><%=
valu
e %></span></strong>
'
)
mentionItemHighlight
:
_
.
template
(
'
<strong><span><%=
nam
e %></span></strong>
'
)
}
}
};
};
...
@@ -104,15 +104,15 @@
...
@@ -104,15 +104,15 @@
var
syntaxMessage
=
getInputBoxValue
();
var
syntaxMessage
=
getInputBoxValue
();
_
.
each
(
mentionsCollection
,
function
(
mention
)
{
_
.
each
(
mentionsCollection
,
function
(
mention
)
{
var
textSyntax
=
settings
.
templates
.
mentionItemSyntax
({
valu
e
:
mention
.
valu
e
,
type
:
'
contact
'
,
id
:
mention
.
id
});
var
textSyntax
=
settings
.
templates
.
mentionItemSyntax
({
nam
e
:
mention
.
nam
e
,
type
:
'
contact
'
,
id
:
mention
.
id
,
mention
:
mention
});
syntaxMessage
=
syntaxMessage
.
replace
(
mention
.
valu
e
,
textSyntax
);
syntaxMessage
=
syntaxMessage
.
replace
(
mention
.
nam
e
,
textSyntax
);
});
});
var
mentionText
=
utils
.
htmlEncode
(
syntaxMessage
);
var
mentionText
=
utils
.
htmlEncode
(
syntaxMessage
);
_
.
each
(
mentionsCollection
,
function
(
mention
)
{
_
.
each
(
mentionsCollection
,
function
(
mention
)
{
var
textSyntax
=
settings
.
templates
.
mentionItemSyntax
({
valu
e
:
utils
.
htmlEncode
(
mention
.
valu
e
),
type
:
'
contact
'
,
id
:
mention
.
id
});
var
textSyntax
=
settings
.
templates
.
mentionItemSyntax
({
nam
e
:
utils
.
htmlEncode
(
mention
.
nam
e
),
type
:
'
contact
'
,
id
:
mention
.
id
,
mention
:
mention
});
var
textHighlight
=
settings
.
templates
.
mentionItemHighlight
({
valu
e
:
utils
.
htmlEncode
(
mention
.
value
)
});
var
textHighlight
=
settings
.
templates
.
mentionItemHighlight
({
nam
e
:
utils
.
htmlEncode
(
mention
.
name
),
mention
:
mention
});
mentionText
=
mentionText
.
replace
(
textSyntax
,
textHighlight
);
mentionText
=
mentionText
.
replace
(
textSyntax
,
textHighlight
);
});
});
...
@@ -132,12 +132,12 @@
...
@@ -132,12 +132,12 @@
var
inputText
=
getInputBoxValue
();
var
inputText
=
getInputBoxValue
();
mentionsCollection
=
_
.
reject
(
mentionsCollection
,
function
(
mention
,
index
)
{
mentionsCollection
=
_
.
reject
(
mentionsCollection
,
function
(
mention
,
index
)
{
return
!
mention
.
valu
e
||
inputText
.
indexOf
(
mention
.
valu
e
)
==
-
1
;
return
!
mention
.
nam
e
||
inputText
.
indexOf
(
mention
.
nam
e
)
==
-
1
;
});
});
mentionsCollection
=
_
.
compact
(
mentionsCollection
);
mentionsCollection
=
_
.
compact
(
mentionsCollection
);
}
}
function
addMention
(
value
,
id
,
type
)
{
function
addMention
(
mention
)
{
var
currentMessage
=
getInputBoxValue
();
var
currentMessage
=
getInputBoxValue
();
// Using a regex to figure out positions
// Using a regex to figure out positions
...
@@ -149,15 +149,11 @@
...
@@ -149,15 +149,11 @@
var
start
=
currentMessage
.
substr
(
0
,
startCaretPosition
);
var
start
=
currentMessage
.
substr
(
0
,
startCaretPosition
);
var
end
=
currentMessage
.
substr
(
currentCaretPosition
,
currentMessage
.
length
);
var
end
=
currentMessage
.
substr
(
currentCaretPosition
,
currentMessage
.
length
);
var
startEndIndex
=
(
start
+
valu
e
).
length
;
var
startEndIndex
=
(
start
+
mention
.
nam
e
).
length
;
var
updatedMessageText
=
start
+
valu
e
+
end
;
var
updatedMessageText
=
start
+
mention
.
nam
e
+
end
;
mentionsCollection
.
push
({
mentionsCollection
.
push
(
mention
);
id
:
id
,
type
:
type
,
value
:
value
});
// Cleaning before inserting the value, otherwise auto-complete would be triggered with "old" inputbuffer
// Cleaning before inserting the value, otherwise auto-complete would be triggered with "old" inputbuffer
resetBuffer
();
resetBuffer
();
...
@@ -180,7 +176,7 @@
...
@@ -180,7 +176,7 @@
function
onAutoCompleteItemClick
(
e
)
{
function
onAutoCompleteItemClick
(
e
)
{
var
elmTarget
=
$
(
this
);
var
elmTarget
=
$
(
this
);
addMention
(
elmTarget
.
attr
(
'
data-display
'
),
elmTarget
.
attr
(
'
data-ref-id
'
),
elmTarget
.
attr
(
'
data-ref-type
'
));
addMention
(
elmTarget
.
data
(
"
mention
"
));
return
false
;
return
false
;
}
}
...
@@ -295,10 +291,12 @@
...
@@ -295,10 +291,12 @@
'
content
'
:
utils
.
highlightTerm
(
utils
.
htmlEncode
((
item
.
name
)),
query
)
'
content
'
:
utils
.
highlightTerm
(
utils
.
htmlEncode
((
item
.
name
)),
query
)
}));
}));
if
(
index
===
0
)
{
if
(
index
===
0
)
{
selectAutoCompleteItem
(
elmListItem
);
selectAutoCompleteItem
(
elmListItem
);
}
}
elmListItem
.
data
(
"
mention
"
,
item
);
if
(
settings
.
showAvatars
)
{
if
(
settings
.
showAvatars
)
{
var
elmIcon
;
var
elmIcon
;
...
@@ -344,6 +342,7 @@
...
@@ -344,6 +342,7 @@
},
},
reset
:
function
()
{
reset
:
function
()
{
debugger
;
elmInputBox
.
val
(
''
);
elmInputBox
.
val
(
''
);
mentionsCollection
=
[];
mentionsCollection
=
[];
updateValues
();
updateValues
();
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
public/stylesheets/sass/mentions.scss
+
6
−
5
Voir le fichier @
94ad9264
...
@@ -70,13 +70,14 @@
...
@@ -70,13 +70,14 @@
bottom
:
0
;
bottom
:
0
;
color
:
white
;
color
:
white
;
font-size
:
14px
;
font-size
:
14px
;
left
:
1px
;
font-family
:
Arial
,
Helvetica
,
sans-serif
;
left
:
4px
;
line-height
:
normal
;
line-height
:
normal
;
overflow
:
hidden
;
overflow
:
hidden
;
padding
:
6px
0px
3px
;
padding
:
6px
0px
3px
;
position
:
absolute
;
position
:
absolute
;
right
:
0
;
right
:
0
;
top
:
-
1
px
;
top
:
-
2
px
;
white-space
:
pre-wrap
;
white-space
:
pre-wrap
;
word-wrap
:
break-word
;
word-wrap
:
break-word
;
...
@@ -85,9 +86,9 @@
...
@@ -85,9 +86,9 @@
white-space
:
pre-wrap
;
white-space
:
pre-wrap
;
width
:
100%
;
width
:
100%
;
strong
{
background
:
#d8dfea
;
}
strong
{
background
:
#d8dfea
;
em
{
font-weight
:
normal
;
}
}
}
}
}
}
...
...
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