]> git.wh0rd.org Git - tt-rss.git/commitdiff
Add JS PluginHost.HOOK_PARAMS_LOADED and PluginHost.HOOK_RUNTIME_INFO_LOADED to notif...
authorsupahgreg <greg.parris@gmail.com>
Sat, 27 Apr 2013 16:01:54 +0000 (11:01 -0500)
committersupahgreg <greg.parris@gmail.com>
Sat, 27 Apr 2013 16:10:21 +0000 (11:10 -0500)
js/PluginHost.js
js/functions.js
js/tt-rss.js

index de4c57b60bd80bfff0bee5c41671f086e713c489..668d215f996d66adb659f29da28d6aa87efa19c1 100644 (file)
@@ -8,6 +8,8 @@ var PluginHost = {
        HOOK_FEED_LOADED: 5,
        HOOK_ARTICLE_EXPANDED: 6,
        HOOK_ARTICLE_COLLAPSED: 7,
+       HOOK_PARAMS_LOADED: 8,
+       HOOK_RUNTIME_INFO_LOADED: 9,
        hooks: [],
        register: function (name, callback) {
                if (typeof(this.hooks[name]) == 'undefined')
index 87c52b709678da7f0ca4b006169767f7e25aaf8e..8691c1ee5d29b8a75c4303aff90df9c89b40c77e 100644 (file)
@@ -1277,6 +1277,9 @@ function backend_sanity_check_callback(transport) {
                        }
 
                        init_params = params;
+
+                       // PluginHost might not be available on non-index pages
+                       window.PluginHost && PluginHost.run(PluginHost.HOOK_PARAMS_LOADED, init_params);
                }
 
                sanity_check_done = true;
index a7518959c577de99672ac1e8141b987d442ffdc1..2a741ab2dc1ac4374fe1bba92fefd9712e71837b 100644 (file)
@@ -753,6 +753,8 @@ function parse_runtime_info(data) {
                init_params[k] = v;
                notify('');
        }
+
+       PluginHost.run(PluginHost.HOOK_RUNTIME_INFO_LOADED, data);
 }
 
 function collapse_feedlist() {
@@ -992,7 +994,7 @@ function handle_rpc_json(transport, scheduled_call) {
                        if (counters)
                                parse_counters(counters, scheduled_call);
 
-                       var runtime_info = reply['runtime-info'];;
+                       var runtime_info = reply['runtime-info'];
 
                        if (runtime_info)
                                parse_runtime_info(runtime_info);