|
|
| (같은 사용자의 중간 판 7개는 보이지 않습니다) |
| 1번째 줄: |
1번째 줄: |
| | <onlyinclude> | | <onlyinclude> |
| | {{#tag:html| | | {{#tag:html| |
| − | <div id="semantic-graph-container">
| + | <iframe width="100%" height="640px" style="border:0" src="https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key|}}}"></iframe> |
| − | <iframe id="semantic-graph-iframe" width="100%" height="640px" style="border:0" src="https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key|}}}"></iframe> | |
| | <br/> | | <br/> |
| − | <input type="button" value="전체화면" onclick="location.href='https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key}}}'"> | + | <input type="button" value="전체화면" onclick="location.href='https://app.vaquitalab.com/aistory/story01?server=tcp:encyves.aks.ac.kr&db=gwangju2025&project=gwangju&key={{{key}}}'"> |
| − | </div>
| |
| − | <script>
| |
| − | (function() {
| |
| − | var iframe = document.getElementById('semantic-graph-iframe');
| |
| − | var container = document.getElementById('semantic-graph-container');
| |
| − |
| |
| − | iframe.addEventListener('load', function() {
| |
| − | try {
| |
| − | // iframe 내용 접근 시도 (same-origin인 경우)
| |
| − | var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
| |
| − |
| |
| − | // 404 또는 에러 페이지 체크
| |
| − | if (iframeDoc.title.includes('404') ||
| |
| − | iframeDoc.body.innerHTML.includes('404') ||
| |
| − | iframeDoc.body.innerHTML.length < 100) {
| |
| − | hideGraphSection();
| |
| − | }
| |
| − | } catch(e) {
| |
| − | // Cross-origin인 경우 접근 불가, fetch로 체크
| |
| − | fetch(iframe.src, {method: 'HEAD'})
| |
| − | .then(function(response) {
| |
| − | if (!response.ok || response.status === 404) {
| |
| − | hideGraphSection();
| |
| − | }
| |
| − | })
| |
| − | .catch(function() {
| |
| − | hideGraphSection();
| |
| − | });
| |
| − | }
| |
| − | });
| |
| − |
| |
| − | // 에러 발생 시에도 숨김
| |
| − | iframe.addEventListener('error', function() {
| |
| − | hideGraphSection();
| |
| − | });
| |
| − |
| |
| − | function hideGraphSection() {
| |
| − | // iframe이 포함된 p 태그 찾기
| |
| − | var pTag = container.closest('p');
| |
| − | if (pTag) {
| |
| − | pTag.style.display = 'none';
| |
| − |
| |
| − | // 이전 형제 요소 중 h2 찾기
| |
| − | var prevElement = pTag.previousElementSibling;
| |
| − | while (prevElement) {
| |
| − | if (prevElement.tagName === 'H2') {
| |
| − | prevElement.style.display = 'none';
| |
| − | break;
| |
| − | }
| |
| − | prevElement = prevElement.previousElementSibling;
| |
| − | }
| |
| − | }
| |
| − | }
| |
| − | })();
| |
| − | </script>
| |
| | }} | | }} |
| | </onlyinclude> | | </onlyinclude> |