prefs: Prefs global -> Helpers

This commit is contained in:
Andrew Dolgov 2018-12-03 12:46:00 +03:00
parent b3bc638a9f
commit 4d4034091a
6 changed files with 21 additions and 22 deletions

View File

@ -49,7 +49,7 @@ class Dlg extends Handler_Protected {
print "<div align='center'>"; print "<div align='center'>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Prefs.OPML.changeKey()\">". print "<button dojoType=\"dijit.form.Button\" onclick=\"return Helpers.OPML.changeKey()\">".
__('Generate new URL')."</button> "; __('Generate new URL')."</button> ";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return CommonDialogs.closeInfoBox()\">". print "<button dojoType=\"dijit.form.Button\" onclick=\"return CommonDialogs.closeInfoBox()\">".

View File

@ -1274,7 +1274,7 @@ class Pref_Feeds extends Handler_Protected {
__("Only main settings profile can be migrated using OPML.")); __("Only main settings profile can be migrated using OPML."));
print "<iframe id=\"upload_iframe\" print "<iframe id=\"upload_iframe\"
name=\"upload_iframe\" onload=\"Prefs.OPML.onImportComplete(this)\" name=\"upload_iframe\" onload=\"Helpers.OPML.onImportComplete(this)\"
style=\"width: 400px; height: 100px; display: none;\"></iframe>"; style=\"width: 400px; height: 100px; display: none;\"></iframe>";
print "<form name=\"opml_form\" style='display : block' target=\"upload_iframe\" print "<form name=\"opml_form\" style='display : block' target=\"upload_iframe\"
@ -1285,7 +1285,7 @@ class Pref_Feeds extends Handler_Protected {
</label> </label>
<input type=\"hidden\" name=\"op\" value=\"dlg\"> <input type=\"hidden\" name=\"op\" value=\"dlg\">
<input type=\"hidden\" name=\"method\" value=\"importOpml\"> <input type=\"hidden\" name=\"method\" value=\"importOpml\">
<button dojoType=\"dijit.form.Button\" onclick=\"return Prefs.OPML.import();\" type=\"submit\">" . <button dojoType=\"dijit.form.Button\" onclick=\"return Helpers.OPML.import();\" type=\"submit\">" .
__('Import OPML') . "</button>"; __('Import OPML') . "</button>";
print "</form>"; print "</form>";
@ -1295,7 +1295,7 @@ class Pref_Feeds extends Handler_Protected {
print "<form dojoType=\"dijit.form.Form\" id=\"opmlExportForm\">"; print "<form dojoType=\"dijit.form.Form\" id=\"opmlExportForm\">";
print "<button dojoType=\"dijit.form.Button\" print "<button dojoType=\"dijit.form.Button\"
onclick=\"Prefs.OPML.export()\" >" . onclick=\"Helpers.OPML.export()\" >" .
__('Export OPML') . "</button>"; __('Export OPML') . "</button>";
print "<label>"; print "<label>";
@ -1331,7 +1331,7 @@ class Pref_Feeds extends Handler_Protected {
print "<button dojoType=\"dijit.form.Button\" onclick=\"return App.displayDlg('".__("Show as feed")."','generatedFeed', '$rss_url')\">". print "<button dojoType=\"dijit.form.Button\" onclick=\"return App.displayDlg('".__("Show as feed")."','generatedFeed', '$rss_url')\">".
__('Display URL')."</button> "; __('Display URL')."</button> ";
print "<button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick=\"return Prefs.clearFeedAccessKeys()\">". print "<button class=\"btn-danger\" dojoType=\"dijit.form.Button\" onclick=\"return Helpers.clearFeedAccessKeys()\">".
__('Clear all generated URLs')."</button> "; __('Clear all generated URLs')."</button> ";
print "</p>"; print "</p>";

View File

@ -542,7 +542,7 @@ class Pref_Prefs extends Handler_Protected {
} else if ($pref_name == "USER_STYLESHEET") { } else if ($pref_name == "USER_STYLESHEET") {
print "<button dojoType=\"dijit.form.Button\" print "<button dojoType=\"dijit.form.Button\"
onclick=\"Prefs.customizeCSS()\">" . __('Customize') . "</button>"; onclick=\"Helpers.customizeCSS()\">" . __('Customize') . "</button>";
} else if ($pref_name == "USER_CSS_THEME") { } else if ($pref_name == "USER_CSS_THEME") {
@ -659,10 +659,10 @@ class Pref_Prefs extends Handler_Protected {
</div> </div>
</div>"; </div>";
print "<button dojoType=\"dijit.form.Button\" onclick=\"return Prefs.editProfiles()\">". print "<button dojoType=\"dijit.form.Button\" onclick=\"return Helpers.editProfiles()\">".
__('Manage profiles')."</button> "; __('Manage profiles')."</button> ";
print "<button dojoType=\"dijit.form.Button\" class=\"btn-danger\" onclick=\"return Prefs.confirmReset()\">". print "<button dojoType=\"dijit.form.Button\" class=\"btn-danger\" onclick=\"return Helpers.confirmReset()\">".
__('Reset to defaults')."</button>"; __('Reset to defaults')."</button>";
print "&nbsp;"; print "&nbsp;";
@ -756,7 +756,7 @@ class Pref_Prefs extends Handler_Protected {
if (count($tmppluginhost->get_all($plugin)) > 0) { if (count($tmppluginhost->get_all($plugin)) > 0) {
if (in_array($name, $system_enabled)) { if (in_array($name, $system_enabled)) {
print "<td><a href='#' onclick=\"Prefs.clearPluginData('$name')\" print "<td><a href='#' onclick=\"Helpers.clearPluginData('$name')\"
class='visibleLink'>".__("Clear data")."</a></td>"; class='visibleLink'>".__("Clear data")."</a></td>";
} }
} }
@ -816,7 +816,7 @@ class Pref_Prefs extends Handler_Protected {
if (count($tmppluginhost->get_all($plugin)) > 0) { if (count($tmppluginhost->get_all($plugin)) > 0) {
if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) { if (in_array($name, $system_enabled) || in_array($name, $user_enabled)) {
print "<td><a href='#' onclick=\"Prefs.clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>"; print "<td><a href='#' onclick=\"Helpers.clearPluginData('$name')\" class='visibleLink'>".__("Clear data")."</a></td>";
} }
} }

View File

@ -37,10 +37,10 @@ class Pref_System extends Handler_Protected {
LIMIT 100"); LIMIT 100");
print "<button dojoType=\"dijit.form.Button\" print "<button dojoType=\"dijit.form.Button\"
onclick=\"Prefs.updateEventLog()\">".__('Refresh')."</button> "; onclick=\"Helpers.updateEventLog()\">".__('Refresh')."</button> ";
print "&nbsp;<button dojoType=\"dijit.form.Button\" print "&nbsp;<button dojoType=\"dijit.form.Button\"
class=\"btn-danger\" onclick=\"Prefs.clearEventLog()\">".__('Clear')."</button> "; class=\"btn-danger\" onclick=\"Helpers.clearEventLog()\">".__('Clear')."</button> ";
print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">"; print "<p><table width=\"100%\" cellspacing=\"10\" class=\"prefErrorLog\">";

View File

@ -1,5 +1,5 @@
define(["dojo/_base/declare"], function (declare) { define(["dojo/_base/declare"], function (declare) {
Prefs = { Helpers = {
clearFeedAccessKeys: function() { clearFeedAccessKeys: function() {
if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) { if (confirm(__("This will invalidate all previously generated feed URLs. Continue?"))) {
Notify.progress("Clearing URLs..."); Notify.progress("Clearing URLs...");
@ -56,7 +56,7 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
Notify.close(); Notify.close();
Prefs.editProfiles(); Helpers.editProfiles();
}); });
} }
@ -88,7 +88,7 @@ define(["dojo/_base/declare"], function (declare) {
xhrPost("backend.php", query, () => { xhrPost("backend.php", query, () => {
Notify.close(); Notify.close();
Prefs.editProfiles(); Helpers.editProfiles();
}); });
} }
@ -128,7 +128,7 @@ define(["dojo/_base/declare"], function (declare) {
confirmReset: function() { confirmReset: function() {
if (confirm(__("Reset to defaults?"))) { if (confirm(__("Reset to defaults?"))) {
xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => { xhrPost("backend.php", {op: "pref-prefs", method: "resetconfig"}, (transport) => {
Prefs.refresh(); Helpers.refresh();
Notify.info(transport.responseText); Notify.info(transport.responseText);
}); });
} }
@ -138,7 +138,7 @@ define(["dojo/_base/declare"], function (declare) {
Notify.progress("Loading, please wait..."); Notify.progress("Loading, please wait...");
xhrPost("backend.php", {op: "pref-prefs", method: "clearplugindata", name: name}, () => { xhrPost("backend.php", {op: "pref-prefs", method: "clearplugindata", name: name}, () => {
Prefs.refresh(); Helpers.refresh();
}); });
} }
}, },
@ -150,7 +150,7 @@ define(["dojo/_base/declare"], function (declare) {
} }
}; };
Prefs.OPML = { Helpers.OPML = {
import: function() { import: function() {
const opml_file = $("opml_file"); const opml_file = $("opml_file");
@ -225,8 +225,7 @@ define(["dojo/_base/declare"], function (declare) {
} }
return false; return false;
}, },
};
}; return Helpers;
return Prefs;
}); });

View File

@ -5,7 +5,7 @@ let App;
let CommonDialogs; let CommonDialogs;
let Filters; let Filters;
let Users; let Users;
let Prefs; let Helpers;
const Plugins = {}; const Plugins = {};