diff --git a/localization/rssguard_de.ts b/localization/rssguard_de.ts
index e2ecf2f5f..6bcea5d15 100644
--- a/localization/rssguard_de.ts
+++ b/localization/rssguard_de.ts
@@ -139,7 +139,7 @@ Error: %1
-
+ Gehe zur Umfrage
@@ -969,7 +969,7 @@ Item ID: %5
-
+ Möchtest du wirklich alle Artikel des ausgewählten Elementes löschen?
@@ -1102,7 +1102,7 @@ or this functionality is not implemented yet.
-
+ Kontextmenü für Probe
@@ -1326,12 +1326,12 @@ or this functionality is not implemented yet.
-
+ Name deiner Probe
-
+ Regular Expression
@@ -1347,17 +1347,17 @@ or this functionality is not implemented yet.
-
+ Name der Probe kann nicht leer sein.
-
+ Regular Expression ist nicht gut aufgebaut.
-
+ Erstelle neue Probe
@@ -1367,7 +1367,7 @@ or this functionality is not implemented yet.
-
+ Bearbeite Probe '%1'
@@ -1803,12 +1803,12 @@ or this functionality is not implemented yet.
-
+ Füge Artikel mit allen Daten zur Datenbank hinzu
-
+ Meide es, Artikel vor diesem Datum in die Datenbank hinzuzufügen.
@@ -1823,12 +1823,12 @@ or this functionality is not implemented yet.
-
+ Rechts-nach-Links Layout
-
+ Ignoriere Benachrichtigungen dieses Feedes
@@ -1836,7 +1836,7 @@ or this functionality is not implemented yet.
-
+ Anwendungsprotokoll
@@ -1859,12 +1859,12 @@ or this functionality is not implemented yet.
-
+ Öffne Hauptmenü
-
+ Öffne &Hauptmenü
@@ -1894,22 +1894,22 @@ or this functionality is not implemented yet.
-
+ F&eeds
-
+ &Füge Element hinzu
-
+ &Verschiebe
-
+ Art&ikel
@@ -1924,7 +1924,7 @@ or this functionality is not implemented yet.
-
+ &Webbrowser && tabs
@@ -1979,12 +1979,12 @@ or this functionality is not implemented yet.
-
+ Hole @ausgewählte
-
+ Hole ausgewählte Feeds
@@ -4423,7 +4423,7 @@ Ablauf des Login tokens: %2
-
+ Ist Artikel wichtig?
@@ -5764,7 +5764,7 @@ Ablauf des Login tokens: %2
-
+ Regular expression
@@ -6313,7 +6313,7 @@ Authors of this application are NOT responsible for lost data.
-
+ Meide es, Artikel vor diesem Datum in die Datenbank hinzuzufügen.
diff --git a/localization/rssguard_en_GB.ts b/localization/rssguard_en_GB.ts
index 928968cc2..c36938042 100644
--- a/localization/rssguard_en_GB.ts
+++ b/localization/rssguard_en_GB.ts
@@ -22,12 +22,12 @@
-
+ Can't enable AdBlock
-
+ There is an error in the AdBlock component and can't be enabled. Check the error message below (or application debug log) for more information.
@@ -37,14 +37,16 @@
-
+ There is an error, check the application log for more details and head over to the online documentation.
-
+ There is an error, check the application log for more details and head over to the online documentation. Also make sure that Node.js is installed.
+
+Error: %1
@@ -142,17 +144,17 @@ Error: %1
-
+ Failed to copy settings file to output directory.
-
+ Database restoration was not initiated. Make sure that the output directory is writable.
-
+ Settings restoration was not initiated. Make sure that the output directory is writable.
@@ -291,7 +293,7 @@ version by clicking this popup notification.
-
+ Password is ok or is not needed.
@@ -750,7 +752,7 @@ Item ID: %5
-
+ You cannot fetch new articles right now because another critical operation is ongoing.
@@ -2749,7 +2751,7 @@ or this functionality is not implemented yet.
- Database and/or settings were not successully copied to the restoration directory.
+ Failed to copy database and/or settings to restoration directory.
@@ -3585,7 +3587,7 @@ Login tokens expiration: %2
-
+ Some feeds might contain tens of thousands of articles and downloading all of them could take a long time, so sometimes it is good to download only a certain amount of new messages.
@@ -4419,12 +4421,12 @@ Login tokens expiration: %2
-
+ Is the article permanently deleted from the recycle bin?
-
+ ID of the feed which this article belongs to.
@@ -4617,12 +4619,12 @@ Login tokens expiration: %2
-
+ Show articles from the last 24 hours
-
+ Show articles from the last 48 hours
@@ -4790,7 +4792,7 @@ Login tokens expiration: %2
-
+ access to the content was denied
@@ -4943,7 +4945,7 @@ Login tokens expiration: %2
-
+ Some feeds might contain tens of thousands of articles and downloading all of them could take a long time, so sometimes it is good to download only a certain amount of new messages.
@@ -6943,7 +6945,7 @@ Also, there are some built-in sounds. Just start typing ":" and they w
-
+ Failed to copy database file to output directory.
@@ -6951,12 +6953,12 @@ Also, there are some built-in sounds. Just start typing ":" and they w
-
+ Can't save data for category, detailed information was logged via debug log.
-
+ Can't save category data
@@ -6989,7 +6991,7 @@ Also, there are some built-in sounds. Just start typing ":" and they w
-
+ XML is not well-formatted, %1
@@ -6999,7 +7001,7 @@ Also, there are some built-in sounds. Just start typing ":" and they w
-
+ Can't move the feed, detailed information was logged via the debug log.
@@ -7011,12 +7013,12 @@ Type: %3
-
+ Can't save feed data
-
+ Can't move feed
@@ -7029,7 +7031,7 @@ Type: %3
-
+ Set the title for your feed.
@@ -7039,7 +7041,7 @@ Type: %3
-
+ Set the description for your feed.
@@ -7129,7 +7131,7 @@ Type: %3
-
+ The URL does not meet the standard pattern. Does your URL start with "http://" or "https://" prefix.
@@ -7139,7 +7141,7 @@ Type: %3
-
+ Select the icon file for the feed
@@ -7266,7 +7268,7 @@ Also, you can post-process generated feed data with yet another script if you wi
-
+ Select the type of the standard feed.
@@ -7311,7 +7313,7 @@ Also, you can post-process generated feed data with yet another script if you wi
-
+ Select the icon for your feed.
@@ -7324,7 +7326,7 @@ Also, you can post-process generated feed data with yet another script if you wi
-
+ Do you want to load the initial set of feeds?
@@ -7675,7 +7677,7 @@ Unread news: %2
-
+ An other error occurred, contact the developers.
@@ -7742,7 +7744,7 @@ Unread news: %2
-
+ Password is ok or is not needed.
@@ -7841,7 +7843,7 @@ Unread news: %2
-
+ Provide the URL for your feed.
@@ -7851,7 +7853,7 @@ Unread news: %2
-
+ The URL does not meet the standard pattern. Does your URL start with "http://" or "https://" prefix.
@@ -7944,7 +7946,7 @@ Last login on: %4
-
+ Reader mode cannot be applied to the current page.
@@ -8000,12 +8002,12 @@ Last login on: %4
-
+ Enable auto-image loading
-
+ Enable JavaScript
@@ -8025,7 +8027,7 @@ Last login on: %4
-
+ Enable local storage
@@ -8035,12 +8037,12 @@ Last login on: %4
-
+ Enable XSS auditing
-
+ Enable spatial navigation
@@ -8050,7 +8052,7 @@ Last login on: %4
-
+ Enable hyperlink auditing
@@ -8060,27 +8062,27 @@ Last login on: %4
-
+ Enable error pages
-
+ Enable plugins
-
+ Enable fullscreen
-
+ Enable screen capture
-
+ Enable WebGL
@@ -8110,7 +8112,7 @@ Last login on: %4
-
+ Do you really want to clear the web cache?
@@ -8145,17 +8147,17 @@ Last login on: %4
-
+ Allow JS to paste from clipboard
-
+ Enable DNS prefetching
-
+ Enable PDF viewer
\ No newline at end of file
diff --git a/localization/rssguard_fr.ts b/localization/rssguard_fr.ts
index 66840fcda..6e1297e94 100644
--- a/localization/rssguard_fr.ts
+++ b/localization/rssguard_fr.ts
@@ -139,7 +139,7 @@ Erreur : %1
-
+ Aller au sondage
@@ -824,7 +824,7 @@ Identifiant d'élément: %5
- Si vous sélectionnez la synchronisation intelligente, alors seulement les articles non obtenus ou mis à jour seront téléchargés. La consommation de données est fortement réduite et la vitesse de synchronisation générale est fortement améliorée, mais la première obtention de flux peut être lente de toute façon si votre flux contient un nombre d'articles immense.
+ Si vous sélectionnez la synchronisation intelligente, alors seulement les articles pas encore obtenus ou mis à jour seront téléchargés. La consommation de données est fortement réduite et la vitesse de synchronisation générale est fortement améliorée, mais la première obtention de flux peut être lente de toute façon si votre flux contient un nombre d'articles très important.
@@ -970,7 +970,7 @@ Identifiant d'élément: %5
-
+ Voulez-vous vraiment nettoyer tous les articles de l'élément sélectionné?
@@ -1104,7 +1104,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Menu contextuel de votre sonde
@@ -1328,7 +1328,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Nom de votre sonde
@@ -1349,17 +1349,17 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Le nom de votre sonde ne peut pas être vide.
-
+ L'expression régulière n'est pas bien formattée.
-
+ Créer une nouvelle sonde
@@ -1369,7 +1369,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Modifier sonde '%1'
@@ -1805,12 +1805,12 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Ajouter des articles avec une date quelconque dans la base de données
-
+ Éviter d'ajouter des articles qui datent d'avant la date spécifiée dans la base de données
@@ -1825,7 +1825,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ Mise en page de droite à gauche
@@ -2121,7 +2121,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
- Cacher la fenêtre principale si il est visible et la montrer si il est cacher.
+ Cacher la fenêtre principale si elle est visible et la montrer si elle est cachée.
@@ -2206,7 +2206,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
- &Faire un don...
+ &Faire un don ♥
@@ -2357,7 +2357,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ &Montrer les agrandisseurs de catégories
@@ -2382,7 +2382,7 @@ ou cette fonctionnalité n'est pas encore implémentée.
-
+ &Étendre/rétracter l'élément selectionné d'une manière &récursive
@@ -2965,7 +2965,7 @@ Vous devez redémarrer manuellement.
-
+ Vous pouvez entrer votre commande complète (interprète inclus) ici.
@@ -3045,7 +3045,7 @@ Vous devez redémarrer manuellement.
-
+ Ne pas obtenir les icônes
@@ -3365,7 +3365,7 @@ Vous pouvez désormais l'installer.
-
+ Il y a certains jetons OAuth pré-configurés où vous n'avez pas besoin d'entrer votre ID/secret client, mais il est fortement recommandé d'obtenir le votre à vous vu que les jetons pré-configurés ont un quota global d'utilisation limité. Si vous souhaitez tout de même utiliser des jetons pré-configurés, alors laissez tout simplement ces champs vides et soyez sûrs de laisser la valeur du lien de redirection à celle par défaut.
@@ -3453,7 +3453,7 @@ Vous pouvez désormais l'installer.
-
+ le téléchargement de la liste d'étiquettes a echoué
@@ -3618,12 +3618,12 @@ Expiration de jetons d'authentification: %2
- Si vous selectionnez la synchronisation intelligente, alors seulement les articles non obtenus ou mis à jour seront téléchargés. La consommation de données est fortement réduite et la vitesse de synchronisation générale est fortement améliorée, mais la première obtention de flux peut être lente de toute façon si votre flux contient un nombre d'articles immense.
+ Si vous sélectionnez la synchronisation intelligente, alors seulement les articles pas encore obtenus ou mis à jour seront téléchargés. La consommation de données est fortement réduite et la vitesse de synchronisation générale est fortement améliorée, mais la première obtention de flux peut être lente de toute façon si votre flux contient un nombre d'articles très important.
-
+ Il y a certains jetons OAuth pré-configurés où vous n'avez pas besoin d'entrer votre ID/secret client, mais il est fortement recommandé d'obtenir le votre à vous vu que les jetons pré-configurés ont un quota global d'utilisation limité. Si vous souhaitez tout de même utiliser des jetons pré-configurés, alors laissez tout simplement les champs ci-dessus à leurs valeurs par défaut.
@@ -3797,7 +3797,7 @@ Expiration de jetons d'authentification: %2
- Voir plus d'infos sur ceci
+ Voir plus d'infos
@@ -4081,7 +4081,7 @@ Expiration de jetons d'authentification: %2
- Retirer le formattage de charactère
+ Retirer le formattage de caractère
@@ -4412,7 +4412,7 @@ Expiration de jetons d'authentification: %2
-
+ DAG
@@ -4512,7 +4512,7 @@ Expiration de jetons d'authentification: %2
-
+ La direction de mise-en-page de l'article
@@ -5091,7 +5091,7 @@ Expiration de jetons d'authentification: %2
-
+ Le lancement de l'écouteur de redirection OAuth a échoué. Peut-être que vous n'avez pas les droits suffisants.
@@ -5377,7 +5377,7 @@ Feedly est un éspace sécurisé où vous pouvez organiser et rechercher les suj
-
+ Node.js - la mise à jour paquet(s) a échoué
@@ -5416,7 +5416,7 @@ Liste d'agrégateurs compatibles:
-
+ Ce service offre une integration de flux & podcasts RSS/RDF/ATOM/JSON standards.
@@ -5538,7 +5538,7 @@ Liste d'agrégateurs compatibles:
-
+ Voulez-vous vraiment vider votre corbeille?
@@ -5772,7 +5772,7 @@ Expiration de jetons d'authentification: %2
-
+ Les cases sont prises en compte
@@ -5782,7 +5782,7 @@ Expiration de jetons d'authentification: %2
-
+ Caractère de remplacement
@@ -5813,17 +5813,17 @@ Expiration de jetons d'authentification: %2
-
+ Sondes d'article
-
+ Vous pouvez voir toutes vos sondes d'articles permanentes ici.
-
+ Nouvelle sonde d'article
@@ -5928,7 +5928,7 @@ File filter for external e-mail selection dialog.
-
+ Drapeaux "QTWEBENGINE_CHROMIUM_FLAGS" personnalisés
@@ -6086,7 +6086,7 @@ File filter for external e-mail selection dialog.
-
+ Notez que la vitesse du serveur MySQL et la latence du medium de connection influence LOURDEMENT la performance définitive de l'appli. Avoir des connections de base de données lentes a comme conséquence une mauvaise performance lors de la navigation de flux ou messages.
@@ -6171,7 +6171,17 @@ Disadvantages:
• application startup and shutdown can take little longer (max. 2 seconds).
Authors of this application are NOT responsible for lost data.
-
+ L'usage de bases de données fonctionnelles intra-memoire a un nombre d'avantages et inconvéniants. Soyez-sûr que vous êtes à l'aise avec elles avant que vous activiez cette fonctionnalité.
+
+Avantages:
+•Vitesse supérieur pour la manipulation de flux/messages (surtout si des milliers de messages sont affichés),
+•L'intégralité de la base de données est stocké dans la mémoire vive, donnant l'opportunité à votre disque dur de se reposer d'avantage.
+
+Inconvéniants:
+•Si l'appli plante, vos changements de la dernière session ne seront pas pris en compte,
+•Le démarrage et la fermeture de l'appli peuvent prendre plus longtemps (2 secondes max.).
+
+Les auteurs de cette appli NE SONT PAS responsables de pertes de donnees éventuelles.
@@ -6337,7 +6347,7 @@ Authors of this application are NOT responsible for lost data.
-
+ Éviter d'ajouter des articles qui datent d'avant la date spécifiée dans la base de données
@@ -6661,7 +6671,7 @@ Déscription: %3
- Cacher la fenêtre principale quand il est minimisé
+ Cacher la fenêtre principale quand elle est minimisée
@@ -6783,7 +6793,13 @@ Déscription: %3
Note that usually all required Node.js tools should be available via your "PATH" environment variable, so you do not have to specify full paths.
Also, relaunch "Settings" dialog after you install Node.js.
-
+ Node.js est un runtime JavaScript asynchrone qui fonctionne par évènements, fait pour construire des applications web évolutifs.
+
+%1 intègre Node.js pour apporter des fonctionnalités modernes comme AdBlock.
+
+Notez qu'en général c'est mieux que tous les outils Node.js requis soient disponsibles via votre variable d'environment "PATH", pour ne pas avoir à specifier les chemins complets.
+
+Et aussi, redémarrez la fenêtre "Paramètres" après avoir installé Node.js.
@@ -6903,7 +6919,7 @@ Aussi, il y a des sons pre-ajoutés. Si vous tapez ":", ils se présen
-
+ Cliquez et appuyer sur une touche pour l'attribuer à ce raccourci.
@@ -7176,7 +7192,7 @@ Type: %3
-
+ Le lien n'est pas conforme au pattern standard. Êtes-vous sûr que votre lien commence bien avec le préfixe "http://" ou "https://"?
@@ -7237,7 +7253,7 @@ Type: %3
-
+ Vous pouvez entrer votre commande complète (interprète inclus) ici.
@@ -7368,7 +7384,7 @@ Vous pouvez aussi post-traiter la data de flux avec encore un autre script si vo
-
+ Ceci est un compte de service obligatoire pour les flux RSS/RDF/ATOM standards.
@@ -7667,7 +7683,7 @@ Actualités non-lus: %2
-
+ Si vous sélectionnez la synchronisation intelligente, alors seulement les articles pas encore obtenus ou mis à jour seront téléchargés. La consommation de données est fortement réduite et la vitesse de synchronisation générale est fortement améliorée, mais la première obtention de flux peut être lente de toute façon si votre flux contient un nombre d'articles très important.<br/><br/>Et aussi, soyez-sûr d'installer le plugin TT-RSS<a href="https://www.google.com">api_newsplus</a> à votre instance de serveur.
@@ -7878,7 +7894,7 @@ Actualités non-lus: %2
-
+ Partager à "publié"
@@ -7901,7 +7917,7 @@ Actualités non-lus: %2
-
+ Le lien n'est pas conforme au pattern standard. Êtes-vous sûr que votre lien commence bien avec le préfixe "http://" ou "https://"?
diff --git a/localization/rssguard_nl.ts b/localization/rssguard_nl.ts
index 7a8a46a6d..0c4383eb7 100644
--- a/localization/rssguard_nl.ts
+++ b/localization/rssguard_nl.ts
@@ -139,7 +139,7 @@ Fout: %1
-
+ Enquête invullen
@@ -969,7 +969,7 @@ Onderdeel ID: %5
-
+ Weet je zeker dat je alle artikelen van het geselecteerde item wilt verwijderen?
@@ -1103,7 +1103,7 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Context menu voor tester
@@ -1327,7 +1327,7 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Naam voor de tester
@@ -1348,17 +1348,17 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Tester naam mag niet leeg zijn
-
+ Reguliere expressie is niet correct geformuleerd.
-
+ Maak nieuwe tester
@@ -1368,7 +1368,7 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Bewerk test '%1'
@@ -1804,12 +1804,12 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Voeg artikelen toe met elke datum aan de database
-
+ Voorkom toevoegen van artikelen met een datum voor deze
@@ -1824,7 +1824,7 @@ of omdat deze functie nog niet is geïmplementeerd.
-
+ Rechts-naar-links layout
@@ -3044,7 +3044,7 @@ Je moet handmatig herstarten.
-
+ Pictogrammen niet ophalen
@@ -3452,7 +3452,7 @@ Installeer het nu.
-
+ Download van lijst met labels mislukt
@@ -4411,7 +4411,7 @@ Logintoken verloopt: %2
-
+ RTL
@@ -4511,7 +4511,7 @@ Logintoken verloopt: %2
-
+ Layout richting van het artikel
@@ -5374,7 +5374,7 @@ Feedly is een beveiligde ruimte waar u de onderwerpen en trends die voor u van b
-
+ Node.js - update van pakket(ten) mislukt
@@ -5535,7 +5535,7 @@ Lijst met ondersteunde lezers:
-
+ Weet je zeker dat je de prullenbak wilt legen?
@@ -5810,17 +5810,17 @@ Logintoken verloopt: %2
-
+ Artikel testen
-
+ Je kunt alle permanente artikel testen hier zien.
-
+ Nieuwe artikeltest
@@ -6344,7 +6344,7 @@ Makers van de applicatie zijn niet verantwoordelijk voor dataverlies.
-
+ Voorkom toevoegen van artikelen met een datum voor deze
@@ -7381,7 +7381,7 @@ Je kunt ook gegenereerde feedgegevens nabewerken met nog een ander script als je
- Dit is verplichte service account voor standaard RSS/RDF/ATOM feeds.
+ Dit is het verplichte service account voor standaard RSS/RDF/ATOM feeds.
@@ -7411,7 +7411,7 @@ Je kunt ook gegenereerde feedgegevens nabewerken met nog een ander script als je
- Deze nieuwe account bevat geen feeds. De standaard feeds kunnen toegevoegd worden.
+ Dit nieuwe account bevat geen feeds. De standaard feeds kunnen toegevoegd worden.
diff --git a/src/librssguard/gui/reusable/jssyntaxhighlighter.cpp b/src/librssguard/gui/reusable/jssyntaxhighlighter.cpp
index d7a352b84..b30edc3e1 100755
--- a/src/librssguard/gui/reusable/jssyntaxhighlighter.cpp
+++ b/src/librssguard/gui/reusable/jssyntaxhighlighter.cpp
@@ -2,93 +2,107 @@
#include "gui/reusable/jssyntaxhighlighter.h"
+#include "3rd-party/boolinq/boolinq.h"
#include "definitions/definitions.h"
JsSyntaxHighlighter::JsSyntaxHighlighter(QTextDocument* parent) : QSyntaxHighlighter(parent) {
HighlightingRule rule;
- keywordFormat.setForeground(Qt::GlobalColor::magenta);
- keywordFormat.setFontWeight(QFont::Weight::Bold);
+ m_keywordFormat.setForeground(Qt::GlobalColor::magenta);
+ m_keywordFormat.setFontWeight(QFont::Weight::Bold);
- const QString keywordPatterns[] = {
- QSL("\\babstract\\b"), QSL("\\barguments\\b"), QSL("\\bawait\\*\\b"), QSL("\\bboolean\\b"),
- QSL("\\bbreak\\b"), QSL("\\bbyte\\b"), QSL("\\bcase\\b"), QSL("\\bcatch\\b"),
- QSL("\\bchar\\b"), QSL("\\bclass\\*\\b"), QSL("\\bconst\\b"), QSL("\\bcontinue\\b"),
- QSL("\\bdebugger\\b"), QSL("\\bdefault\\b"), QSL("\\bdelete\\b"), QSL("\\bdo\\b"),
- QSL("\\bdouble\\b"), QSL("\\belse\\b"), QSL("\\benum\\*\\b"), QSL("\\beval\\b"),
- QSL("\\bexport\\*\\b"), QSL("\\bextends\\*\\b"), QSL("\\bfalse\\b"), QSL("\\bfinal\\b"),
- QSL("\\bfinally\\b"), QSL("\\bfloat\\b"), QSL("\\bfor\\b"), QSL("\\bfunction\\b"),
- QSL("\\bgoto\\b"), QSL("\\bif\\b"), QSL("\\bimplements\\b"), QSL("\\bimport\\*\\b"),
- QSL("\\bin\\b"), QSL("\\binstanceof\\b"), QSL("\\bint\\b"), QSL("\\binterface\\b"),
- QSL("\\blet\\*\\b"), QSL("\\blong\\b"), QSL("\\bnative\\b"), QSL("\\bnew\\b"),
- QSL("\\bnull\\b"), QSL("\\bpackage\\b"), QSL("\\bprivate\\b"), QSL("\\bprotected\\b"),
- QSL("\\bpublic\\b"), QSL("\\breturn\\b"), QSL("\\bshort\\b"), QSL("\\bstatic\\b"),
- QSL("\\bsuper\\*\\b"), QSL("\\bswitch\\b"), QSL("\\bsynchronized\\b"), QSL("\\bthis\\b"),
- QSL("\\bthrow\\b"), QSL("\\bthrows\\b"), QSL("\\btransient\\b"), QSL("\\btrue\\b"),
- QSL("\\btry\\b"), QSL("\\btypeof\\b"), QSL("\\bvar\\b"), QSL("\\bvoid\\b"),
- QSL("\\bvolatile\\b"), QSL("\\bwhile\\b"), QSL("\\bwith\\b"), QSL("\\byield\\b")};
+ QStringList keywords = jsKeywords();
+ auto std_keywords = boolinq::from(keywords)
+ .select([](const QString& kw) {
+ return QSL("\\b%1\\b").arg(kw);
+ })
+ .toStdList();
- for (const QString& pattern : keywordPatterns) {
- rule.pattern = QRegularExpression(pattern);
- rule.format = keywordFormat;
- highlightingRules.append(rule);
+ keywords = FROM_STD_LIST(QStringList, std_keywords);
+
+ for (const QString& pattern : keywords) {
+ rule.m_pattern = QRegularExpression(pattern);
+ rule.m_format = m_keywordFormat;
+
+ m_highlightingRules.append(rule);
}
- classFormat.setFontWeight(QFont::Bold);
- classFormat.setForeground(Qt::darkMagenta);
- rule.pattern = QRegularExpression(QStringLiteral("\\bQ[A-Za-z]+\\b"));
- rule.format = classFormat;
- highlightingRules.append(rule);
+ m_classFormat.setFontWeight(QFont::Weight::Bold);
+ m_classFormat.setForeground(Qt::GlobalColor::darkMagenta);
+ rule.m_pattern = QRegularExpression(QStringLiteral("\\bQ[A-Za-z]+\\b"));
+ rule.m_format = m_classFormat;
- singleLineCommentFormat.setForeground(Qt::red);
- rule.pattern = QRegularExpression(QStringLiteral("//[^\n]*"));
- rule.format = singleLineCommentFormat;
- highlightingRules.append(rule);
+ m_highlightingRules.append(rule);
- multiLineCommentFormat.setForeground(Qt::red);
+ m_singleLineCommentFormat.setForeground(Qt::GlobalColor::red);
+ rule.m_pattern = QRegularExpression(QStringLiteral("//[^\n]*"));
+ rule.m_format = m_singleLineCommentFormat;
- quotationFormat.setForeground(Qt::darkGreen);
- rule.pattern = QRegularExpression(QStringLiteral("\".*\""));
- rule.format = quotationFormat;
- highlightingRules.append(rule);
+ m_highlightingRules.append(rule);
- functionFormat.setFontItalic(true);
- functionFormat.setForeground(Qt::GlobalColor::green);
- rule.pattern = QRegularExpression(QStringLiteral("\\b[A-Za-z0-9_]+(?=\\()"));
- rule.format = functionFormat;
- highlightingRules.append(rule);
+ m_multiLineCommentFormat.setForeground(Qt::GlobalColor::red);
- commentStartExpression = QRegularExpression(QStringLiteral("/\\*"));
- commentEndExpression = QRegularExpression(QStringLiteral("\\*/"));
+ m_quotationFormat.setForeground(Qt::GlobalColor::darkGreen);
+ rule.m_pattern = QRegularExpression(QStringLiteral("\".*\""));
+ rule.m_format = m_quotationFormat;
+
+ m_highlightingRules.append(rule);
+
+ m_functionFormat.setFontItalic(true);
+ m_functionFormat.setForeground(Qt::GlobalColor::green);
+ rule.m_pattern = QRegularExpression(QStringLiteral("\\b[A-Za-z0-9_]+(?=\\()"));
+ rule.m_format = m_functionFormat;
+
+ m_highlightingRules.append(rule);
+
+ m_commentStartExpression = QRegularExpression(QStringLiteral("/\\*"));
+ m_commentEndExpression = QRegularExpression(QStringLiteral("\\*/"));
+}
+
+QStringList JsSyntaxHighlighter::jsKeywords() const {
+ return {QSL("abstract"), QSL("arguments"), QSL("await\\*"), QSL("boolean"), QSL("break"), QSL("byte"),
+ QSL("case"), QSL("catch"), QSL("char"), QSL("class\\*"), QSL("const"), QSL("continue"),
+ QSL("debugger"), QSL("default"), QSL("delete"), QSL("do"), QSL("double"), QSL("else"),
+ QSL("enum\\*"), QSL("eval"), QSL("export\\*"), QSL("extends\\*"), QSL("false"), QSL("final"),
+ QSL("finally"), QSL("float"), QSL("for"), QSL("function"), QSL("goto"), QSL("if"),
+ QSL("implements"), QSL("import\\*"), QSL("in"), QSL("instanceof"), QSL("int"), QSL("interface"),
+ QSL("let\\*"), QSL("long"), QSL("native"), QSL("new"), QSL("null"), QSL("package"),
+ QSL("private"), QSL("protected"), QSL("public"), QSL("return"), QSL("short"), QSL("static"),
+ QSL("super\\*"), QSL("switch"), QSL("synchronized"), QSL("this"), QSL("throw"), QSL("throws"),
+ QSL("transient"), QSL("true"), QSL("try"), QSL("typeof"), QSL("var"), QSL("void"),
+ QSL("volatile"), QSL("while"), QSL("with"), QSL("yield")};
}
void JsSyntaxHighlighter::highlightBlock(const QString& text) {
- for (const HighlightingRule& rule : std::as_const(highlightingRules)) {
- QRegularExpressionMatchIterator matchIterator = rule.pattern.globalMatch(text);
+ for (const HighlightingRule& rule : std::as_const(m_highlightingRules)) {
+ QRegularExpressionMatchIterator matchIterator = rule.m_pattern.globalMatch(text);
while (matchIterator.hasNext()) {
QRegularExpressionMatch match = matchIterator.next();
- setFormat(match.capturedStart(), match.capturedLength(), rule.format);
+ setFormat(match.capturedStart(), match.capturedLength(), rule.m_format);
}
}
setCurrentBlockState(0);
- int startIndex = 0;
- if (previousBlockState() != 1)
- startIndex = text.indexOf(commentStartExpression);
+ int start_index = 0;
+ if (previousBlockState() != 1) {
+ start_index = text.indexOf(m_commentStartExpression);
+ }
- while (startIndex >= 0) {
- QRegularExpressionMatch match = commentEndExpression.match(text, startIndex);
- int endIndex = match.capturedStart();
- int commentLength = 0;
- if (endIndex == -1) {
+ while (start_index >= 0) {
+ QRegularExpressionMatch match = m_commentEndExpression.match(text, start_index);
+ int end_index = match.capturedStart();
+ int comment_length = 0;
+
+ if (end_index == -1) {
setCurrentBlockState(1);
- commentLength = text.length() - startIndex;
+ comment_length = text.length() - start_index;
}
else {
- commentLength = endIndex - startIndex + match.capturedLength();
+ comment_length = end_index - start_index + match.capturedLength();
}
- setFormat(startIndex, commentLength, multiLineCommentFormat);
- startIndex = text.indexOf(commentStartExpression, startIndex + commentLength);
+
+ setFormat(start_index, comment_length, m_multiLineCommentFormat);
+ start_index = text.indexOf(m_commentStartExpression, start_index + comment_length);
}
}
diff --git a/src/librssguard/gui/reusable/jssyntaxhighlighter.h b/src/librssguard/gui/reusable/jssyntaxhighlighter.h
index 5b7507b8f..00a5918d1 100755
--- a/src/librssguard/gui/reusable/jssyntaxhighlighter.h
+++ b/src/librssguard/gui/reusable/jssyntaxhighlighter.h
@@ -11,28 +11,30 @@ class JsSyntaxHighlighter : public QSyntaxHighlighter {
Q_OBJECT
public:
- JsSyntaxHighlighter(QTextDocument *parent);
+ JsSyntaxHighlighter(QTextDocument* parent);
+
+ QStringList jsKeywords() const;
protected:
virtual void highlightBlock(const QString& text) override;
private:
struct HighlightingRule {
- QRegularExpression pattern;
- QTextCharFormat format;
+ QRegularExpression m_pattern;
+ QTextCharFormat m_format;
};
- QList highlightingRules;
+ QList m_highlightingRules;
- QRegularExpression commentStartExpression;
- QRegularExpression commentEndExpression;
+ QRegularExpression m_commentStartExpression;
+ QRegularExpression m_commentEndExpression;
- QTextCharFormat keywordFormat;
- QTextCharFormat classFormat;
- QTextCharFormat singleLineCommentFormat;
- QTextCharFormat multiLineCommentFormat;
- QTextCharFormat quotationFormat;
- QTextCharFormat functionFormat;
+ QTextCharFormat m_keywordFormat;
+ QTextCharFormat m_classFormat;
+ QTextCharFormat m_singleLineCommentFormat;
+ QTextCharFormat m_multiLineCommentFormat;
+ QTextCharFormat m_quotationFormat;
+ QTextCharFormat m_functionFormat;
};
#endif // JSSYNTAXHIGHLIGHTER_H