add PluginHost.HOOK_INIT_COMPLETE (and make no_title_counters use it)

master
Andrew Dolgov 6 years ago
parent f3737c0b24
commit a400a8ffc1

@ -11,6 +11,7 @@ PluginHost = {
HOOK_PARAMS_LOADED: 8, HOOK_PARAMS_LOADED: 8,
HOOK_RUNTIME_INFO_LOADED: 9, HOOK_RUNTIME_INFO_LOADED: 9,
HOOK_FLOATING_TITLE: 10, HOOK_FLOATING_TITLE: 10,
HOOK_INIT_COMPLETE: 11,
hooks: [], hooks: [],
register: function (name, callback) { register: function (name, callback) {
if (typeof(this.hooks[name]) == 'undefined') if (typeof(this.hooks[name]) == 'undefined')

@ -117,8 +117,6 @@ require(["dojo/_base/kernel",
} }
}); });
Cookie.delete("ttrss_test");
const toolbar = document.forms["toolbar-main"]; const toolbar = document.forms["toolbar-main"];
dijit.getEnclosingWidget(toolbar.view_mode).attr('value', dijit.getEnclosingWidget(toolbar.view_mode).attr('value',
@ -147,6 +145,9 @@ require(["dojo/_base/kernel",
} }
console.log("second stage ok"); console.log("second stage ok");
PluginHost.run(PluginHost.HOOK_INIT_COMPLETE, null);
}, },
updateTitle: function() { updateTitle: function() {
let tmp = "Tiny Tiny RSS"; let tmp = "Tiny Tiny RSS";

@ -1,7 +1,9 @@
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
ready(function () { ready(function () {
App.updateTitle = function () { PluginHost.register(PluginHost.HOOK_INIT_COMPLETE, () => {
document.title = "Tiny Tiny RSS"; App.updateTitle = function () {
}; document.title = "Tiny Tiny RSS";
};
});
}); });
}); });

Loading…
Cancel
Save