summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xclasses/article.php2
-rw-r--r--classes/backend.php3
-rw-r--r--classes/dlg.php129
-rwxr-xr-xclasses/feeds.php14
-rwxr-xr-xclasses/pref/feeds.php64
-rwxr-xr-xclasses/pref/filters.php17
-rw-r--r--classes/pref/labels.php4
-rw-r--r--classes/pref/prefs.php44
-rw-r--r--classes/pref/users.php4
-rwxr-xr-xclasses/rpc.php1
-rwxr-xr-xinclude/login_form.php7
-rw-r--r--index.php2
-rw-r--r--js/App.js40
-rw-r--r--js/Article.js1
-rw-r--r--js/CommonDialogs.js108
-rw-r--r--js/CommonFilters.js19
-rw-r--r--js/Feeds.js79
-rw-r--r--js/PrefFeedTree.js3
-rw-r--r--js/PrefFilterTree.js2
-rw-r--r--js/PrefHelpers.js164
-rw-r--r--js/PrefUsers.js1
-rw-r--r--plugins/af_psql_trgm/init.js11
-rw-r--r--plugins/af_psql_trgm/init.php6
-rw-r--r--plugins/mail/mail.js1
-rw-r--r--plugins/mailto/init.js1
-rw-r--r--plugins/note/note.js1
-rw-r--r--plugins/share/init.php6
-rw-r--r--plugins/share/share.js1
-rw-r--r--prefs.php2
-rw-r--r--themes/compact.css3
-rw-r--r--themes/compact_night.css3
-rw-r--r--themes/light.css3
-rw-r--r--themes/light/dijit_basic.less4
-rw-r--r--themes/night.css3
-rw-r--r--themes/night_blue.css3
35 files changed, 384 insertions, 372 deletions
diff --git a/classes/article.php b/classes/article.php
index 305764ed3..6d3746968 100755
--- a/classes/article.php
+++ b/classes/article.php
@@ -184,7 +184,7 @@ class Article extends Handler_Protected {
print "<button dojoType='dijit.form.Button'
type='submit' class='alt-primary'>".__('Save')."</button> ";
print "<button dojoType='dijit.form.Button'
- onclick=\"dijit.byId('editTagsDlg').hide()\">".__('Cancel')."</button>";
+ onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>";
print "</footer>";
}
diff --git a/classes/backend.php b/classes/backend.php
index 6e0fa191e..aa1935f23 100644
--- a/classes/backend.php
+++ b/classes/backend.php
@@ -83,8 +83,7 @@ class Backend extends Handler_Protected {
}
print "<footer class='text-center'>";
- print "<button dojoType='dijit.form.Button'
- onclick=\"return dijit.byId('helpDlg').hide()\">".__('Close this window')."</button>";
+ print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>".__('Close this window')."</button>";
print "</footer>";
}
diff --git a/classes/dlg.php b/classes/dlg.php
index fa154d7a4..4240ad222 100644
--- a/classes/dlg.php
+++ b/classes/dlg.php
@@ -13,85 +13,6 @@ class Dlg extends Handler_Protected {
return false;
}
- function importOpml() {
- print_notice("If you have imported labels and/or filters, you might need to reload preferences to see your new data.");
-
- print "<div class='panel panel-scrollable'>";
-
- $opml = new OPML($_REQUEST);
-
- $opml->opml_import($_SESSION["uid"]);
-
- print "</div>";
-
- print "<footer class='text-center'>";
- print "<button dojoType='dijit.form.Button'
- onclick=\"dijit.byId('opmlImportDlg').execute()\">".
- __('Close this window')."</button>";
- print "</footer>";
-
- print "</div>";
-
- //return;
- }
-
- function pubOPMLUrl() {
- $url_path = Opml::opml_publish_url();
-
- print "<header>" . __("Your Public OPML URL is:") . "</header>";
-
- print "<section>";
-
- print "<div class='panel text-center'>";
- print "<a id='pub_opml_url' href='$url_path' target='_blank'>$url_path</a>";
- print "</div>";
-
- print "</section>";
-
- print "<footer class='text-center'>";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return Helpers.OPML.changeKey()\">".
- __('Generate new URL')."</button> ";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return CommonDialogs.closeInfoBox()\">".
- __('Close this window')."</button>";
-
- print "</footer>";
-
- //return;
- }
-
- function explainError() {
- print "<div class=\"errorExplained\">";
-
- if ($this->param == 1) {
- print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner.");
-
- $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
-
- print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
-
- }
-
- if ($this->param == 3) {
- print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner.");
-
- $stamp = (int) file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
-
- print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
-
- }
-
- print "</div>";
-
- print "<footer class='text-center'>";
- print "<button onclick=\"return CommonDialogs.closeInfoBox()\">".
- __('Close this window')."</button>";
- print "</footer>";
-
- //return;
- }
-
function printTagCloud() {
print "<div class='panel text-center'>";
@@ -154,54 +75,4 @@ class Dlg extends Handler_Protected {
print "</footer>";
}
-
- function generatedFeed() {
-
- $this->params = explode(":", $this->param, 3);
- $feed_id = $this->params[0];
- $is_cat = (bool) $this->params[1];
-
- $key = Feeds::get_feed_access_key($feed_id, $is_cat);
-
- $url_path = htmlspecialchars($this->params[2]) . "&key=" . $key;
-
- $feed_title = Feeds::getFeedTitle($feed_id, $is_cat);
-
- print "<header>".T_sprintf("%s can be accessed via the following secret URL:", $feed_title)."</header>";
-
- print "<section>";
- print "<div class='panel text-center'>";
- print "<a id='gen_feed_url' href='$url_path' target='_blank'>$url_path</a>";
- print "</div>";
- print "</section>";
-
- print "<footer>";
-
- print "<button dojoType='dijit.form.Button' style='float : left' class='alt-info' onclick='window.open(\"https://tt-rss.org/wiki/GeneratedFeeds\")'>
- <i class='material-icons'>help</i> ".__("More info...")."</button>";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return CommonDialogs.genUrlChangeKey('$feed_id', '$is_cat')\">".
- __('Generate new URL')."</button> ";
-
- print "<button dojoType='dijit.form.Button' onclick=\"return CommonDialogs.closeInfoBox()\">".
- __('Close this window')."</button>";
-
- print "</footer>";
-
- //return;
- }
-
- function defaultPasswordWarning() {
-
- print_warning(__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication)."));
-
- print "<footer class='text-center'>";
- print "<button dojoType='dijit.form.Button' class='alt-primary'
- onclick=\"document.location.href = 'prefs.php'\">".
- __('Open Preferences')."</button> ";
- print "<button dojoType='dijit.form.Button'
- onclick=\"return dijit.byId('defaultPasswordDlg').hide();\">".
- __('Close this window')."</button>";
- print "</footeer>";
- }
}
diff --git a/classes/feeds.php b/classes/feeds.php
index bcfcbf894..031a671ae 100755
--- a/classes/feeds.php
+++ b/classes/feeds.php
@@ -37,7 +37,7 @@ class Feeds extends Handler_Protected {
$reply .= "<a href=\"#\"
title=\"".__("Show as feed")."\"
- onclick=\"App.displayDlg('".__("Show as feed")."','generatedFeed', '$feed_id:$is_cat:$rss_link')\">
+ onclick='CommonDialogs.generatedFeed(\"$feed_id\", \"$is_cat\", \"$rss_link\")'>
<i class='icon-syndicate material-icons'>rss_feed</i></a>";
$reply .= "<span id='feed_title'>";
@@ -730,9 +730,10 @@ class Feeds extends Handler_Protected {
print "<footer>";
print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'
- onclick=\"return dijit.byId('feedAddDlg').execute()\">".__('Subscribe')."</button>";
+ onclick='App.dialogOf(this).execute()'>".__('Subscribe')."</button>";
- print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('feedAddDlg').hide()\">".__('Cancel')."</button>";
+ print "<button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".
+ __('Cancel')."</button>";
print "</footer>";
print "</form>";
@@ -744,7 +745,7 @@ class Feeds extends Handler_Protected {
$active_feed_id = sprintf("%d", $this->params[0]);
$is_cat = $this->params[1] != "false";
- print "<form onsubmit='return false;'>";
+ print "<form onsubmit='return false'>";
print "<section>";
@@ -772,8 +773,9 @@ class Feeds extends Handler_Protected {
<i class='material-icons'>help</i> ".__("Search syntax")."</button>";
}
- print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary' onclick=\"dijit.byId('searchDlg').execute()\">".__('Search')."</button>
- <button dojoType='dijit.form.Button' onclick=\"dijit.byId('searchDlg').hide()\">".__('Cancel')."</button>";
+ print "<button dojoType='dijit.form.Button' class='alt-primary'
+ type='submit' onclick='App.dialogOf(this).execute()'>".__('Search')."</button>
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>";
print "</footer>";
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index 0b12bda13..659f7e183 100755
--- a/classes/pref/feeds.php
+++ b/classes/pref/feeds.php
@@ -809,8 +809,8 @@ class Pref_Feeds extends Handler_Protected {
print "<footer>
<button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='return CommonDialogs.unsubscribeFeed($feed_id, \"$title\")'>".
__('Unsubscribe')."</button>
- <button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return dijit.byId('feedEditDlg').execute()\">".__('Save')."</button>
- <button dojoType='dijit.form.Button' onclick=\"return dijit.byId('feedEditDlg').hide()\">".__('Cancel')."</button>
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit'>".__('Save')."</button>
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>
</footer>";
}
}
@@ -972,11 +972,10 @@ class Pref_Feeds extends Handler_Protected {
print "</section>";
print "<footer>
- <button dojoType='dijit.form.Button' type='submit' class='alt-primary'
- onclick=\"return dijit.byId('feedEditDlg').execute()\">".
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary' type='submit'>".
__('Save')."</button>
<button dojoType='dijit.form.Button'
- onclick=\"return dijit.byId('feedEditDlg').hide()\">".
+ onclick='App.dialogOf(this).hide()'>".
__('Cancel')."</button>
</footer>";
@@ -1194,6 +1193,11 @@ class Pref_Feeds extends Handler_Protected {
Feeds::add_feed_category($feed_cat);
}
+ function importOpml() {
+ $opml = new OPML($_REQUEST);
+ $opml->opml_import($_SESSION["uid"]);
+ }
+
function index() {
print "<div dojoType='dijit.layout.AccordionContainer' region='center'>";
@@ -1340,17 +1344,11 @@ class Pref_Feeds extends Handler_Protected {
print_notice("Only main settings profile can be migrated using OPML.");
- print "<iframe id=\"upload_iframe\"
- name=\"upload_iframe\" onload=\"Helpers.OPML.onImportComplete(this)\"
- style=\"width: 400px; height: 100px; display: none;\"></iframe>";
-
- print "<form name='opml_form' style='display : inline-block' target='upload_iframe'
- enctype='multipart/form-data' method='POST'
- action='backend.php'>
+ print "<form id='opml_import_form' method='post' enctype='multipart/form-data' >
<label class='dijitButton'>".__("Choose file...")."
<input style='display : none' id='opml_file' name='opml_file' type='file'>&nbsp;
</label>
- <input type='hidden' name='op' value='dlg'>
+ <input type='hidden' name='op' value='pref-feeds'>
<input type='hidden' name='csrf_token' value='".$_SESSION['csrf_token']."'>
<input type='hidden' name='method' value='importOpml'>
<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return Helpers.OPML.import();\" type=\"submit\">" .
@@ -1379,7 +1377,7 @@ class Pref_Feeds extends Handler_Protected {
" " .
__("Published OPML does not include your Tiny Tiny RSS settings, feeds that require authentication or feeds hidden from Popular feeds.") . "</p>";
- print "<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return App.displayDlg('".__("Public OPML URL")."','pubOPMLUrl')\">".
+ print "<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return CommonDialogs.publishedOPML()\">".
__('Display published OPML URL')."</button> ";
PluginHost::getInstance()->run_hooks(PluginHost::HOOK_PREFS_TAB_SECTION, "prefFeedsOPML");
@@ -1391,10 +1389,10 @@ class Pref_Feeds extends Handler_Protected {
print "<h3>" . __('Published articles can be subscribed by anyone who knows the following URL:') . "</h3>";
- $rss_url = '-2::' . htmlspecialchars(get_self_url_prefix() .
+ $rss_url = htmlspecialchars(get_self_url_prefix() .
"/public.php?op=rss&id=-2&view-mode=all_articles");;
- print "<button dojoType='dijit.form.Button' class='alt-primary' onclick=\"return App.displayDlg('".__("Show as feed")."','generatedFeed', '$rss_url')\">".
+ print "<button dojoType='dijit.form.Button' class='alt-primary' onclick='CommonDialogs.generatedFeed(-2, false, \"$rss_url\")'>".
__('Display URL')."</button> ";
print "<button class=\"alt-danger\" dojoType=\"dijit.form.Button\" onclick=\"return Helpers.clearFeedAccessKeys()\">".
@@ -1511,9 +1509,9 @@ class Pref_Feeds extends Handler_Protected {
print "</div>";
print "<footer>
- <button style='float : left' class=\"alt-danger\" dojoType='dijit.form.Button' onclick=\"dijit.byId('inactiveFeedsDlg').removeSelected()\">"
+ <button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='App.dialogOf(this).removeSelected()'>"
.__('Unsubscribe from selected feeds')."</button>
- <button dojoType='dijit.form.Button' onclick=\"dijit.byId('inactiveFeedsDlg').hide()\">"
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit'>"
.__('Close this window')."</button>
</footer>";
@@ -1570,10 +1568,9 @@ class Pref_Feeds extends Handler_Protected {
print "</div>";
print "<footer>";
- print "<button style='float : left' class=\"alt-danger\" dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').removeSelected()\">"
+ print "<button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='App.dialogOf(this).removeSelected()'>"
.__('Unsubscribe from selected feeds')."</button> ";
-
- print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('errorFeedsDlg').hide()\">".
+ print "<button dojoType='dijit.form.Button' class='alt-primary' type='submit'>".
__('Close this window')."</button>";
print "</footer>";
@@ -1667,9 +1664,9 @@ class Pref_Feeds extends Handler_Protected {
print "</fieldset>";
print "<footer>
- <button dojoType='dijit.form.Button' onclick=\"return dijit.byId('batchSubDlg').execute()\" type='submit' class='alt-primary'>".
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).execute()' type='submit' class='alt-primary'>".
__('Subscribe')."</button>
- <button dojoType='dijit.form.Button' onclick=\"return dijit.byId('batchSubDlg').hide()\">".__('Cancel')."</button>
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".__('Cancel')."</button>
</footer>";
print "</form>";
@@ -1706,27 +1703,34 @@ class Pref_Feeds extends Handler_Protected {
}
}
+ function getOPMLKey() {
+ print json_encode(["link" => OPML::opml_publish_url()]);
+ }
+
function regenOPMLKey() {
$this->update_feed_access_key('OPML:Publish',
- false, $_SESSION["uid"]);
-
- $new_link = Opml::opml_publish_url();
+ false, $_SESSION["uid"]);
- print json_encode(array("link" => $new_link));
+ print json_encode(["link" => OPML::opml_publish_url()]);
}
function regenFeedKey() {
$feed_id = clean($_REQUEST['id']);
$is_cat = clean($_REQUEST['is_cat']);
- $new_key = $this->update_feed_access_key($feed_id, $is_cat);
+ $new_key = $this->update_feed_access_key($feed_id, $is_cat, $_SESSION["uid"]);
print json_encode(["link" => $new_key]);
}
+ function getFeedKey() {
+ $feed_id = clean($_REQUEST['id']);
+ $is_cat = clean($_REQUEST['is_cat']);
+
+ print json_encode(["link" => Feeds::get_feed_access_key($feed_id, $is_cat, $_SESSION["uid"])]);
+ }
- private function update_feed_access_key($feed_id, $is_cat, $owner_uid = false) {
- if (!$owner_uid) $owner_uid = $_SESSION["uid"];
+ private function update_feed_access_key($feed_id, $is_cat, $owner_uid) {
// clear old value and generate new one
$sth = $this->pdo->prepare("DELETE FROM ttrss_access_keys
diff --git a/classes/pref/filters.php b/classes/pref/filters.php
index 43a625989..096ab826d 100755
--- a/classes/pref/filters.php
+++ b/classes/pref/filters.php
@@ -3,7 +3,7 @@ class Pref_Filters extends Handler_Protected {
function csrf_ignore($method) {
$csrf_ignored = array("index", "getfiltertree", "edit", "newfilter", "newrule",
- "newaction", "savefilterorder", "testfilterdlg");
+ "newaction", "savefilterorder");
return array_search($method, $csrf_ignored) !== false;
}
@@ -163,21 +163,6 @@ class Pref_Filters extends Handler_Protected {
print json_encode($rv);
}
- function testFilterDlg() {
- ?>
- <div>
- <img id='prefFilterLoadingIndicator' src='images/indicator_tiny.gif'>&nbsp;
- <span id='prefFilterProgressMsg'>Looking for articles...</span>
- </div>
-
- <ul class='panel panel-scrollable list list-unstyled' id='prefFilterTestResultList'></ul>
-
- <footer class='text-center'>
- <button dojoType='dijit.form.Button' onclick="dijit.byId('filterTestDlg').hide()"><?php echo __('Close this window') ?></button>
- </footer>
- <?php
- }
-
private function getfilterrules_list($filter_id) {
$sth = $this->pdo->prepare("SELECT reg_exp,
inverse,
diff --git a/classes/pref/labels.php b/classes/pref/labels.php
index 4f83ad16e..a7869c379 100644
--- a/classes/pref/labels.php
+++ b/classes/pref/labels.php
@@ -69,9 +69,9 @@ class Pref_Labels extends Handler_Protected {
print "</section>";
print "<footer>";
- print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary' onclick=\"dijit.byId('labelEditDlg').execute()\">".
+ print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary' onclick='App.dialogOf(this).execute()'>".
__('Save')."</button>";
- print "<button dojoType='dijit.form.Button' onclick=\"dijit.byId('labelEditDlg').hide()\">".
+ print "<button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".
__('Cancel')."</button>";
print "</footer>";
diff --git a/classes/pref/prefs.php b/classes/pref/prefs.php
index 50a1f39c8..45f9dc71e 100644
--- a/classes/pref/prefs.php
+++ b/classes/pref/prefs.php
@@ -8,7 +8,7 @@ class Pref_Prefs extends Handler_Protected {
private $profile_blacklist = [];
function csrf_ignore($method) {
- $csrf_ignored = array("index", "updateself", "customizecss", "editprefprofiles", "otpqrcode");
+ $csrf_ignored = array("index", "updateself", "editprefprofiles", "otpqrcode");
return array_search($method, $csrf_ignored) !== false;
}
@@ -1168,28 +1168,7 @@ class Pref_Prefs extends Handler_Protected {
$value = get_pref("USER_STYLESHEET");
$value = str_replace("<br/>", "\n", $value);
- print_notice(__("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here."));
-
- print_hidden("op", "rpc");
- print_hidden("method", "setpref");
- print_hidden("key", "USER_STYLESHEET");
-
- print "<div id='css_edit_apply_msg' style='display : none'>";
- print_warning(__("User CSS has been applied, you might need to reload the page to see all changes."));
- print "</div>";
-
- print "<textarea class='panel user-css-editor' dojoType='dijit.form.SimpleTextarea'
- style='font-size : 12px;' name='value'>$value</textarea>";
-
- print "<footer>";
- print "<button dojoType='dijit.form.Button' class='alt-success'
- onclick=\"dijit.byId('cssEditDlg').apply()\">".__('Apply')."</button> ";
- print "<button dojoType='dijit.form.Button' class='alt-primary'
- onclick=\"dijit.byId('cssEditDlg').execute()\">".__('Save and reload')."</button> ";
- print "<button dojoType='dijit.form.Button'
- onclick=\"dijit.byId('cssEditDlg').hide()\">".__('Cancel')."</button>";
- print "</footer>";
-
+ print json_encode(["value" => $value]);
}
function editPrefProfiles() {
@@ -1218,9 +1197,9 @@ class Pref_Prefs extends Handler_Protected {
WHERE owner_uid = ? ORDER BY title");
$sth->execute([$_SESSION['uid']]);
- print "<div class='panel panel-scrollable'>";
+ print "<form onsubmit='return false'>";
- print "<form id='profile_edit_form' onsubmit='return false'>";
+ print "<div class='panel panel-scrollable'>";
print "<table width='100%' id='pref-profiles-list'>";
@@ -1275,18 +1254,19 @@ class Pref_Prefs extends Handler_Protected {
}
print "</table>";
- print "</form>";
print "</div>";
print "<footer>
- <button style='float : left' class='alt-danger' dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('profileEditDlg').removeSelected()\">".
- __('Remove selected profiles')."</button>
- <button dojoType='dijit.form.Button' class='alt-primary' type='submit' onclick=\"dijit.byId('profileEditDlg').activateProfile()\">".
- __('Activate profile')."</button>
- <button dojoType='dijit.form.Button' onclick=\"dijit.byId('profileEditDlg').hide()\">".
- __('Cancel')."</button>";
+ <button style='float : left' class='alt-danger' dojoType='dijit.form.Button' onclick='App.dialogOf(this).removeSelected()'>".
+ __('Remove selected profiles')."</button>
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit' onclick='App.dialogOf(this).execute()'>".
+ __('Activate profile')."</button>
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".
+ __('Cancel')."</button>";
print "</footer>";
+ print "</form>";
+
}
private function getShortDesc($pref_name) {
diff --git a/classes/pref/users.php b/classes/pref/users.php
index 67daa884f..16c2d3142 100644
--- a/classes/pref/users.php
+++ b/classes/pref/users.php
@@ -110,9 +110,9 @@ class Pref_Users extends Handler_Protected {
print '</div>';
print "<footer>
- <button dojoType='dijit.form.Button' class='alt-primary' type='submit' onclick=\"dijit.byId('userEditDlg').execute()\">".
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit' onclick='App.dialogOf(this).execute()'>".
__('Save')."</button>
- <button dojoType='dijit.form.Button' onclick=\"dijit.byId('userEditDlg').hide()\">".
+ <button dojoType='dijit.form.Button' onclick='App.dialogOf(this).hide()'>".
__('Cancel')."</button>
</footer>";
diff --git a/classes/rpc.php b/classes/rpc.php
index d4fdd1cd0..a6ddf7004 100755
--- a/classes/rpc.php
+++ b/classes/rpc.php
@@ -454,6 +454,7 @@ class RPC extends Handler_Protected {
$params[strtolower($param)] = (int) get_pref($param);
}
+ $params["safe_mode"] = !empty($_SESSION["safe_mode"]);
$params["check_for_updates"] = CHECK_FOR_UPDATES;
$params["icons_url"] = ICONS_URL;
$params["cookie_lifetime"] = SESSION_COOKIE_LIFETIME;
diff --git a/include/login_form.php b/include/login_form.php
index 0e8f8389e..f3f5d448e 100755
--- a/include/login_form.php
+++ b/include/login_form.php
@@ -153,11 +153,14 @@
<fieldset class="narrow">
<label> </label>
- <label ><input dojoType="dijit.form.CheckBox" name="safe_mode" id="safe_mode"
+ <label id="safe_mode_label"><input dojoType="dijit.form.CheckBox" name="safe_mode" id="safe_mode"
type="checkbox">
- <?php echo __("Safe mode (no plugins)") ?></label>
+ <?php echo __("Safe mode") ?></label>
</fieldset>
+ <div dojoType="dijit.Tooltip" connectId="safe_mode_label" position="below" style="display:none">
+ <?php echo __("Uses default theme and prevents all plugins from loading."); ?>
+ </div>
<?php if (SESSION_COOKIE_LIFETIME > 0) { ?>
<fieldset class="narrow">
diff --git a/index.php b/index.php
index ead02f2c4..93b3da71e 100644
--- a/index.php
+++ b/index.php
@@ -39,7 +39,7 @@
<title>Tiny Tiny RSS</title>
<meta name="viewport" content="initial-scale=1,width=device-width" />
- <?php if ($_SESSION["uid"] && !isset($_REQUEST["ignore-theme"])) {
+ <?php if ($_SESSION["uid"] && empty($_SESSION["safe_mode"])) {
$theme = get_pref("USER_CSS_THEME", false, false);
if ($theme && theme_exists("$theme")) {
echo stylesheet_tag(get_theme_path($theme), 'theme_css');
diff --git a/js/App.js b/js/App.js
index db7797b75..6d7fd1c8b 100644
--- a/js/App.js
+++ b/js/App.js
@@ -16,6 +16,11 @@ const App = {
hotkey_actions: {},
is_prefs: false,
LABEL_BASE_INDEX: -1024,
+ FormFields: {
+ hidden: function(name, value) {
+ return `<input dojoType="dijit.form.TextBox" style="display : none" name="${name}" value="${value}"></input>`
+ }
+ },
Scrollable: {
scrollByPages: function (elem, page_offset) {
if (!elem) return;
@@ -49,6 +54,9 @@ const App = {
elem.offsetTop >= ctr.scrollTop;
}
},
+ dialogOf: function (widget) {
+ return dijit.getEnclosingWidget(widget.domNode.closest('.dijitDialog'));
+ },
label_to_feed_id: function(label) {
return this.LABEL_BASE_INDEX - 1 - Math.abs(label);
},
@@ -300,20 +308,15 @@ const App = {
}
},
helpDialog: function(topic) {
- if (dijit.byId("helpDlg"))
- dijit.byId("helpDlg").destroyRecursive();
-
- xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
- const dialog = new dijit.Dialog({
- id: "helpDlg",
- title: __("Help"),
- style: "width: 600px",
- content: transport.responseText,
- });
-
- dialog.show();
- });
- },
+ xhrPost("backend.php", {op: "backend", method: "help", topic: topic}, (transport) => {
+ const dialog = new dijit.Dialog({
+ title: __("Help"),
+ content: transport.responseText,
+ });
+
+ dialog.show();
+ });
+ },
displayDlg: function(title, id, param, callback) {
Notify.progress("Loading, please wait...", true);
@@ -329,7 +332,6 @@ const App = {
dialog = new dijit.Dialog({
title: title,
id: 'infoBox',
- style: "width: 600px",
onCancel: function () {
return true;
},
@@ -433,7 +435,7 @@ const App = {
console.log("RI:", k, "=>", v);
if (k == "daemon_is_running" && v != 1) {
- Notify.error("<span onclick=\"App.explainError(1)\">Update daemon is not running.</span>", true);
+ Notify.error("Update daemon is not running.", true);
return;
}
@@ -446,7 +448,7 @@ const App = {
}
if (k == "daemon_stamp_ok" && v != 1) {
- Notify.error("<span onclick=\"App.explainError(3)\">Update daemon is not updating feeds.</span>", true);
+ Notify.error("Update daemon is not updating feeds.", true);
return;
}
@@ -530,9 +532,6 @@ const App = {
this.initSecondStage();
},
- explainError: function(code) {
- return this.displayDlg(__("Error explained"), "explainError", code);
- },
Error: {
fatal: function (error, params) {
params = params || {};
@@ -599,7 +598,6 @@ const App = {
const dialog = new dijit.Dialog({
id: "exceptionDlg",
title: params.title || __("Unhandled exception"),
- style: "width: 600px",
content: content
});
diff --git a/js/Article.js b/js/Article.js
index a075e321f..538377f45 100644
--- a/js/Article.js
+++ b/js/Article.js
@@ -258,7 +258,6 @@ const Article = {
const dialog = new dijit.Dialog({
id: "editTagsDlg",
title: __("Edit article Tags"),
- style: "width: 600px",
content: transport.responseText,
execute: function () {
if (this.validate()) {
diff --git a/js/CommonDialogs.js b/js/CommonDialogs.js
index b344967a7..b41065c63 100644
--- a/js/CommonDialogs.js
+++ b/js/CommonDialogs.js
@@ -87,7 +87,6 @@ const CommonDialogs = {
const dialog = new dijit.Dialog({
id: "feedAddDlg",
title: __("Subscribe to Feed"),
- style: "width: 600px",
content: transport.responseText,
show_error: function (msg) {
const elem = $("fadd_error_message");
@@ -199,7 +198,6 @@ const CommonDialogs = {
const dialog = new dijit.Dialog({
id: "errorFeedsDlg",
title: __("Feeds with update errors"),
- style: "width: 600px",
getSelectedFeeds: function () {
return Tables.getSelected("error-feeds-list");
},
@@ -309,7 +307,6 @@ const CommonDialogs = {
const dialog = new dijit.Dialog({
id: "feedEditDlg",
title: __("Edit Feed"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Notify.progress("Saving data...", true);
@@ -359,5 +356,108 @@ const CommonDialogs = {
});
}
return false;
- }
+ },
+ publishedOPML: function() {
+
+ Notify.progress("Loading, please wait...", true);
+
+ xhrJson("backend.php", {op: "pref-feeds", method: "getOPMLKey"}, (reply) => {
+ try {
+ if (dijit.byId("publicOPMLDlg"))
+ dijit.byId("publicOPMLDlg").destroyRecursive();
+
+ const dialog = new dijit.Dialog({
+ title: __("Public OPML URL"),
+ id: 'publicOPMLDlg',
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ },
+ content: `
+ <header>${__("Your Public OPML URL is:")}</header>
+ <section>
+ <div class='panel text-center'>
+ <a id='pub_opml_url' href="${App.escapeHtml(reply.link)}" target='_blank'>${reply.link}</a>
+ </div>
+ </section>
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' onclick="return Helpers.OPML.changeKey()">
+ ${__('Generate new URL')}
+ </button>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
+ ${__('Close this window')}
+ </button>
+ </footer>
+ `
+ });
+
+ dialog.show();
+
+ Notify.close();
+
+ } catch (e) {
+ this.Error.report(e);
+ }
+ });
+ },
+ generatedFeed: function(feed, is_cat, rss_url) {
+
+ Notify.progress("Loading, please wait...", true);
+
+ xhrJson("backend.php", {op: "pref-feeds", method: "getFeedKey", id: feed, is_cat: is_cat}, (reply) => {
+ try {
+ if (dijit.byId("genFeedDlg"))
+ dijit.byId("genFeedDlg").destroyRecursive();
+
+ const feed_title = Feeds.getName(feed, is_cat);
+
+ const secret_url = rss_url + "&key=" + encodeURIComponent(reply.link);
+
+ const dialog = new dijit.Dialog({
+ title: __("Show as feed"),
+ id: 'genFeedDlg',
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ },
+ content: `
+ <header>${__("%s can be accessed via the following secret URL:").replace("%s", feed_title)}</header>
+ <section>
+ <div class='panel text-center'>
+ <a id='gen_feed_url' href="${App.escapeHtml(secret_url)}" target='_blank'>${secret_url}</a>
+ </div>
+ </section>
+ <footer>
+ <button dojoType='dijit.form.Button' style='float : left' class='alt-info'
+ onclick='window.open("https://tt-rss.org/wiki/GeneratedFeeds")'>
+ <i class='material-icons'>help</i> ${__("More info...")}</button>
+ <button dojoType='dijit.form.Button' onclick="return CommonDialogs.genUrlChangeKey('${feed}', '${is_cat}')">
+ ${__('Generate new URL')}
+ </button>
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit'>
+ ${__('Close this window')}
+ </button>
+ </footer>
+ `
+ });
+
+ dialog.show();
+
+ Notify.close();
+
+ } catch (e) {
+ this.Error.report(e);
+ }
+ });
+ },
};
diff --git a/js/CommonFilters.js b/js/CommonFilters.js
index 9676abe9e..61e6b2f95 100644
--- a/js/CommonFilters.js
+++ b/js/CommonFilters.js
@@ -130,7 +130,6 @@ const Filters = {
const rule_dlg = new dijit.Dialog({
id: "filterNewRuleDlg",
title: ruleStr ? __("Edit rule") : __("Add rule"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Filters.createNewRuleElement($("filterDlg_Matches"), replaceNode);
@@ -160,7 +159,6 @@ const Filters = {
const rule_dlg = new dijit.Dialog({
id: "filterNewActionDlg",
title: actionStr ? __("Edit action") : __("Add action"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Filters.createNewActionElement($("filterDlg_Actions"), replaceNode);
@@ -180,7 +178,6 @@ const Filters = {
const test_dlg = new dijit.Dialog({
id: "filterTestDlg",
title: "Test Filter",
- style: "width: 600px",
results: 0,
limit: 100,
max_offset: 10000,
@@ -251,10 +248,21 @@ const Filters = {
});
},
- href: "backend.php?op=pref-filters&method=testFilterDlg"
+ content: `
+ <div>
+ <img id='prefFilterLoadingIndicator' src='images/indicator_tiny.gif'>&nbsp;
+ <span id='prefFilterProgressMsg'>Looking for articles...</span>
+ </div>
+
+ <ul class='panel panel-scrollable list list-unstyled' id='prefFilterTestResultList'></ul>
+
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' onclick="dijit.byId('filterTestDlg').hide()"><?php echo __('Close this window') ?></button>
+ </footer>
+ `
});
- dojo.connect(test_dlg, "onLoad", null, function (/* e */) {
+ dojo.connect(test_dlg, "onShow", null, function (/* e */) {
test_dlg.getTestResults(params, 0);
});
@@ -283,7 +291,6 @@ const Filters = {
const dialog = new dijit.Dialog({
id: "filterEditDlg",
title: __("Create Filter"),
- style: "width: 600px",
test: function () {
Filters.editFilterTest(dojo.formToObject("filter_new_form"));
},
diff --git a/js/Feeds.js b/js/Feeds.js
index ccb982cb3..45b8193e4 100644
--- a/js/Feeds.js
+++ b/js/Feeds.js
@@ -226,25 +226,64 @@ const Feeds = {
if (dijit.byId("defaultPasswordDlg"))
dijit.byId("defaultPasswordDlg").destroyRecursive();
- xhrPost("backend.php", {op: 'dlg', method: 'defaultpasswordwarning'}, (transport) => {
- const dialog = new dijit.Dialog({
- title: __("Your password is at default value"),
- content: transport.responseText,
- id: 'defaultPasswordDlg',
- style: "width: 600px",
- onCancel: function () {
- return true;
- },
- onExecute: function () {
- return true;
- },
- onClose: function () {
- return true;
- }
- });
+ const dialog = new dijit.Dialog({
+ title: __("Your password is at default value"),
+ content: `<div class='alert alert-error'>
+ ${__("You are using default tt-rss password. Please change it in the Preferences (Personal data / Authentication).")}
+ </div>
+
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' class='alt-primary' onclick="document.location.href = 'prefs.php'">
+ ${__('Open Preferences')}
+ </button>
+ <button dojoType='dijit.form.Button' onclick="return dijit.byId('defaultPasswordDlg').hide()">
+ ${__('Close this window')}
+ </button>
+ </footer>`,
+ id: 'defaultPasswordDlg',
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ }
+ });
+
+ dialog.show();
+ }
- dialog.show();
+ if (dijit.byId("safeModeDlg"))
+ dijit.byId("safeModeDlg").destroyRecursive();
+
+ if (App.getInitParam("safe_mode")) {
+ const dialog = new dijit.Dialog({
+ title: __("Safe mode"),
+ content: `
+ <div class='alert alert-info'>
+ ${__('Tiny Tiny RSS is running in safe mode. All themes and plugins are disabled. You will need to log out and back in to disable it.')}
+ </div>
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
+ ${__('Close this window')}
+ </button>
+ </footer>
+ `,
+ id: 'safeModeDlg',
+ onCancel: function () {
+ return true;
+ },
+ onExecute: function () {
+ return true;
+ },
+ onClose: function () {
+ return true;
+ }
});
+
+ dialog.show();
}
// bw_limit disables timeout() so we request initial counters separately
@@ -555,19 +594,17 @@ const Feeds = {
return tree.model.store.getValue(nuf, 'bare_id');
},
search: function() {
- if (dijit.byId("searchDlg"))
- dijit.byId("searchDlg").destroyRecursive();
-
xhrPost("backend.php",
{op: "feeds", method: "search",
param: Feeds.getActive() + ":" + Feeds.activeIsCat()},
(transport) => {
+ if (dijit.byId("searchDlg"))
+ dijit.byId("searchDlg").destroyRecursive();
const dialog = new dijit.Dialog({
id: "searchDlg",
content: transport.responseText,
title: __("Search"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Feeds._search_query = this.attr('value');
diff --git a/js/PrefFeedTree.js b/js/PrefFeedTree.js
index acd410a2c..4c8c25d0e 100644
--- a/js/PrefFeedTree.js
+++ b/js/PrefFeedTree.js
@@ -259,7 +259,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const dialog = new dijit.Dialog({
id: "feedEditDlg",
title: __("Edit Multiple Feeds"),
- style: "width: 600px",
getChildByName: function (name) {
let rv = null;
this.getChildren().each(
@@ -346,7 +345,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const dialog = new dijit.Dialog({
id: "batchSubDlg",
title: __("Batch subscribe"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Notify.progress(__("Subscribing to feeds..."), true);
@@ -372,7 +370,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const dialog = new dijit.Dialog({
id: "inactiveFeedsDlg",
title: __("Feeds without recent updates"),
- style: "width: 600px",
getSelectedFeeds: function () {
return Tables.getSelected("inactive-feeds-list");
},
diff --git a/js/PrefFilterTree.js b/js/PrefFilterTree.js
index b2041d182..a2e625bc1 100644
--- a/js/PrefFilterTree.js
+++ b/js/PrefFilterTree.js
@@ -147,8 +147,6 @@ define(["dojo/_base/declare", "dojo/dom-construct", "lib/CheckBoxTree"], functio
const dialog = new dijit.Dialog({
id: "filterEditDlg",
title: __("Edit Filter"),
- style: "width: 600px",
-
test: function () {
Filters.editFilterTest(dojo.formToObject("filter_edit_form"));
},
diff --git a/js/PrefHelpers.js b/js/PrefHelpers.js
index f9cb450e5..dd8fef5c6 100644
--- a/js/PrefHelpers.js
+++ b/js/PrefHelpers.js
@@ -1,6 +1,6 @@
'use strict';
-/* global __, dijit, dojo, Tables, xhrPost, Notify, xhrJson */
+/* global __, dijit, dojo, Tables, xhrPost, Notify, xhrJson, App */
const Helpers = {
AppPasswords: {
@@ -93,7 +93,6 @@ const Helpers = {
const dialog = new dijit.Dialog({
id: "profileEditDlg",
title: __("Settings Profiles"),
- style: "width: 600px",
getSelectedProfiles: function () {
return Tables.getSelected("pref-profiles-list");
},
@@ -119,22 +118,6 @@ const Helpers = {
alert(__("No profiles selected."));
}
},
- activateProfile: function () {
- const sel_rows = this.getSelectedProfiles();
-
- if (sel_rows.length == 1) {
- if (confirm(__("Activate selected profile?"))) {
- Notify.progress("Loading, please wait...");
-
- xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
- window.location.reload();
- });
- }
-
- } else {
- alert(__("Please choose a profile to activate."));
- }
- },
addProfile: function () {
if (this.validate()) {
Notify.progress("Creating profile...", true);
@@ -149,8 +132,19 @@ const Helpers = {
}
},
execute: function () {
- if (this.validate()) {
- //
+ const sel_rows = this.getSelectedProfiles();
+
+ if (sel_rows.length == 1) {
+ if (confirm(__("Activate selected profile?"))) {
+ Notify.progress("Loading, please wait...");
+
+ xhrPost("backend.php", {op: "rpc", method: "setprofile", id: sel_rows.toString()}, () => {
+ window.location.reload();
+ });
+ }
+
+ } else {
+ alert(__("Please choose a profile to activate."));
}
},
href: query
@@ -159,33 +153,58 @@ const Helpers = {
dialog.show();
},
customizeCSS: function() {
- const query = "backend.php?op=pref-prefs&method=customizeCSS";
+ xhrJson("backend.php", {op: "pref-prefs", method: "customizeCSS"}, (reply) => {
- if (dijit.byId("cssEditDlg"))
- dijit.byId("cssEditDlg").destroyRecursive();
+ const dialog = new dijit.Dialog({
+ title: __("Customize stylesheet"),
+ apply: function() {
+ xhrPost("backend.php", this.attr('value'), () => {
+ new Effect.Appear("css_edit_apply_msg");
+ $("user_css_style").innerText = this.attr('value');
+ });
+ },
+ execute: function () {
+ Notify.progress('Saving data...', true);
- const dialog = new dijit.Dialog({
- id: "cssEditDlg",
- title: __("Customize stylesheet"),
- style: "width: 600px",
- apply: function() {
- xhrPost("backend.php", this.attr('value'), () => {
- new Effect.Appear("css_edit_apply_msg");
- $("user_css_style").innerText = this.attr('value');
- });
- },
- execute: function () {
- Notify.progress('Saving data...', true);
+ xhrPost("backend.php", this.attr('value'), () => {
+ window.location.reload();
+ });
+ },
+ content: `
+ <div class='alert alert-info'>
+ ${__("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here.")}
+ </div>
+
+ ${App.FormFields.hidden('op', 'rpc')}
+ ${App.FormFields.hidden('method', 'setpref')}
+ ${App.FormFields.hidden('key', 'USER_STYLESHEET')}
+
+ <div id='css_edit_apply_msg' style='display : none'>
+ <div class='alert alert-warning'>
+ ${__("User CSS has been applied, you might need to reload the page to see all changes.")}
+ </div>
+ </div>
+
+ <textarea class='panel user-css-editor' dojoType='dijit.form.SimpleTextarea'
+ style='font-size : 12px;' name='value'>${reply.value}</textarea>
+
+ <footer>
+ <button dojoType='dijit.form.Button' class='alt-success' onclick="App.dialogOf(this).apply()">
+ ${__('Apply')}
+ </button>
+ <button dojoType='dijit.form.Button' class='alt-primary' type='submit'>
+ ${__('Save and reload')}
+ </button>
+ <button dojoType='dijit.form.Button' onclick="App.dialogOf(this).hide()">
+ ${__('Cancel')}
+ </button>
+ </footer>
+ `
+ });
- xhrPost("backend.php", this.attr('value'), () => {
- window.location.reload();
- });
+ dialog.show();
- },
- href: query
});
-
- dialog.show();
},
confirmReset: function() {
if (confirm(__("Reset to defaults?"))) {
@@ -220,41 +239,42 @@ const Helpers = {
} else {
Notify.progress("Importing, please wait...", true);
- Element.show("upload_iframe");
-
- return true;
- }
- },
- onImportComplete: function(iframe) {
- if (!iframe.contentDocument.body.innerHTML) return false;
-
- Element.show(iframe);
-
- Notify.close();
+ const xhr = new XMLHttpRequest();
- if (dijit.byId('opmlImportDlg'))
- dijit.byId('opmlImportDlg').destroyRecursive();
+ xhr.open( 'POST', 'backend.php', true );
+ xhr.onload = function () {
+ Notify.close();
- const content = iframe.contentDocument.body.innerHTML;
+ const dialog = new dijit.Dialog({
+ title: __("OPML Import"),
+ onCancel: function () {
+ window.location.reload();
+ },
+ execute: function () {
+ window.location.reload();
+ },
+ content: `
+ <div class='alert alert-info'>
+ ${__("If you have imported labels and/or filters, you might need to reload preferences to see your new data.")}
+ </div>
+ <div class='panel panel-scrollable'>
+ ${xhr.responseText}
+ </div>
+ <footer class='text-center'>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>
+ ${__('Close this window')}
+ </button>
+ </footer>
+ `
+ });
- const dialog = new dijit.Dialog({
- id: "opmlImportDlg",
- title: __("OPML Import"),
- style: "width: 600px",
- onCancel: function () {
- window.location.reload();
- },
- execute: function () {
- window.location.reload();
- },
- content: content
- });
+ dialog.show();
+ };
- dojo.connect(dialog, "onShow", function () {
- Element.hide(iframe);
- });
+ xhr.send(new FormData($("opml_import_form")));
- dialog.show();
+ return false;
+ }
},
export: function() {
console.log("export");
diff --git a/js/PrefUsers.js b/js/PrefUsers.js
index 2cebce6ef..a332a9140 100644
--- a/js/PrefUsers.js
+++ b/js/PrefUsers.js
@@ -36,7 +36,6 @@ const Users = {
const dialog = new dijit.Dialog({
id: "userEditDlg",
title: __("User Editor"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Notify.progress("Saving data...", true);
diff --git a/plugins/af_psql_trgm/init.js b/plugins/af_psql_trgm/init.js
index af337ca6b..a22e673f6 100644
--- a/plugins/af_psql_trgm/init.js
+++ b/plugins/af_psql_trgm/init.js
@@ -1,16 +1,13 @@
+/* global dijit, Plugins, __ */
+
Plugins.Psql_Trgm = {
showRelated: function (id) {
const query = "backend.php?op=pluginhandler&plugin=af_psql_trgm&method=showrelated&param=" + encodeURIComponent(id);
- if (dijit.byId("trgmRelatedDlg"))
- dijit.byId("trgmRelatedDlg").destroyRecursive();
-
- dialog = new dijit.Dialog({
- id: "trgmRelatedDlg",
+ const dialog = new dijit.Dialog({
title: __("Related articles"),
- style: "width: 600px",
execute: function () {
-
+ //
},
href: query,
});
diff --git a/plugins/af_psql_trgm/init.php b/plugins/af_psql_trgm/init.php
index faacf2da7..163b0ec38 100644
--- a/plugins/af_psql_trgm/init.php
+++ b/plugins/af_psql_trgm/init.php
@@ -108,9 +108,9 @@ class Af_Psql_Trgm extends Plugin {
}
- print "<footer class='text-center'>";
- print "<button dojoType='dijit.form.Button' onclick=\"dijit.byId('trgmRelatedDlg').hide()\">".__('Close this window')."</button>";
- print "</footer>";
+ print "<footer class='text-center'>
+ <button dojoType='dijit.form.Button' type='submit' class='alt-primary'>".__('Close this window')."</button>
+ </footer>";
}
diff --git a/plugins/mail/mail.js b/plugins/mail/mail.js
index eb7b7e6b6..89e395221 100644
--- a/plugins/mail/mail.js
+++ b/plugins/mail/mail.js
@@ -19,7 +19,6 @@ Plugins.Mail = {
const dialog = new dijit.Dialog({
id: "emailArticleDlg",
title: __("Forward article by email"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
xhrJson("backend.php", this.attr('value'), (reply) => {
diff --git a/plugins/mailto/init.js b/plugins/mailto/init.js
index f81f70fc7..6a1d2ef19 100644
--- a/plugins/mailto/init.js
+++ b/plugins/mailto/init.js
@@ -19,7 +19,6 @@ Plugins.Mailto = {
const dialog = new dijit.Dialog({
id: "emailArticleDlg",
title: __("Forward article by email"),
- style: "width: 600px",
href: query});
dialog.show();
diff --git a/plugins/note/note.js b/plugins/note/note.js
index 0c811000d..fec7b04be 100644
--- a/plugins/note/note.js
+++ b/plugins/note/note.js
@@ -8,7 +8,6 @@ Plugins.Note = {
const dialog = new dijit.Dialog({
id: "editNoteDlg",
title: __("Edit article note"),
- style: "width: 600px",
execute: function () {
if (this.validate()) {
Notify.progress("Saving article note...", true);
diff --git a/plugins/share/init.php b/plugins/share/init.php
index d0b3dfc0b..0794f5125 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -123,13 +123,13 @@ class Share extends Plugin {
print "<footer class='text-center'>";
- print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('shareArticleDlg').unshare()\">".
+ print "<button dojoType='dijit.form.Button' onclick=\"return App.dialogOf(this).unshare()\">".
__('Unshare article')."</button>";
- print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('shareArticleDlg').newurl()\">".
+ print "<button dojoType='dijit.form.Button' onclick=\"return App.dialogOf(this).newurl()\">".
__('Generate new URL')."</button>";
- print "<button dojoType='dijit.form.Button' onclick=\"return dijit.byId('shareArticleDlg').hide()\">".
+ print "<button dojoType='dijit.form.Button' type='submit' class='alt-primary'>".
__('Close this window')."</button>";
print "</footer>";
diff --git a/plugins/share/share.js b/plugins/share/share.js
index c49f64b4b..507f27f84 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -8,7 +8,6 @@ Plugins.Share = {
const dialog = new dijit.Dialog({
id: "shareArticleDlg",
title: __("Share article by URL"),
- style: "width: 600px",
newurl: function () {
if (confirm(__("Generate new share URL for this article?"))) {
diff --git a/prefs.php b/prefs.php
index 07e636a0a..671a81473 100644
--- a/prefs.php
+++ b/prefs.php
@@ -31,7 +31,7 @@
<title>Tiny Tiny RSS : <?php echo __("Preferences") ?></title>
<meta name="viewport" content="initial-scale=1,width=device-width" />
- <?php if ($_SESSION["uid"] && !isset($_REQUEST["ignore-theme"])) {
+ <?php if ($_SESSION["uid"] && empty($_SESSION["safe_mode"])) {
$theme = get_pref("USER_CSS_THEME", false, false);
if ($theme && theme_exists("$theme")) {
echo stylesheet_tag(get_theme_path($theme), 'theme_css');
diff --git a/themes/compact.css b/themes/compact.css
index c3c953b0e..080f82961 100644
--- a/themes/compact.css
+++ b/themes/compact.css
@@ -1794,6 +1794,9 @@ body.ttrss_utility.share_popup .content {
border-width: 1px;
color: #555;
}
+.flat .dijitDialog {
+ width: 600px;
+}
@font-face {
font-family: 'Material Icons';
font-style: normal;
diff --git a/themes/compact_night.css b/themes/compact_night.css
index 17d390895..be6a25a2e 100644
--- a/themes/compact_night.css
+++ b/themes/compact_night.css
@@ -1696,6 +1696,9 @@ body.ttrss_utility fieldset > label.checkbox {
border-width: 1px;
color: #ccc;
}
+.flat .dijitDialog {
+ width: 600px;
+}
@font-face {
font-family: 'Material Icons';
font-style: normal;
diff --git a/themes/light.css b/themes/light.css
index 7d34794e4..e16ff83dd 100644
--- a/themes/light.css
+++ b/themes/light.css
@@ -1794,6 +1794,9 @@ body.ttrss_utility.share_popup .content {
border-width: 1px;
color: #555;
}
+.flat .dijitDialog {
+ width: 600px;
+}
@font-face {
font-family: 'Material Icons';
font-style: normal;
diff --git a/themes/light/dijit_basic.less b/themes/light/dijit_basic.less
index d49d7316d..2854c77d0 100644
--- a/themes/light/dijit_basic.less
+++ b/themes/light/dijit_basic.less
@@ -167,4 +167,8 @@
}
}
+ .dijitDialog {
+ width : 600px;
+ }
+
}
diff --git a/themes/night.css b/themes/night.css
index 880cfe001..6090890e2 100644
--- a/themes/night.css
+++ b/themes/night.css
@@ -1697,6 +1697,9 @@ body.ttrss_utility fieldset > label.checkbox {
border-width: 1px;
color: #ccc;
}
+.flat .dijitDialog {
+ width: 600px;
+}
@font-face {
font-family: 'Material Icons';
font-style: normal;
diff --git a/themes/night_blue.css b/themes/night_blue.css
index 49c9b15c4..4bea2256f 100644
--- a/themes/night_blue.css
+++ b/themes/night_blue.css
@@ -1697,6 +1697,9 @@ body.ttrss_utility fieldset > label.checkbox {
border-width: 1px;
color: #ccc;
}
+.flat .dijitDialog {
+ width: 600px;
+}
@font-face {
font-family: 'Material Icons';
font-style: normal;