1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 08:25:55 +00:00

dojo: main UI: load stuff asynchronously

This commit is contained in:
Andrew Dolgov
2016-08-10 10:01:05 +03:00
parent 25a533c432
commit ee5170424e
4 changed files with 239 additions and 214 deletions

View File

@@ -1,40 +1,43 @@
dojo.addOnLoad(function() {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) {
if (row) {
console.log("af_zz_noautoplay!");
console.log(row);
require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
dojo.addOnLoad(function () {
PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function (row) {
if (row) {
console.log("af_zz_noautoplay!");
console.log(row);
var videos = row.getElementsByTagName("video");
console.log(row.innerHTML);
var videos = row.getElementsByTagName("video");
console.log(row.innerHTML);
for (i = 0; i < videos.length; i++) {
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) {
var 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();
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) {
var 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;
});
return true;
});
});