Commit 9d44ccec authored by Ronan Abhamon's avatar Ronan Abhamon

fix(ui/scripts/Utils/utils): escape properly quotes in `openConfirmDialog`

parent 21120bd1
...@@ -135,11 +135,11 @@ ...@@ -135,11 +135,11 @@
</message> </message>
<message> <message>
<source>removeAllEntriesDescription</source> <source>removeAllEntriesDescription</source>
<translation type="unfinished"></translation> <translation>Êtes-vous sûr de vouloir supprimer cet historique ?</translation>
</message> </message>
<message> <message>
<source>removeAllEntriesTitle</source> <source>removeAllEntriesTitle</source>
<translation type="unfinished"></translation> <translation>Suppression de l'historique</translation>
</message> </message>
</context> </context>
<context> <context>
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
</message> </message>
<message> <message>
<source>attachmentTooltip</source> <source>attachmentTooltip</source>
<translation type="unfinished"></translation> <translation>Envoyer un fichier</translation>
</message> </message>
</context> </context>
<context> <context>
...@@ -170,41 +170,29 @@ ...@@ -170,41 +170,29 @@
<source>incomingCall</source> <source>incomingCall</source>
<translation>Appel entrant</translation> <translation>Appel entrant</translation>
</message> </message>
<message>
<source>hangup</source>
<translation type="vanished">Fin d&apos;appel</translation>
</message>
<message>
<source>lostIncomingCall</source>
<translation type="vanished">Appel entrant manqué</translation>
</message>
<message>
<source>lostOutgoingCall</source>
<translation type="vanished">Appel sortant manqué</translation>
</message>
<message> <message>
<source>outgoingCall</source> <source>outgoingCall</source>
<translation type="unfinished"></translation> <translation>Appel sortant</translation>
</message> </message>
<message> <message>
<source>declinedIncomingCall</source> <source>declinedIncomingCall</source>
<translation type="unfinished"></translation> <translation>Appel entrant refusé</translation>
</message> </message>
<message> <message>
<source>declinedOutgoingCall</source> <source>declinedOutgoingCall</source>
<translation type="unfinished"></translation> <translation>Appel sortant refusé</translation>
</message> </message>
<message> <message>
<source>endedCall</source> <source>endedCall</source>
<translation type="unfinished"></translation> <translation>Fin d'appel</translation>
</message> </message>
<message> <message>
<source>missedIncomingCall</source> <source>missedIncomingCall</source>
<translation type="unfinished"></translation> <translation>Appel entrant manqué</translation>
</message> </message>
<message> <message>
<source>missedOutgoingCall</source> <source>missedOutgoingCall</source>
<translation type="unfinished"></translation> <translation>Appel sortant sans réponse</translation>
</message> </message>
</context> </context>
<context> <context>
...@@ -319,7 +307,7 @@ ...@@ -319,7 +307,7 @@
<name>PresenceString</name> <name>PresenceString</name>
<message> <message>
<source>presenceOnline</source> <source>presenceOnline</source>
<translation type="unfinished"></translation> <translation>En ligne</translation>
</message> </message>
<message> <message>
<source>presenceOutToLunch</source> <source>presenceOutToLunch</source>
...@@ -339,7 +327,7 @@ ...@@ -339,7 +327,7 @@
</message> </message>
<message> <message>
<source>presenceOffline</source> <source>presenceOffline</source>
<translation type="unfinished"></translation> <translation>Hors-ligne</translation>
</message> </message>
<message> <message>
<source>presenceUnknown</source> <source>presenceUnknown</source>
......
...@@ -28,7 +28,7 @@ QtObject { ...@@ -28,7 +28,7 @@ QtObject {
} }
property QtObject text: QtObject { property QtObject text: QtObject {
property int fontSize: 13 property int fontSize: 11
property QtObject color: QtObject { property QtObject color: QtObject {
property color normal: Colors.k50 property color normal: Colors.k50
......
...@@ -80,7 +80,6 @@ function getTopParent (object, useFakeParent) { ...@@ -80,7 +80,6 @@ function getTopParent (object, useFakeParent) {
var parent = _getTopParent(object, useFakeParent) var parent = _getTopParent(object, useFakeParent)
var p var p
while ((p = _getTopParent(parent, useFakeParent)) != null) { while ((p = _getTopParent(parent, useFakeParent)) != null) {
parent = p parent = p
} }
...@@ -97,8 +96,8 @@ function openConfirmDialog (parent, options) { ...@@ -97,8 +96,8 @@ function openConfirmDialog (parent, options) {
'import QtQuick 2.7;' + 'import QtQuick 2.7;' +
'import Common 1.0;' + 'import Common 1.0;' +
'ConfirmDialog {' + 'ConfirmDialog {' +
'descriptionText: \'' + options.descriptionText + '\';' + 'descriptionText: \'' + escapeQuotes(options.descriptionText) + '\';' +
'title: \'' + options.title + '\'' + 'title: \'' + escapeQuotes(options.title) + '\'' +
'}', '}',
parent, { parent, {
isString: true, isString: true,
...@@ -268,6 +267,14 @@ function ensureArray (obj) { ...@@ -268,6 +267,14 @@ function ensureArray (obj) {
// ------------------------------------------------------------------- // -------------------------------------------------------------------
function escapeQuotes (str) {
return str != null
? str.replace(/([^'\\]*(?:\\.[^'\\]*)*)'/g, '$1\\\'')
: ''
}
// -------------------------------------------------------------------
// Get the first matching value in a array or object. // Get the first matching value in a array or object.
// The matching value is obtained if `cb` returns true. // The matching value is obtained if `cb` returns true.
function find (obj, cb, context) { function find (obj, cb, context) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment