diff options
author | Andrew Dolgov <[email protected]> | 2021-03-05 10:17:35 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-05 10:17:35 +0300 |
commit | b649d2240fed474f797e38cdf3111d764e6f15e2 (patch) | |
tree | ca0654a98454127cefd6c26c336387ddf67f5377 /plugins/af_zz_noautoplay/init.js | |
parent | c8883d344029baeb83f4285144e734414f7ae737 (diff) |
split af_zz_noautoplay into a separate repo
Diffstat (limited to 'plugins/af_zz_noautoplay/init.js')
-rw-r--r-- | plugins/af_zz_noautoplay/init.js | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/plugins/af_zz_noautoplay/init.js b/plugins/af_zz_noautoplay/init.js deleted file mode 100644 index 28e7ec787..000000000 --- a/plugins/af_zz_noautoplay/init.js +++ /dev/null @@ -1,41 +0,0 @@ -require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { - ready(function () { - PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) { - if (row) { - console.log("af_zz_noautoplay!"); - console.log(row); - - const videos = row.getElementsByTagName("video"); - console.log(row.innerHTML); - - for (i = 0; i < videos.length; i++) { - - videos[i].removeAttribute("autoplay"); - videos[i].pause(); - videos[i].onclick = function () { - this.paused ? this.play() : this.pause(); - } - } - } - - return true; - }); - - PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED, function (row) { - if (row) { - const videos = row.getElementsByTagName("video"); - - for (i = 0; i < videos.length; i++) { - videos[i].removeAttribute("autoplay"); - videos[i].pause(); - videos[i].onclick = function () { - this.paused ? this.play() : this.pause(); - } - } - - } - - return true; - }); - }); -}); |