1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 11:55:56 +00:00

eslint-related fixes; move a few things from global context to App

This commit is contained in:
Andrew Dolgov
2020-06-05 07:44:57 +03:00
parent 88027d7a39
commit d01ad09800
11 changed files with 131 additions and 137 deletions

View File

@@ -94,7 +94,7 @@ class Article extends Handler_Protected {
":id" => $ref_id];
$sth->execute($params);
}
$sth = $pdo->prepare("UPDATE ttrss_user_entries SET published = true,
last_published = NOW() WHERE
int_id = ? AND owner_uid = ?");
@@ -393,7 +393,7 @@ class Article extends Handler_Protected {
# $entry .= " <a target=\"_blank\" href=\"" . htmlspecialchars($url) . "\" rel=\"noopener noreferrer\">" .
# $filename . " (" . $ctype . ")" . "</a>";
$entry = "<div onclick=\"popupOpenUrl('".htmlspecialchars($url)."')\"
$entry = "<div onclick=\"Article.popupOpenUrl('".htmlspecialchars($url)."')\"
dojoType=\"dijit.MenuItem\">$filename ($ctype)</div>";
array_push($entries_html, $entry);
@@ -473,7 +473,7 @@ class Article extends Handler_Protected {
else
$filename = "";
$rv .= "<div onclick='popupOpenUrl(\"".htmlspecialchars($entry["url"])."\")'
$rv .= "<div onclick='Article.popupOpenUrl(\"".htmlspecialchars($entry["url"])."\")'
dojoType=\"dijit.MenuItem\">".$filename . $title."</div>";
};
@@ -583,7 +583,7 @@ class Article extends Handler_Protected {
return "<div class='article-note $note_class'>
<i class='material-icons'>note</i>
<div $onclick class='body'>$note</div>
<div $onclick class='body'>$note</div>
</div>";
return $str;

View File

@@ -701,12 +701,12 @@ class Feeds extends Handler_Protected {
print "<section>";
print "<label>
<label class='checkbox'><input type='checkbox' name='need_auth' dojoType='dijit.form.CheckBox' id='feedDlg_loginCheck'
onclick='displayIfChecked(this, \"feedDlg_loginContainer\")'>
onclick='App.displayIfChecked(this, \"feedDlg_loginContainer\")'>
".__('This feed requires authentication.')."</label>";
print "</section>";
print "<footer>";
print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'
print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'
onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>";
print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>";
@@ -1337,7 +1337,7 @@ class Feeds extends Handler_Protected {
return 0;
} else if ($cat == -2) {
$sth = $pdo->prepare("SELECT COUNT(DISTINCT article_id) AS unread
$sth = $pdo->prepare("SELECT COUNT(DISTINCT article_id) AS unread
FROM ttrss_user_entries ue, ttrss_user_labels2 l
WHERE article_id = ref_id AND unread IS true AND ue.owner_uid = :uid");
$sth->execute(["uid" => $owner_uid]);
@@ -1373,8 +1373,8 @@ class Feeds extends Handler_Protected {
$pdo = Db::pdo();
$sth = $pdo->prepare("SELECT SUM(CASE WHEN unread THEN 1 ELSE 0 END) AS count
FROM ttrss_user_entries ue
$sth = $pdo->prepare("SELECT SUM(CASE WHEN unread THEN 1 ELSE 0 END) AS count
FROM ttrss_user_entries ue
WHERE ue.owner_uid = ?");
$sth->execute([$user_id]);
@@ -1468,7 +1468,7 @@ class Feeds extends Handler_Protected {
}
if (DB_TYPE == "pgsql") {
$test_sth = $pdo->prepare("select $search_query_part
$test_sth = $pdo->prepare("select $search_query_part
FROM ttrss_entries, ttrss_user_entries WHERE id = ref_id limit 1");
try {
@@ -2272,9 +2272,9 @@ class Feeds extends Handler_Protected {
$label_id = Labels::find_id($commandpair[1], $_SESSION["uid"]);
if ($label_id) {
array_push($query_keywords, "($not
array_push($query_keywords, "($not
(ttrss_entries.id IN (
SELECT article_id FROM ttrss_user_labels2 WHERE
SELECT article_id FROM ttrss_user_labels2 WHERE
label_id = ".$pdo->quote($label_id).")))");
} else {
array_push($query_keywords, "(false)");

View File

@@ -554,7 +554,7 @@ class Pref_Feeds extends Handler_Protected {
$last_error = $row["last_error"];
if ($last_error) {
print "&nbsp;<i class=\"material-icons\"
print "&nbsp;<i class=\"material-icons\"
title=\"".htmlspecialchars($last_error)."\">error</i>";
}
@@ -676,7 +676,7 @@ class Pref_Feeds extends Handler_Protected {
$auth_checked = $auth_enabled ? 'checked' : '';
print "<label class='checkbox'>
<input type='checkbox' $auth_checked name='need_auth' dojoType='dijit.form.CheckBox' id='feedEditDlg_loginCheck'
onclick='displayIfChecked(this, \"feedEditDlg_loginContainer\")'>
onclick='App.displayIfChecked(this, \"feedEditDlg_loginContainer\")'>
".__('This feed requires authentication.')."</label>";
print '</div><div dojoType="dijit.layout.ContentPane" title="'.__('Options').'">';
@@ -1172,7 +1172,7 @@ class Pref_Feeds extends Handler_Protected {
function index() {
print "<div dojoType='dijit.layout.AccordionContainer' region='center'>";
print "<div style='padding : 0px' dojoType='dijit.layout.AccordionPane'
print "<div style='padding : 0px' dojoType='dijit.layout.AccordionPane'
title=\"<i class='material-icons'>rss_feed</i> ".__('Feeds')."\">";
$sth = $this->pdo->prepare("SELECT COUNT(id) AS num_errors
@@ -1307,7 +1307,7 @@ class Pref_Feeds extends Handler_Protected {
print "</div>"; # feeds pane
print "<div dojoType='dijit.layout.AccordionPane'
print "<div dojoType='dijit.layout.AccordionPane'
title='<i class=\"material-icons\">import_export</i> ".__('OPML')."'>";
print "<h3>" . __("Using OPML you can export and import your feeds, filters, labels and Tiny Tiny RSS settings.") . "</h3>";
@@ -1360,7 +1360,7 @@ class Pref_Feeds extends Handler_Protected {
print "</div>"; # pane
print "<div dojoType=\"dijit.layout.AccordionPane\"
print "<div dojoType=\"dijit.layout.AccordionPane\"
title=\"<i class='material-icons'>share</i> ".__('Published & shared articles / Generated feeds')."\">";
print "<h3>" . __('Published articles can be subscribed by anyone who knows the following URL:') . "</h3>";
@@ -1672,7 +1672,7 @@ class Pref_Feeds extends Handler_Protected {
print "<fieldset class='narrow'>
<label class='checkbox'><input type='checkbox' name='need_auth' dojoType='dijit.form.CheckBox'
onclick='displayIfChecked(this, \"feedDlg_loginContainer\")'> ".
onclick='App.displayIfChecked(this, \"feedDlg_loginContainer\")'> ".
__('Feeds require authentication.')."</label></div>";
print "</fieldset>";