From d58886a937cbe425163526fc2ba3d2a118602035 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 12 Jan 2014 03:10:31 +0100 Subject: Implémentation de l'indentification par mot de passe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implémentation de https://github.com/marienfressinaud/FreshRSS/issues/104 --- app/views/helpers/javascript_vars.phtml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 92c068f7e..935294e60 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -30,8 +30,8 @@ if ($mail != 'null') { $mail = '"' . $mail . '"'; } - echo 'use_persona=', Minz_Configuration::authType() === 'persona' ? 'true' : 'false', - ',url_freshrss="', _url ('index', 'index'), '",', + echo 'authType="', Minz_Configuration::authType(), '",', + 'url_freshrss="', _url ('index', 'index'), '",', 'url_login="', _url ('index', 'login'), '",', 'url_logout="', _url ('index', 'logout'), '",', 'current_user_mail=', $mail, ",\n"; -- cgit v1.2.3 From 4de5e6c2756f2a300014b80108cf2bf5e91f69a3 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 12 Jan 2014 20:26:26 +0100 Subject: Corrige problème CSS partage/tags + problème raffraîchissement automatique des articles non-lus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit + Léger nettoyage JavaScript --- app/views/helpers/javascript_vars.phtml | 2 -- p/scripts/main.js | 53 +++++++++++++++++---------------- p/themes/default/freshrss.css | 4 ++- p/themes/default_dark/freshrss.css | 4 ++- p/themes/flat-design/freshrss.css | 4 ++- 5 files changed, 36 insertions(+), 31 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 935294e60..f4f36b4f3 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -36,8 +36,6 @@ 'url_logout="', _url ('index', 'logout'), '",', 'current_user_mail=', $mail, ",\n"; - echo 'load_shortcuts=', Minz_Request::controllerName () === 'index' && Minz_Request::actionName () === 'index' ? 'true' : 'false', ",\n"; - echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; $autoActualise = Minz_Session::param('actualize_feeds', false); diff --git a/p/scripts/main.js b/p/scripts/main.js index 0c4c3f1b2..7415d0c24 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -61,7 +61,11 @@ function incUnreadsFeed(article, feed_id, nb) { //Update unread: title document.title = document.title.replace(/((?: \(\d+\))?)( · .*?)((?: \(\d+\))?)$/, function (m, p1, p2, p3) { - return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + if (article || ($('#' + feed_id).closest('.active').length > 0)) { + return incLabel(p1, nb) + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + } else { + return p1 + p2 + incLabel(p3, feed_priority > 0 ? nb : 0); + } }); } @@ -312,6 +316,14 @@ function init_column_categories() { $(this).parent().next(".feeds").slideToggle(); return false; }); + $('#aside_flux').on('click', '.feeds .dropdown-toggle', function () { + if ($(this).nextAll('.dropdown-menu').length === 0) { + var feed_id = $(this).closest('li').attr('id').substr(2), + feed_web = $(this).data('fweb'), + template = $('#feed_config_template').html().replace(/!!!!!!/g, feed_id).replace('http://example.net/', feed_web); + $(this).attr('href', '#dropdown-' + feed_id).prev('.dropdown-target').attr('id', 'dropdown-' + feed_id).parent().append(template); + } + }); } function init_shortcuts() { @@ -403,7 +415,7 @@ function init_shortcuts() { }); } -function init_stream_delegates(divStream) { +function init_stream(divStream) { divStream.on('click', '.flux_header', function (e) { //flux_header_toggle if ($(e.target).closest('.item.website > a').length > 0) { return; @@ -475,17 +487,6 @@ function init_nav_entries() { }); } -function init_templates() { - $('#aside_flux').on('click', '.feeds .dropdown-toggle', function () { - if ($(this).nextAll('.dropdown-menu').length === 0) { - var feed_id = $(this).closest('li').attr('id').substr(2), - feed_web = $(this).data('fweb'), - template = $('#feed_config_template').html().replace(/!!!!!!/g, feed_id).replace('http://example.net/', feed_web); - $(this).attr('href', '#dropdown-' + feed_id).prev('.dropdown-target').attr('id', 'dropdown-' + feed_id).parent().append(template); - } - }); -} - function init_actualize() { $("#actualize").click(function () { $.getScript('./?c=javascript&a=actualize').done(function () { @@ -732,18 +733,7 @@ function init_all() { window.setTimeout(init_all, 50); return; } - $stream = $('#stream'); - init_posts(); - init_column_categories(); - if (load_shortcuts) { - init_shortcuts(); - } - init_stream_delegates($stream); - init_nav_entries(); - init_templates(); init_notifications(); - init_actualize(); - init_load_more($stream); switch (authType) { case 'form': init_loginForm(); @@ -753,8 +743,19 @@ function init_all() { break; } init_confirm_action(); - init_print_action(); - window.setInterval(refreshUnreads, 120000); + $stream = $('#stream'); + if ($stream.length > 0) { + init_actualize(); + init_column_categories(); + init_load_more($stream); + init_posts(); + init_stream($stream); + init_nav_entries(); + init_shortcuts(); + init_print_action(); + window.setInterval(refreshUnreads, 120000); + } + if (window.console) { console.log('FreshRSS init done.'); } diff --git a/p/themes/default/freshrss.css b/p/themes/default/freshrss.css index 733807938..593f21d30 100644 --- a/p/themes/default/freshrss.css +++ b/p/themes/default/freshrss.css @@ -259,9 +259,11 @@ } .flux .item { line-height: 40px; + white-space: nowrap; + } + .flux_header > .item { overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; } .flux .item.manage { width: 40px; diff --git a/p/themes/default_dark/freshrss.css b/p/themes/default_dark/freshrss.css index 884e2884d..e9eb2c705 100644 --- a/p/themes/default_dark/freshrss.css +++ b/p/themes/default_dark/freshrss.css @@ -250,9 +250,11 @@ } .flux .item { line-height: 40px; + white-space: nowrap; + } + .flux_header > .item { overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; } .flux .item.manage { width: 40px; diff --git a/p/themes/flat-design/freshrss.css b/p/themes/flat-design/freshrss.css index df1dfdde3..dca1b3f28 100644 --- a/p/themes/flat-design/freshrss.css +++ b/p/themes/flat-design/freshrss.css @@ -245,9 +245,11 @@ body { } .flux .item { line-height: 40px; + white-space: nowrap; + } + .flux_header > .item { overflow: hidden; text-overflow: ellipsis; - white-space: nowrap; } .flux .item.manage { width: 40px; -- cgit v1.2.3 From 693cd17cb8b26687fe46788033db49654310405a Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 13 Jan 2014 22:54:50 +0100 Subject: Quand Persona n'est pas utilisé, évite de communiquer current_user_mail en JS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG | 1 + app/views/helpers/javascript_vars.phtml | 90 +++++++++++++++++---------------- 2 files changed, 47 insertions(+), 44 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/CHANGELOG b/CHANGELOG index 5c9b56465..9a0ae1f61 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -54,6 +54,7 @@ * Chargement différé JavaScript pour iframe * CSS : * Nouveau thème sombre + * Chargement plus robuste des thèmes * Meilleur support des longs titres d’articles sur des écrans étroits * Meilleure accessibilité * FreshRSS fonctionne aussi en mode dégradé sans images (alternatives Unicode) et/ou sans CSS diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index f4f36b4f3..3fd5580f4 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -1,45 +1,47 @@ conf->mark_when; - echo 'var ', - 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', - ',auto_mark_article=', $mark['article'] ? 'true' : 'false', - ',auto_mark_site=', $mark['site'] ? 'true' : 'false', - ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', - ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', - ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', - ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; - - $s = $this->conf->shortcuts; - echo ',shortcuts={', - 'mark_read:"', $s['mark_read'], '",', - 'mark_favorite:"', $s['mark_favorite'], '",', - 'go_website:"', $s['go_website'], '",', - 'prev_entry:"', $s['prev_entry'], '",', - 'next_entry:"', $s['next_entry'], '",', - 'collapse_entry:"', $s['collapse_entry'], '",', - 'load_more:"', $s['load_more'], '",', - 'auto_share:"', $s['auto_share'], '"', - "},\n"; - - if (Minz_Request::param ('output') === 'global') { - echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; - } - - $mail = Minz_Session::param ('mail', 'null'); - if ($mail != 'null') { - $mail = '"' . $mail . '"'; - } - echo 'authType="', Minz_Configuration::authType(), '",', - 'url_freshrss="', _url ('index', 'index'), '",', - 'url_login="', _url ('index', 'login'), '",', - 'url_logout="', _url ('index', 'logout'), '",', - 'current_user_mail=', $mail, ",\n"; - - echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; - - $autoActualise = Minz_Session::param('actualize_feeds', false); - echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; - if ($autoActualise) { - Minz_Session::_param('actualize_feeds', false); - } + +echo '"use strict";', "\n"; + +$mark = $this->conf->mark_when; +echo 'var ', + 'hide_posts=', ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'false' : 'true', + ',auto_mark_article=', $mark['article'] ? 'true' : 'false', + ',auto_mark_site=', $mark['site'] ? 'true' : 'false', + ',auto_mark_scroll=', $mark['scroll'] ? 'true' : 'false', + ',auto_load_more=', $this->conf->auto_load_more ? 'true' : 'false', + ',full_lazyload=', $this->conf->lazyload && ($this->conf->display_posts || Minz_Request::param('output') === 'reader') ? 'true' : 'false', + ',does_lazyload=', $this->conf->lazyload ? 'true' : 'false'; + +$s = $this->conf->shortcuts; +echo ',shortcuts={', + 'mark_read:"', $s['mark_read'], '",', + 'mark_favorite:"', $s['mark_favorite'], '",', + 'go_website:"', $s['go_website'], '",', + 'prev_entry:"', $s['prev_entry'], '",', + 'next_entry:"', $s['next_entry'], '",', + 'collapse_entry:"', $s['collapse_entry'], '",', + 'load_more:"', $s['load_more'], '",', + 'auto_share:"', $s['auto_share'], '"', +"},\n"; + +if (Minz_Request::param ('output') === 'global') { + echo "iconClose='", FreshRSS_Themes::icon('close'), "',\n"; +} + +$authType = Minz_Configuration::authType(); +if ($authType === 'persona') { + echo 'current_user_mail="' . Minz_Session::param ('mail', '') . '",'; +} + +echo 'authType="', $authType, '",', + 'url_freshrss="', _url ('index', 'index'), '",', + 'url_login="', _url ('index', 'login'), '",', + 'url_logout="', _url ('index', 'logout'), '",'; + +echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; + +$autoActualise = Minz_Session::param('actualize_feeds', false); +echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; +if ($autoActualise) { + Minz_Session::_param('actualize_feeds', false); +} -- cgit v1.2.3 From fb908d45577cd0f156104eb23b4b9859d40b6da2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 18 Jan 2014 00:34:46 +0100 Subject: Corrige rafraîchissement automatique après mise-à-jour avec Persona ou formulaire MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Corrige https://github.com/marienfressinaud/FreshRSS/issues/327#issuecomment-31958851 --- app/Controllers/feedController.php | 1 + app/views/helpers/javascript_vars.phtml | 3 --- p/i/install.php | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'app/views/helpers/javascript_vars.phtml') diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index d2117f665..c40b3c400 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -164,6 +164,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController { $feedDAO = new FreshRSS_FeedDAO (); $entryDAO = new FreshRSS_EntryDAO (); + Minz_Session::_param('actualize_feeds', false); $id = Minz_Request::param ('id'); $force = Minz_Request::param ('force', false); diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml index 3fd5580f4..0ecdc1bca 100644 --- a/app/views/helpers/javascript_vars.phtml +++ b/app/views/helpers/javascript_vars.phtml @@ -42,6 +42,3 @@ echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n"; $autoActualise = Minz_Session::param('actualize_feeds', false); echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n"; -if ($autoActualise) { - Minz_Session::_param('actualize_feeds', false); -} diff --git a/p/i/install.php b/p/i/install.php index 294231fc0..18dfc1449 100644 --- a/p/i/install.php +++ b/p/i/install.php @@ -817,7 +817,7 @@ function printStep2 () {
- +
-- cgit v1.2.3