PageSourceSearch

https://korean.go.kr/EDotXPressHtml/js/edotxpress-common.js?t=20240703

js korean.go.kr collected 2026-09-24 08:38:35 UTC 5,155 bytes, 99 lines download raw bytes

1    /**
2     * Copyright(c) 2020. ATSoft Co., Ltd. All sources are freely reusable.
3     *
4     * @brief   웹페이지에서 eDotXPressHtml Client API 호출하는 공통함수 구현
5     * @detail  
6     * @version 2024-01-26 v2.0.8.0
7     */
8     
9    //**********************************************************************
10    // BEGIN 점자 생성 함수
11    //**********************************************************************
12    // edotServerURL은 서블릿이 설치된 WAS 또는 WAS와 연결된 Web 서버 호스트와 동일해야 한다.(대부분 direct로 WAS와 연결하지 않고 Web서버를 이용함) 
13    // edotViewerURL은 Client JS 라이브러리가 설치된 호스트와 동일해야 한다.
14    var edotServerURL = document.location.protocol + "//" + document.location.host + "/EDotXPressHtml/brlgen.do";
15    var edotViewerURL = document.location.protocol + "//" + document.location.host + "/EDotXPressHtml/viewer/braille_viewer.html"; 
16    
17    /**
18     * @brief   현재 페이지나 특정 element에서부터 점자속성이 부여된 element를 찾아 점역하고 점자파일로 내려받는다.
19     * @details 
20     * @param   fileType    내려받을 점자파일 종류 선택
21     *                      btag   : 점역 검수용 접근성 태그파일
22     *                      brl/brf: 점자파일
23     *                      xls    : 엑셀파일(현재 페이지 전체는 xls로 받을 수 없고 하나의 표만 xls로 받을 수 있다.)
24     * @param   fileTitle   확장자를 제외한 저장할 점자파일 제목
25     * @param   startNode   점역할 시작 element 객체나 element id, null이거나 생략하면 현재 페이지의 document.body부터 시작한다.(주로 표만 점역할 경우)
26     * @param   brlConf     점자속성 설정 객체
27     */       
28    function exportBrl(fileType, fileTitle, startNode, brlConf)
29    {
30        if (!atsoft.util.misc.isEmpty(brlConf))  
31            eDotConfig.applyBrlConf(window, brlConf, true);
32
33        var docData = atsoft.edotxpress.HtmlParser.parseHtml(startNode);
34        if (docData != null)
35        {
36            var invoker = new atsoft.edotxpress.EDotServerInvoker(edotServerURL);
37            invoker.addParameter("tag_record",  docData  );
38            invoker.addParameter("export_type", fileType ); // btag, brl, brf, xls
39            invoker.addParameter("export_name", fileTitle); // 확장자를 제외한 저장할 파일명
40    
41            invoker.invoke(); // cf. invoker.invoke(errorCallback);
42        }
43        else
44            alert(atsoft.errorManager.getErrorMsg("[brl 파일 생성 실패]"));
45    }
46    /* 오류 발생시 상세 메시지 대신 간단한 메시지를 출력할 경우
47    function errorCallback(errMgr)
48    {
49        var msg = errMgr.getErrorMsg("[brl 파일 생성 실패(app 재정의된 오류 메시지)]"); // cf. errMgr.getErrorCode()   
50        alert(msg);
51    }
52    */
53
54
55    /**
56     * @brief   현재 페이지나 특정 element에서부터 점자속성이 부여된 element를 찾아 점역하고 점자뷰어로 보여준다.
57     * @details 현재 페이지와 점자뷰어 도메인이 서로 달라도 CORS 오류가 발생하지 않는다.
58     * @param   fileTitle   확장자를 제외한 저장할 점자파일 제목
59     * @param   startNode   점역할 시작 element 객체나 element id, null이거나 생략하면 현재 페이지의 document.body부터 시작한다.(주로 표만 점역할 경우)
60     * @param   brlConf     점자속성 설정 객체
61     */ 
62	var popupWnd = null;
63	var popupParam = {};
64    function openBrlViewer(fileTitle, startNode, brlConf)
65    {
66        if (!atsoft.util.misc.isEmpty(brlConf))  
67            eDotConfig.applyBrlConf(window, brlConf, true);
68
69        if (popupWnd != null)
70            popupWnd.close();
71                        
72        var docData = atsoft.edotxpress.HtmlParser.parseHtml(startNode);
73        if (docData != null)
74        {
75            popupParam.svrUrl    = edotServerURL;            
76            popupParam.docData   = docData;
77            popupParam.fileTitle = fileTitle;
78            popupParam.enableXls = (typeof startNode === 'object' && startNode.tagName == "TABLE") ? "true" : "false";
79            // [순서2] 팝업창 실행
80            popupWnd = atsoft.util.window.popup(edotViewerURL, "eDotXPress Viewer", 900, 600, "resizable=yes, scrollbars=yes");            
81        }
82        else
83            alert(atsoft.errorManager.getErrorMsg("[brl 파일 생성 실패]"));
84    }
85    
86    // [순서5] 팝업창으로부터 요청 메시지를 받으면 데이터 전달
87    function receiveMessage(event)
88    {
89        if (event.data.cmd === "edot-request-data")
90        {
91            popupParam.cmd = "edot-response-data";
92            if (popupWnd != null)
93                popupWnd.postMessage(popupParam, "*");
94        }
95    }    
96    
97    // [순서1] 팝업창으로부터 받을 이벤트 등록
98    window.addEventListener("message", receiveMessage, false);       
99    // END 점자 생성 함수

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.