Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for not closing article after pressing outside article area #1539

Merged
merged 10 commits into from May 26, 2017
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -22,6 +22,7 @@
* Work around for IE / Edge bug in username pattern in version 1.6.3 [#1511](https://github.com/FreshRSS/FreshRSS/issues/1511)
* Fix *mark as read* articles when adding a new feed [#1535](https://github.com/FreshRSS/FreshRSS/issues/1535)
* UI
* New option for not closing the article when clicking outside its area [#1539](https://github.com/FreshRSS/FreshRSS/pull/1539)
* Download icon 💾 for other MIME types (e.g. `application/*`) [#1522](https://github.com/FreshRSS/FreshRSS/pull/1522)
* I18n
* Improve English [#1465](https://github.com/FreshRSS/FreshRSS/pull/1465)
Expand Down
1 change: 1 addition & 0 deletions CREDITS.md
Expand Up @@ -35,6 +35,7 @@ People are sorted by name so please keep this order.
* [Nicolas Elie](https://github.com/nicolaselie): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=nicolaselie)
* [Nicolas Lœuillet](https://github.com/nicosomb): [contributions](https://github.com/FreshRSS/documentation/commits?author=nicosomb), [Web](http://www.loeuillet.org/)
* [plopoyop](https://github.com/plopoyop): [contributions](https://github.com/FreshRSS/FreshRSS/commits?author=plopoyop)
* [Paulius Šukys](https://github.com/psukys): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:psukys), [Web](http://sukys.eu)
* [purexo](https://github.com/purexo): [contributions](https://github.com/FreshRSS/FreshRSS/pulls?q=is:pr+author:purexo), [Web](https://purexo.mom/)
* [Quentin Dufour](https://github.com/superboum): [contributions](https://github.com/FreshRSS/documentation/commits?author=superboum), [Web](http://quentin.dufour.io/)
* [romibi](https://github.com/romibi): [contributions](https://github.com/FreshRSS/FreshRSS/commits/dev?author=romibi)
Expand Down
1 change: 1 addition & 0 deletions app/Controllers/configureController.php
Expand Up @@ -109,6 +109,7 @@ public function readingAction() {
FreshRSS_Context::$user_conf->hide_read_feeds = Minz_Request::param('hide_read_feeds', false);
FreshRSS_Context::$user_conf->onread_jump_next = Minz_Request::param('onread_jump_next', false);
FreshRSS_Context::$user_conf->lazyload = Minz_Request::param('lazyload', false);
FreshRSS_Context::$user_conf->sides_close_article = Minz_Request::param('sides_close_article', false);
FreshRSS_Context::$user_conf->sticky_post = Minz_Request::param('sticky_post', false);
FreshRSS_Context::$user_conf->reading_confirm = Minz_Request::param('reading_confirm', false);
FreshRSS_Context::$user_conf->auto_remove_article = Minz_Request::param('auto_remove_article', false);
Expand Down
4 changes: 4 additions & 0 deletions app/Models/ConfigurationSetter.php
Expand Up @@ -197,6 +197,10 @@ private function _hide_read_feeds(&$data, $value) {
$data['hide_read_feeds'] = $this->handleBool($value);
}

private function _sides_close_article(&$data, $value) {
$data['sides_close_article'] = $this->handleBool($value);
}

private function _lazyload(&$data, $value) {
$data['lazyload'] = $this->handleBool($value);
}
Expand Down
1 change: 1 addition & 0 deletions app/i18n/cz/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Ve výchozím stavu zobrazovat kategorie zavřené',
'hide_read_feeds' => 'Schovat kategorie a kanály s nulovým počtem nepřečtených článků (nefunguje s nastavením “Zobrazit všechny články”)',
'img_with_lazyload' => 'Použít "lazy load" mód pro načítaní obrázků',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'skočit na další nepřečtený (kanál nebo kategorii)',
'number_divided_when_reader' => 'V režimu “Čtení” děleno dvěma.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/de/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Kategorien standardmäßig eingeklappt zeigen',
'hide_read_feeds' => 'Kategorien & Feeds ohne ungelesene Artikel verstecken (funktioniert nicht mit der Einstellung „Alle Artikel zeigen“)',
'img_with_lazyload' => 'Verwende die "träges Laden"-Methode zum Laden von Bildern',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'springe zum nächsten ungelesenen Geschwisterelement (Feed oder Kategorie)',
'number_divided_when_reader' => 'Geteilt durch 2 in der Lese-Ansicht.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/en/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Show categories folded by default',
'hide_read_feeds' => 'Hide categories & feeds with no unread articles (does not work with “Show all articles” configuration)',
'img_with_lazyload' => 'Use "lazy load" mode to load pictures',
'sides_close_article' => 'Clicking outside of article text area closes the article',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add this line to all other languages, suffixed with a TODO?

'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO

'jump_next' => 'jump to next unread sibling (feed or category)',
'number_divided_when_reader' => 'Divided by 2 in the reading view.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/fr/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Afficher les catégories pliées par défaut',
'hide_read_feeds' => 'Cacher les catégories & flux sans article non-lu (ne fonctionne pas avec la configuration “Afficher tous les articles”)',
'img_with_lazyload' => 'Utiliser le mode “chargement différé” pour les images',
'sides_close_article' => 'Cliquer hors de la zone de texte ferme l’article',
'jump_next' => 'sauter au prochain voisin non lu (flux ou catégorie)',
'number_divided_when_reader' => 'Divisé par 2 dans la vue de lecture.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/it/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Mostra categorie aperte di predefinito',
'hide_read_feeds' => 'Nascondi categorie e feeds con articoli già letti (non funziona se “Mostra tutti gli articoli” è selezionato)',
'img_with_lazyload' => 'Usa la modalità "caricamento ritardato" per le immagini',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'Salta al successivo feed o categoria non letto',
'number_divided_when_reader' => 'Diviso 2 nella modalità di lettura.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/nl/conf.php
Expand Up @@ -92,6 +92,7 @@
'display_categories_unfolded' => 'Toon categoriën ingeklapt als standaard',
'hide_read_feeds' => 'Verberg categoriën en feeds zonder ongelezen artikelen (werkt niet met “Toon alle artikelen” configuratie)',
'img_with_lazyload' => 'Gebruik "lazy load" methode om afbeeldingen te laden',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'Ga naar volgende ongelezen (feed of categorie)',
'mark_updated_article_unread' => 'Markeer vernieuwd artikel als ongelezen',
'number_divided_when_reader' => 'Gedeeld door 2 in de lees modus.',
Expand Down
1 change: 1 addition & 0 deletions app/i18n/ru/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Show categories folded by default',
'hide_read_feeds' => 'Hide categories & feeds with no unread article (does not work with “Show all articles” configuration)',
'img_with_lazyload' => 'Use "lazy load" mode to load pictures',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'jump to next unread sibling (feed or category)',
'number_divided_when_reader' => 'Divided by 2 in the reading view.',
'read' => array(
Expand Down
1 change: 1 addition & 0 deletions app/i18n/tr/conf.php
Expand Up @@ -93,6 +93,7 @@
'display_categories_unfolded' => 'Show categories folded by default',
'hide_read_feeds' => 'Okunmamış makalesi olmayan kategori veya akışı gizle ("Tüm makaleleri göster" komutunda çalışmaz)',
'img_with_lazyload' => 'Resimleri yüklemek için "tembel modu" kullan',
'sides_close_article' => 'Clicking outside of article text area closes the article', //TODO
'jump_next' => 'Bir sonraki benzer okunmamışa geç (akış veya kategori)',
'number_divided_when_reader' => 'Okuma modunda ikiye bölünecek.',
'read' => array(
Expand Down
10 changes: 10 additions & 0 deletions app/views/configure/reading.phtml
Expand Up @@ -106,6 +106,16 @@
</div>
</div>

<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="sides_close_article">
<input type="checkbox" name="sides_close_article" id="sides_close_article" value="1"<?php echo FreshRSS_Context::$user_conf->sides_close_article ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->sides_close_article; ?>"/>
<?php echo _t('conf.reading.sides_close_article'); ?>
<noscript> — <strong><?php echo _t('gen.js.should_be_activated'); ?></strong></noscript>
</label>
</div>
</div>

<div class="form-group">
<div class="group-controls">
<label class="checkbox" for="reading_confirm">
Expand Down
1 change: 1 addition & 0 deletions app/views/helpers/javascript_vars.phtml
Expand Up @@ -13,6 +13,7 @@ echo htmlspecialchars(json_encode(array(
'auto_load_more' => !!FreshRSS_Context::$user_conf->auto_load_more,
'auto_actualize_feeds' => !!Minz_Session::param('actualize_feeds', false),
'does_lazyload' => !!FreshRSS_Context::$user_conf->lazyload ,
'sides_close_article' => !!FreshRSS_Context::$user_conf->sides_close_article,
'sticky_post' => !!FreshRSS_Context::isStickyPostEnabled(),
'html5_notif_timeout' => FreshRSS_Context::$user_conf->html5_notif_timeout,
'auth_type' => FreshRSS_Context::$system_conf->auth_type,
Expand Down
1 change: 1 addition & 0 deletions config-user.default.php
Expand Up @@ -22,6 +22,7 @@
'hide_read_feeds' => true,
'onread_jump_next' => true,
'lazyload' => true,
'sides_close_article' => true,
'sticky_post' => true,
'reading_confirm' => false,
'auto_remove_article' => false,
Expand Down
4 changes: 4 additions & 0 deletions p/scripts/main.js
Expand Up @@ -705,6 +705,10 @@ function init_stream(divStream) {
if ($(e.target).closest('.content, .item.website, .item.link').length > 0) {
return;
}
if (!context.sides_close_article && $(e.target).is('div.flux_content')) {
// setting for not-closing after clicking outside article area
return;
}
var old_active = $(".flux.current"),
new_active = $(this).parent();
isCollapsed = true;
Expand Down