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.