PageSourceSearch

https://e-nrp.org/js/article_modal.js

js e-nrp.org collected 2026-10-03 23:52:18 UTC 1,377 bytes, 35 lines download raw bytes

1// ga 위치 찾기
2let divList = document.querySelectorAll('.article-abstract')
3
4for (var i = 0; divList.length; i++ ) {
5	var titleText = divList[i].innerText;
6
7	// title이 Graphical Abstract이면 작업 시작
8	if (titleText.search('Graphical Abstract') >= 0) {
9		let GAImg = divList[i];
10
11		// id 추가
12		GAImg.querySelector('img').setAttribute("class", "myImg");
13		// GAImg.querySelector('img').setAttribute("onclick", "changeDisplay(this)")
14		let imgSrc = GAImg.querySelector('img').getAttribute('src')
15
16		// GA 내용 추가
17		const modal = document.createElement("div");
18		modal.setAttribute("id", "myGAModal")
19		modal.setAttribute("class", "articleModal")
20		// modal.setAttribute("style", "display: none;")
21
22		modal.innerHTML = '<span id="close-btn">&times;</span><a id="download-btn" download href="'+ imgSrc +'"><button class="btn btn-primary">Download JPG</button></a><div class="modal-contents"><img class="modalGA" src="'+ imgSrc +'"></div>'
23
24		GAImg.insertBefore(modal, GAImg.children[0]);
25
26		// ga 다운로드 버튼
27		const gaButton = document.createElement("div");
28		gaButton.setAttribute("class", "text-end pe-2")
29		gaButton.innerHTML = '<a id="download-btn p-0" download href="'+ imgSrc +'"><button class="btn btn-primary">Download JPG</button></a>'
30
31		GAImg.insertAdjacentElement("afterend", gaButton);
32		break;
33	}
34};
35

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.