|
|
|
<?php
|
Grosse optimisation JavaScript
* Fusion de endless_mode.js dans main.js car endless_mode.js est
toujours chargé et assez petit.
* Suppression des changements de style en JavaScript lors du chargement
(genre boucle de .hide(), ou d'ajout de classe ".stick") et
implémentation en PHP + CSS à la place.
* Chargement JavaScript asynchrone (defer + async) pour de meilleurs
performances.
* Utilisation préférable des événements globaux plutôt que des
événements pour chaque élément avec jQuery.on(events, selector) pour un
chargement plus rapide et moins de mémoire utilisée.
* Optimisation manuelle du JavaScript (sélecteurs CSS plus performants,
méthodes jQuery plus appropriées, etc.).
* Désactivation de init_img() qui était coûteux, lancé à un moment où
les images ne sont de toute manière pas encore chargées, et qui
n'apporte rien car il y a déjà un img {max-width:100%} en CSS.
* JavaScript en mode strict.
* Enfin, passage du code JavaScript dans JSLint et du coup nombreuses
corrections (syntaxe, variables, méthodes dépréciées...).
* Devrait permettre de fermer
https://github.com/marienfressinaud/FreshRSS/issues/121
* Au passage, quelques simplifications CSS pour de meilleures
performances.
11 years ago
|
|
|
echo '"use strict";', "\n";
|
|
|
|
$mark = $this->conf->markWhen ();
|
|
|
|
echo 'var ',
|
Grosse optimisation JavaScript
* Fusion de endless_mode.js dans main.js car endless_mode.js est
toujours chargé et assez petit.
* Suppression des changements de style en JavaScript lors du chargement
(genre boucle de .hide(), ou d'ajout de classe ".stick") et
implémentation en PHP + CSS à la place.
* Chargement JavaScript asynchrone (defer + async) pour de meilleurs
performances.
* Utilisation préférable des événements globaux plutôt que des
événements pour chaque élément avec jQuery.on(events, selector) pour un
chargement plus rapide et moins de mémoire utilisée.
* Optimisation manuelle du JavaScript (sélecteurs CSS plus performants,
méthodes jQuery plus appropriées, etc.).
* Désactivation de init_img() qui était coûteux, lancé à un moment où
les images ne sont de toute manière pas encore chargées, et qui
n'apporte rien car il y a déjà un img {max-width:100%} en CSS.
* JavaScript en mode strict.
* Enfin, passage du code JavaScript dans JSLint et du coup nombreuses
corrections (syntaxe, variables, méthodes dépréciées...).
* Devrait permettre de fermer
https://github.com/marienfressinaud/FreshRSS/issues/121
* Au passage, quelques simplifications CSS pour de meilleures
performances.
11 years ago
|
|
|
'hide_posts=', ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'false' : 'true',
|
|
|
|
',auto_mark_article=', $mark['article'] === 'yes' ? 'true' : 'false',
|
|
|
|
',auto_mark_site=', $mark['site'] === 'yes' ? 'true' : 'false',
|
|
|
|
',auto_mark_scroll=', $mark['scroll'] === 'yes' ? 'true' : 'false',
|
|
|
|
',auto_load_more=', $this->conf->autoLoadMore () === 'yes' ? 'true' : 'false',
|
|
|
|
',full_lazyload=', $this->conf->lazyload () === 'yes' && ($this->conf->displayPosts () === 'yes' || Request::param ('output') === 'reader') ? 'true' : 'false',
|
|
|
|
',does_lazyload=', $this->conf->lazyload() === 'yes' ? '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'], '"',
|
|
|
|
"},\n";
|
|
|
|
|
|
|
|
if (Request::param ('output') === 'global') {
|
|
|
|
echo "iconClose='", RSSThemes::icon('close'), "',\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
$mail = Session::param ('mail', 'null');
|
|
|
|
if ($mail != 'null') {
|
|
|
|
$mail = '"' . $mail . '"';
|
|
|
|
}
|
|
|
|
echo 'use_persona=', login_is_conf ($this->conf) ? 'true' : 'false',
|
|
|
|
',url_freshrss="', _url ('index', 'index'), '",',
|
|
|
|
'url_login="', _url ('index', 'login'), '",',
|
|
|
|
'url_logout="', _url ('index', 'logout'), '",',
|
|
|
|
'current_user_mail=', $mail, ",\n";
|
|
|
|
|
|
|
|
echo 'load_shortcuts=', Request::controllerName () === 'index' && Request::actionName () === 'index' ? 'true' : 'false', ",\n";
|
|
|
|
|
|
|
|
echo 'str_confirmation="', Translate::t('confirm_action'), '"', ",\n";
|
|
|
|
|
|
|
|
echo 'auto_actualize_feeds=', Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
|
|
|
|
if (Session::param('actualize_feeds', false)) {
|
|
|
|
Session::_param('actualize_feeds');
|
|
|
|
}
|