From 4bdabbd39fd111c6c12d5953bd4bd6de2ae3903d Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 3 Jun 2014 23:41:19 +0200 Subject: Fix theme Origine2 It should be equivalent to Origine (modulo some improvements) See https://github.com/marienfressinaud/FreshRSS/issues/320 --- app/views/javascript/actualize.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views/javascript') diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 3b12ad774..6a92e5642 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -9,7 +9,7 @@ var feeds = [\ + $("body").after("\
\ 0 / " + feed_count + "
\ \
"); -- cgit v1.2.3 From ab9d656135e5afcafb824e73a49ff2e9fd2a2dbd Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Wed, 9 Jul 2014 20:20:17 +0200 Subject: Block user to click many times on the refresh button See https://github.com/marienfressinaud/FreshRSS/issues/513 --- app/views/javascript/actualize.phtml | 6 ++++-- p/scripts/main.js | 13 +++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'app/views/javascript') diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 6a92e5642..d08dc47d1 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -10,7 +10,7 @@ var feeds = [\ - 0 / " + feed_count + "
\ + 0 / " + feed_count + "
\ \ "); } else { @@ -24,7 +24,8 @@ function updateProgressBar(i) { function updateFeeds() { if (feed_count === 0) { - openNotification("", "good"); + openNotification("", "good"); + ajax_loading = false; return; } initProgressBar(true); @@ -39,6 +40,7 @@ function updateFeed() { if (feed == undefined) { return; } + $.ajax({ type: 'POST', url: feed, diff --git a/p/scripts/main.js b/p/scripts/main.js index 54ee7f0fd..243159ca5 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,7 +1,8 @@ "use strict"; var $stream = null, isCollapsed = true, - shares = 0; + shares = 0, + ajax_loading = false; function is_normal_mode() { return $stream.hasClass('normal'); @@ -684,14 +685,22 @@ function init_actualize() { var auto = false; $("#actualize").click(function () { + if (ajax_loading) { + return false; + } + + ajax_loading = true; + $.getScript('./?c=javascript&a=actualize').done(function () { if (auto && feed_count < 1) { auto = false; - return; + ajax_loading = false; + return false; } updateFeeds(); }); + return false; }); -- cgit v1.2.3 From 6655c1b4299897944dea06309261137a7fa91ad7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Sun, 10 Aug 2014 15:28:54 +0200 Subject: Improve design of actualize notification - Remove progress bar - Show title of updated feed --- app/views/javascript/actualize.phtml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'app/views/javascript') diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index d08dc47d1..74cef4998 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,25 +1,24 @@ "use strict"; -var feeds = [feeds as $feed) { - echo "'", Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), "',\n"; - } - ?>], +var feeds = [feeds as $feed) { ?>{url: " 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",title: "name(); ?>"},], feed_processed = 0, feed_count = feeds.length; function initProgressBar(init) { if (init) { $("body").after("\
\ - 0 / " + feed_count + "
\ - \ +
/
\ + 0 / " + feed_count + "\
"); } else { window.location.reload(); } } -function updateProgressBar(i) { - $("#actualizeProgressBar").val(i); +function updateProgressBar(i, title_feed) { $("#actualizeProgress .progress").html(i + " / " + feed_count); + $("#actualizeProgress .title").html(title_feed); } function updateFeeds() { @@ -43,10 +42,10 @@ function updateFeed() { $.ajax({ type: 'POST', - url: feed, + url: feed['url'], }).complete(function (data) { feed_processed++; - updateProgressBar(feed_processed); + updateProgressBar(feed_processed, feed['title']); if (feed_processed === feed_count) { initProgressBar(false); -- cgit v1.2.3 From a1faa826bf04326a073b918f0ff76ac90c9acd31 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 11 Dec 2014 21:44:11 +0100 Subject: Fix french i18n for last views --- app/i18n/fr/admin.php | 11 +++++++++++ app/i18n/fr/conf.php | 5 +++++ app/i18n/fr/feedback.php | 1 + app/i18n/fr/gen.php | 12 +----------- app/views/error/index.phtml | 2 +- app/views/feed/add.phtml | 34 +++++++++++++++++----------------- app/views/javascript/actualize.phtml | 4 ++-- app/views/update/apply.phtml | 4 ++-- app/views/update/checkInstall.phtml | 2 +- app/views/update/index.phtml | 14 +++++++------- app/views/user/manage.phtml | 26 +++++++++++++------------- app/views/user/profile.phtml | 22 +++++++++++----------- 12 files changed, 72 insertions(+), 65 deletions(-) (limited to 'app/views/javascript') diff --git a/app/i18n/fr/admin.php b/app/i18n/fr/admin.php index 2268a8a38..b822a867d 100644 --- a/app/i18n/fr/admin.php +++ b/app/i18n/fr/admin.php @@ -135,10 +135,21 @@ return array( 'top_feed' => 'Les dix plus gros flux', ), 'update' => array( + '_' => 'Système de mise à jour', + 'apply' => 'Appliquer la mise à jour', + 'check' => 'Vérifier les mises à jour', + 'last' => 'Dernière vérification : %s', 'title' => 'Système de mise à jour', ), 'user' => array( 'articles_and_size' => '%s articles (%s)', + 'create' => 'Créer un nouvel utilisateur', + 'email_persona' => 'Adresse courriel de connexion
(pour Mozilla Persona)', + 'language' => 'Langue', + 'password_form' => 'Mot de passe
(pour connexion par formulaire)', 'title' => 'Gestion des utilisateurs', + 'user_list' => 'Liste des utilisateurs', + 'username' => 'Nom d’utilisateur', + 'users' => 'Utilisateurs', ), ); diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 1c8ad6d9e..2e3414081 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -71,6 +71,10 @@ return array( 'title' => 'Filtres utilisateurs', ), 'profile' => array( + '_' => 'Gestion du profil', + 'email_persona' => 'Adresse courriel de connexion
(pour Mozilla Persona)', + 'password_api' => 'Mot de passe API
(ex. : pour applis mobiles)', + 'password_form' => 'Mot de passe
(pour connexion par formulaire)', 'title' => 'Profil', ), 'reading' => array( @@ -157,6 +161,7 @@ return array( 'user' => array( 'articles_and_size' => '%s articles (%s)', 'current' => 'Utilisateur actuel', + 'is_admin' => 'est administrateur', 'users' => 'Utilisateurs', ), ); diff --git a/app/i18n/fr/feedback.php b/app/i18n/fr/feedback.php index 992300c7d..b9d1f6c99 100644 --- a/app/i18n/fr/feedback.php +++ b/app/i18n/fr/feedback.php @@ -38,6 +38,7 @@ return array( 'zip_error' => 'Une erreur est survenue durant l’import du fichier Zip.', ), 'sub' => array( + 'actualize' => 'Actualiser', 'category' => array( 'created' => 'La catégorie %s a été créée.', 'deleted' => 'La catégorie a été supprimée.', diff --git a/app/i18n/fr/gen.php b/app/i18n/fr/gen.php index c2eb0e394..26990b4fe 100644 --- a/app/i18n/fr/gen.php +++ b/app/i18n/fr/gen.php @@ -5,6 +5,7 @@ return array( 'actualize' => 'Actualiser', 'back_to_rss_feeds' => '← Retour à vos flux RSS', 'cancel' => 'Annuler', + 'create' => 'Créer', 'disable' => 'Désactiver', 'empty' => 'Vider', 'enable' => 'Activer', @@ -153,7 +154,6 @@ return array( 'bdd_conf_is_ok' => 'La configuration de la base de données a été enregistrée.', 'bdd_configuration' => 'Base de données', 'bdd_type' => 'Type de base de données', - 'by' => 'par', 'by_email' => 'Par courriel', 'by_feed' => 'par flux', 'cache_is_ok' => 'Les droits sur le répertoire de cache sont bons', @@ -167,8 +167,6 @@ return array( 'checks' => 'Vérifications', 'choose_language' => 'Choisissez la langue pour FreshRSS', 'congratulations' => 'Félicitations !', - 'create' => 'Créer', - 'create_user' => 'Créer un nouvel utilisateur', 'ctype_is_nok' => 'Il manque une librairie pour la vérification des types de caractères (php-ctype)', 'ctype_is_ok' => 'Vous disposez du nécessaire pour la vérification des types de caractères (ctype)', 'curl_is_nok' => 'Vous ne disposez pas de cURL (paquet php5-curl)', @@ -194,7 +192,6 @@ return array( 'install_not_deleted' => 'Quelque chose s’est mal passé, vous devez supprimer le fichier %s à la main.', 'installation_is_ok' => 'L’installation s’est bien passée.
La dernière étape va maintenant tenter de supprimer les fichiers ainsi que d’éventuelles copies de base de données créés durant le processus de mise à jour.
Vous pouvez choisir de sauter cette étape en supprimant ./data/do-install.txt manuellement.', 'installation_step' => 'Installation — étape %d · FreshRSS', - 'is_admin' => 'est administrateur', 'javascript_for_shortcuts' => 'Le JavaScript doit être activé pour pouvoir profiter des raccourcis.', 'javascript_is_better' => 'FreshRSS est plus agréable à utiliser avec JavaScript activé', 'language_defined' => 'La langue a bien été définie.', @@ -211,13 +208,10 @@ return array( 'not_reads' => '%d non lus', 'not_yet_implemented' => 'Pas encore implémenté', 'number_feeds' => '%d flux', - 'password_api' => 'Mot de passe API
(ex. : pour applis mobiles)', - 'password_form' => 'Mot de passe
(pour connexion par formulaire)', 'pcre_is_nok' => 'Il manque une librairie pour les expressions régulières (php-pcre)', 'pcre_is_ok' => 'Vous disposez du nécessaire pour les expressions régulières (PCRE)', 'pdo_is_nok' => 'Vous ne disposez pas de PDO ou d’un des drivers supportés (pdo_mysql, pdo_sqlite)', 'pdo_is_ok' => 'Vous disposez de PDO et d’au moins un des drivers supportés (pdo_mysql, pdo_sqlite)', - 'persona_connection_email' => 'Adresse courriel de connexion
(pour Mozilla Persona)', 'persona_is_ok' => 'Les droits sur le répertoire de Mozilla Persona sont bons', 'php_is_nok' => 'Votre version de PHP est la %s mais FreshRSS requiert au moins la version %s', 'php_is_ok' => 'Votre version de PHP est la %s, qui est compatible avec FreshRSS', @@ -228,14 +222,10 @@ return array( 'sharing_management' => 'Gestion des options de partage', 'steps' => 'Étapes', 'this_is_the_end' => 'This is the end', - 'update_apply' => 'Appliquer la mise à jour', - 'update_check' => 'Vérifier les mises à jour', 'update_end' => 'La mise à jour est terminée, vous pouvez maintenant passer à l’étape finale.', - 'update_last' => 'Dernière vérification : %s', 'update_long' => 'Ce processus peut prendre longtemps, selon la taille de votre base de données. Vous aurez peut-être à attendre que cette page dépasse son temps maximum d’exécution (~5 minutes) puis à la recharger.', 'update_start' => 'Lancer la mise à jour', 'updated' => 'Modifications enregistrées.', - 'users_list' => 'Liste des utilisateurs', 'version_update' => 'Mise à jour', 'your_diaspora_pod' => 'Votre pod Diaspora*', 'your_shaarli' => 'Votre Shaarli', diff --git a/app/views/error/index.phtml b/app/views/error/index.phtml index 5e1949800..fe3abf8c4 100644 --- a/app/views/error/index.phtml +++ b/app/views/error/index.phtml @@ -3,7 +3,7 @@

code; ?>

errorMessage; ?>
- +

diff --git a/app/views/feed/add.phtml b/app/views/feed/add.phtml index 1db053b52..4cdd3f390 100644 --- a/app/views/feed/add.phtml +++ b/app/views/feed/add.phtml @@ -1,16 +1,16 @@ feed) { ?>
-

+

load_ok) { ?> -

+

- + load_ok) { ?>
- +
@@ -18,7 +18,7 @@ feed->description(); if ($desc != '') { ?>
- +
@@ -26,7 +26,7 @@
- +
feed->website(); ?> @@ -35,17 +35,17 @@
- +
- +
- +
- +
- + feed->httpAuth(false); ?>
- +
- +
- +
- - + +
diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 74cef4998..454228909 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -9,7 +9,7 @@ var feeds = [feeds as $feed) { ?>{\ -
/
\ +
/
\ 0 / " + feed_count + "\
"); } else { @@ -23,7 +23,7 @@ function updateProgressBar(i, title_feed) { function updateFeeds() { if (feed_count === 0) { - openNotification("", "good"); + openNotification("", "good"); ajax_loading = false; return; } diff --git a/app/views/update/apply.phtml b/app/views/update/apply.phtml index 30566c7ab..8221929ae 100644 --- a/app/views/update/apply.phtml +++ b/app/views/update/apply.phtml @@ -1,9 +1,9 @@ partial('aside_configure'); ?>
- + -

+

diff --git a/app/views/update/checkInstall.phtml b/app/views/update/checkInstall.phtml index b36551340..a92860c7e 100644 --- a/app/views/update/checkInstall.phtml +++ b/app/views/update/checkInstall.phtml @@ -1,7 +1,7 @@ partial('aside_configure'); ?>
- +

diff --git a/app/views/update/index.phtml b/app/views/update/index.phtml index 401f6acd6..5c07d307e 100644 --- a/app/views/update/index.phtml +++ b/app/views/update/index.phtml @@ -1,12 +1,12 @@ partial('aside_configure'); ?>
- + -

+

- last_update_time); ?> + last_update_time); ?>

message)) { ?> @@ -16,8 +16,8 @@

check_last_hour) { ?>

- - + +

@@ -26,11 +26,11 @@ (empty($this->message) || $this->message['status'] !== 'good')) { ?>

- +

update_to_apply) { ?> - +
diff --git a/app/views/user/manage.phtml b/app/views/user/manage.phtml index e46e02572..b175d48df 100644 --- a/app/views/user/manage.phtml +++ b/app/views/user/manage.phtml @@ -1,13 +1,13 @@ partial('aside_configure'); ?>
- +
- +
- +
- +
- +
- + mail_login; ?>
@@ -46,17 +46,17 @@
- - + +
- +
- +
-

nb_articles), format_bytes($this->size_user)); ?>

@@ -72,7 +72,7 @@
- +
diff --git a/app/views/user/profile.phtml b/app/views/user/profile.phtml index 60257012c..fc9b24674 100644 --- a/app/views/user/profile.phtml +++ b/app/views/user/profile.phtml @@ -1,36 +1,36 @@ partial('aside_configure'); ?>
- +
- +
- +
- +
/>
- +
- +
/> @@ -41,18 +41,18 @@
- + mail_login; ?>
placeholder="alice@example.net" /> - +
- - + +
-- cgit v1.2.3 From c9d3d78340e062b9e2fe19c8c55b8bdc75392e63 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 27 Feb 2016 17:51:13 +0100 Subject: CSP manually refreshing feeds https://github.com/FreshRSS/FreshRSS/issues/1075 --- app/Controllers/javascriptController.php | 2 +- app/views/javascript/actualize.phtml | 69 ++++++-------------------------- p/scripts/main.js | 44 +++++++++++++++++--- 3 files changed, 53 insertions(+), 62 deletions(-) (limited to 'app/views/javascript') diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php index e3ae3669e..00a7b5c38 100755 --- a/app/Controllers/javascriptController.php +++ b/app/Controllers/javascriptController.php @@ -6,7 +6,7 @@ class FreshRSS_javascript_Controller extends Minz_ActionController { } public function actualizeAction() { - header('Content-Type: text/javascript; charset=UTF-8'); + header('Content-Type: application/json; charset=UTF-8'); $feedDAO = FreshRSS_Factory::createFeedDao(); $this->view->feeds = $feedDAO->listFeedsOrderUpdate(FreshRSS_Context::$user_conf->ttl_default); } diff --git a/app/views/javascript/actualize.phtml b/app/views/javascript/actualize.phtml index 454228909..3baabf748 100644 --- a/app/views/javascript/actualize.phtml +++ b/app/views/javascript/actualize.phtml @@ -1,56 +1,13 @@ -"use strict"; -var feeds = [feeds as $feed) { ?>{url: " 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'); ?>",title: "name(); ?>"},], - feed_processed = 0, - feed_count = feeds.length; - -function initProgressBar(init) { - if (init) { - $("body").after("\
\ -
/
\ - 0 / " + feed_count + "\ -
"); - } else { - window.location.reload(); - } -} -function updateProgressBar(i, title_feed) { - $("#actualizeProgress .progress").html(i + " / " + feed_count); - $("#actualizeProgress .title").html(title_feed); -} - -function updateFeeds() { - if (feed_count === 0) { - openNotification("", "good"); - ajax_loading = false; - return; - } - initProgressBar(true); - - for (var i = 0; i < 10; i++) { - updateFeed(); - } -} - -function updateFeed() { - var feed = feeds.pop(); - if (feed == undefined) { - return; - } - - $.ajax({ - type: 'POST', - url: feed['url'], - }).complete(function (data) { - feed_processed++; - updateProgressBar(feed_processed, feed['title']); - - if (feed_processed === feed_count) { - initProgressBar(false); - } else { - updateFeed(); - } - }); -} +feeds as $feed) { + $feeds[] = array( + 'url' => Minz_Url::display(array('c' => 'feed', 'a' => 'actualize', 'params' => array('id' => $feed->id(), 'ajax' => '1')), 'php'), + 'title' => $feed->name(), + ); +} +echo json_encode(array( + 'feeds' => $feeds, + 'feedback_no_refresh' => _t('feedback.sub.feed.no_refresh'), + 'feedback_actualize' => _t('feedback.sub.actualize'), +)); diff --git a/p/scripts/main.js b/p/scripts/main.js index d62a6aff8..51c8f4cbf 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -767,6 +767,31 @@ function init_nav_entries() { }); } +// +var feed_processed = 0; + +function updateFeed(feeds, feeds_count) { + var feed = feeds.pop(); + if (feed == undefined) { + return; + } + + $.ajax({ + type: 'POST', + url: feed['url'], + }).complete(function (data) { + feed_processed++; + $("#actualizeProgress .progress").html(feed_processed + " / " + feeds_count); + $("#actualizeProgress .title").html(feed['title']); + + if (feed_processed === feeds_count) { + window.location.reload(); + } else { + updateFeed(feeds, feeds_count); + } + }); +} + function init_actualize() { var auto = false; @@ -777,14 +802,23 @@ function init_actualize() { ajax_loading = true; - $.getScript('./?c=javascript&a=actualize').done(function () { - if (auto && feed_count < 1) { + $.getJSON('./?c=javascript&a=actualize').done(function (data) { + if (auto && data.feeds.length < 1) { auto = false; ajax_loading = false; return false; } - - updateFeeds(); + if (data.feeds.length === 0) { + openNotification(data.feedback_no_refresh, "good"); + ajax_loading = false; + return; + } + //Progress bar + var feeds_count = data.feeds.length; + $('body').after('
' + data.feedback_actualize + '
/
0 / ' + feeds_count + '
'); + for (var i = 10; i > 0; i--) { + updateFeed(data.feeds, feeds_count); + } }); return false; @@ -795,7 +829,7 @@ function init_actualize() { $("#actualize").click(); } } - +//
// var notification = null, -- cgit v1.2.3