|
|
@@ -194,6 +194,30 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ function setupArticleImages() {
|
|
|
+ var images = Array.prototype.slice.call(document.querySelectorAll(".article-body img, .gjjx-detail-body img"));
|
|
|
+ images.forEach(function (img) {
|
|
|
+ if (!img || img.getAttribute("data-article-image-ready") === "true") return;
|
|
|
+
|
|
|
+ var source = img.getAttribute("data-original")
|
|
|
+ || img.getAttribute("data-src")
|
|
|
+ || img.getAttribute("data-lazy-src")
|
|
|
+ || img.getAttribute("src")
|
|
|
+ || "";
|
|
|
+ source = normalizePortalUploadUrl(source);
|
|
|
+ if (!source) return;
|
|
|
+
|
|
|
+ img.setAttribute("src", source);
|
|
|
+ img.setAttribute("data-article-image-ready", "true");
|
|
|
+ img.setAttribute("decoding", "async");
|
|
|
+ img.removeAttribute("data-original");
|
|
|
+ img.removeAttribute("data-src");
|
|
|
+ img.removeAttribute("data-lazy-src");
|
|
|
+ img.classList.remove("lazyload", "lazyloading");
|
|
|
+ img.classList.add("lazyloaded");
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function setupArticleBodyVideos() {
|
|
|
var videos = Array.prototype.slice.call(document.querySelectorAll(".article-body video"));
|
|
|
if (!videos.length) return;
|
|
|
@@ -1173,6 +1197,7 @@
|
|
|
setupDrawer();
|
|
|
setupSearch();
|
|
|
setupEmptyArticleNotice();
|
|
|
+ setupArticleImages();
|
|
|
setupArticleBodyVideos();
|
|
|
setupScreenHeaderScroll();
|
|
|
setupDepartmentNavStickyState();
|