From f6d2787a8e139da6af412f87645402e0c193af01 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 10 Aug 2016 12:22:55 +0300 Subject: [PATCH] plugins: use require() to hook into dojo --- plugins/af_zz_noautoplay/init.js | 4 +--- plugins/no_title_counters/init.js | 10 ++++++---- plugins/no_url_hashes/init.js | 11 ++++++++--- plugins/shorten_expanded/init.js | 2 +- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/plugins/af_zz_noautoplay/init.js b/plugins/af_zz_noautoplay/init.js index 3cf3a381..45dfc55a 100644 --- a/plugins/af_zz_noautoplay/init.js +++ b/plugins/af_zz_noautoplay/init.js @@ -1,5 +1,5 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { - dojo.addOnLoad(function () { + ready(function () { PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) { if (row) { console.log("af_zz_noautoplay!"); @@ -37,7 +37,5 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { return true; }); - }); - }); \ No newline at end of file diff --git a/plugins/no_title_counters/init.js b/plugins/no_title_counters/init.js index 9c16856a..06edfb3b 100644 --- a/plugins/no_title_counters/init.js +++ b/plugins/no_title_counters/init.js @@ -1,5 +1,7 @@ -dojo.addOnLoad(function() { - updateTitle = function() { - document.title = "Tiny Tiny RSS"; - }; +require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { + ready(function () { + updateTitle = function () { + document.title = "Tiny Tiny RSS"; + }; + }); }); diff --git a/plugins/no_url_hashes/init.js b/plugins/no_url_hashes/init.js index a437a1f3..fc459672 100644 --- a/plugins/no_url_hashes/init.js +++ b/plugins/no_url_hashes/init.js @@ -1,4 +1,9 @@ -dojo.addOnLoad(function() { - hash_set = function() { }; - hash_get = function() { }; +require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { + ready(function () { + hash_set = function () { + }; + hash_get = function () { + }; + }); }); + diff --git a/plugins/shorten_expanded/init.js b/plugins/shorten_expanded/init.js index 899f8a54..ffec6271 100644 --- a/plugins/shorten_expanded/init.js +++ b/plugins/shorten_expanded/init.js @@ -24,7 +24,7 @@ function expandSizeWrapper(id) { require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { - dojo.addOnLoad(function() { + ready(function() { PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) { if (getInitParam('cdm_expanded')) { -- 2.39.5