summaryrefslogtreecommitdiff
path: root/app/views/helpers/javascript_vars.phtml
blob: 0ecdc1bca40458f376543eb72118603bc98eebee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php

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";