sql injection 보안패치 및 스마트에디터2 추가
This commit is contained in:
134
plugin/editor/smarteditor2/js/HuskyEZCreator.js
Normal file
134
plugin/editor/smarteditor2/js/HuskyEZCreator.js
Normal file
@ -0,0 +1,134 @@
|
||||
if(typeof window.nhn=='undefined') window.nhn = {};
|
||||
if (!nhn.husky) nhn.husky = {};
|
||||
|
||||
/**
|
||||
* @fileOverview This file contains application creation helper function, which would load up an HTML(Skin) file and then execute a specified create function.
|
||||
* @name HuskyEZCreator.js
|
||||
*/
|
||||
nhn.husky.EZCreator = new (function(){
|
||||
this.nBlockerCount = 0;
|
||||
|
||||
this.createInIFrame = function(htOptions){
|
||||
if(arguments.length == 1){
|
||||
var oAppRef = htOptions.oAppRef;
|
||||
var elPlaceHolder = htOptions.elPlaceHolder;
|
||||
var sSkinURI = htOptions.sSkinURI;
|
||||
var fCreator = htOptions.fCreator;
|
||||
var fOnAppLoad = htOptions.fOnAppLoad;
|
||||
var bUseBlocker = htOptions.bUseBlocker;
|
||||
var htParams = htOptions.htParams || null;
|
||||
}else{
|
||||
// for backward compatibility only
|
||||
var oAppRef = arguments[0];
|
||||
var elPlaceHolder = arguments[1];
|
||||
var sSkinURI = arguments[2];
|
||||
var fCreator = arguments[3];
|
||||
var fOnAppLoad = arguments[4];
|
||||
var bUseBlocker = arguments[5];
|
||||
var htParams = arguments[6];
|
||||
}
|
||||
|
||||
if(bUseBlocker) nhn.husky.EZCreator.showBlocker();
|
||||
|
||||
var attachEvent = function(elNode, sEvent, fHandler){
|
||||
if(elNode.addEventListener){
|
||||
elNode.addEventListener(sEvent, fHandler, false);
|
||||
}else{
|
||||
elNode.attachEvent("on"+sEvent, fHandler);
|
||||
}
|
||||
}
|
||||
|
||||
if(!elPlaceHolder){
|
||||
alert("Placeholder is required!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(typeof(elPlaceHolder) != "object")
|
||||
elPlaceHolder = document.getElementById(elPlaceHolder);
|
||||
|
||||
var elIFrame, nEditorWidth, nEditorHeight;
|
||||
|
||||
|
||||
try{
|
||||
elIFrame = document.createElement("<IFRAME frameborder=0 scrolling=no>");
|
||||
}catch(e){
|
||||
elIFrame = document.createElement("IFRAME");
|
||||
elIFrame.setAttribute("frameborder", "0");
|
||||
elIFrame.setAttribute("scrolling", "no");
|
||||
}
|
||||
|
||||
elIFrame.style.width = "1px";
|
||||
elIFrame.style.height = "1px";
|
||||
elPlaceHolder.parentNode.insertBefore(elIFrame, elPlaceHolder.nextSibling);
|
||||
|
||||
attachEvent(elIFrame, "load", function(){
|
||||
fCreator = elIFrame.contentWindow[fCreator] || elIFrame.contentWindow.createSEditor2;
|
||||
|
||||
// top.document.title = ((new Date())-window.STime);
|
||||
// window.STime = new Date();
|
||||
|
||||
try{
|
||||
|
||||
nEditorWidth = elIFrame.contentWindow.document.body.scrollWidth || "500px";
|
||||
nEditorHeight = elIFrame.contentWindow.document.body.scrollHeight + 12;
|
||||
elIFrame.style.width = "100%";
|
||||
elIFrame.style.height = nEditorHeight+ "px";
|
||||
elIFrame.contentWindow.document.body.style.margin = "0";
|
||||
}catch(e){
|
||||
nhn.husky.EZCreator.hideBlocker(true);
|
||||
elIFrame.style.border = "5px solid red";
|
||||
elIFrame.style.width = "500px";
|
||||
elIFrame.style.height = "500px";
|
||||
alert("Failed to access "+sSkinURI);
|
||||
return;
|
||||
}
|
||||
|
||||
var oApp = fCreator(elPlaceHolder, htParams); // oEditor
|
||||
|
||||
|
||||
oApp.elPlaceHolder = elPlaceHolder;
|
||||
|
||||
oAppRef[oAppRef.length] = oApp;
|
||||
if(!oAppRef.getById) oAppRef.getById = {};
|
||||
|
||||
if(elPlaceHolder.id) oAppRef.getById[elPlaceHolder.id] = oApp;
|
||||
|
||||
oApp.run({fnOnAppReady:fOnAppLoad});
|
||||
|
||||
// top.document.title += ", "+((new Date())-window.STime);
|
||||
nhn.husky.EZCreator.hideBlocker();
|
||||
});
|
||||
// window.STime = new Date();
|
||||
elIFrame.src = sSkinURI;
|
||||
this.elIFrame = elIFrame;
|
||||
};
|
||||
|
||||
this.showBlocker = function(){
|
||||
if(this.nBlockerCount<1){
|
||||
var elBlocker = document.createElement("DIV");
|
||||
elBlocker.style.position = "absolute";
|
||||
elBlocker.style.top = 0;
|
||||
elBlocker.style.left = 0;
|
||||
elBlocker.style.backgroundColor = "#FFFFFF";
|
||||
elBlocker.style.width = "100%";
|
||||
|
||||
document.body.appendChild(elBlocker);
|
||||
|
||||
nhn.husky.EZCreator.elBlocker = elBlocker;
|
||||
}
|
||||
|
||||
nhn.husky.EZCreator.elBlocker.style.height = Math.max(document.body.scrollHeight, document.body.clientHeight)+"px";
|
||||
|
||||
this.nBlockerCount++;
|
||||
};
|
||||
|
||||
this.hideBlocker = function(bForce){
|
||||
if(!bForce){
|
||||
if(--this.nBlockerCount > 0) return;
|
||||
}
|
||||
|
||||
this.nBlockerCount = 0;
|
||||
|
||||
if(nhn.husky.EZCreator.elBlocker) nhn.husky.EZCreator.elBlocker.style.display = "none";
|
||||
}
|
||||
})();
|
||||
52
plugin/editor/smarteditor2/js/SE2B_Configuration_General.js
Normal file
52
plugin/editor/smarteditor2/js/SE2B_Configuration_General.js
Normal file
@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Smart Editor 2 Configuration : This setting must be changed by service
|
||||
*/
|
||||
window.nhn = window.nhn || {};
|
||||
nhn.husky = nhn.husky || {};
|
||||
nhn.husky.SE2M_Configuration = nhn.husky.SE2M_Configuration || {};
|
||||
|
||||
nhn.husky.SE2M_Configuration.Quote = {
|
||||
sImageBaseURL : 'http://static.se2.naver.com/static/img'
|
||||
};
|
||||
|
||||
nhn.husky.SE2M_Configuration.CustomObject = {
|
||||
sVersion : 1,
|
||||
sClassName : '__se_object',
|
||||
sValueName : 'jsonvalue',
|
||||
sTagIdPrefix : 'se_object_',
|
||||
sTailComment : '<!--__se_object_end -->',
|
||||
sBlankTemplateURL : nhn.husky.SE2M_Configuration.LinkageDomain.sCommonStatic + '/static/db_attach/iframe_template_for_se1_obj.html',
|
||||
sAttributeOfEmpty : 's_isempty="true"',
|
||||
sAttributeOfOldDB : 's_olddb="true"',
|
||||
sBlock : '<div class="_block" style="position:absolute;z-index:10000;background-color:#fff;"></div>',
|
||||
sBlockTemplate : '<div[\\s\\S]*?class=[\'"]?_block[\'"]?[\\s\\S]*?</div>',
|
||||
sHighlight : '<div class="_highlight" style="position:absolute;width:58px;height:16px;line-height:0;z-index:9999"><img src="' + nhn.husky.SE2M_Configuration.LinkageDomain.sCommonStatic + '/static/img/pencil2.png" alt="" width="58" height="16" style="vertical-align:top"></div>',
|
||||
sHighlightTemplate : '<div[\\s\\S]*?class=[\'"]?_highlight[\'"]?[\\s\\S]*?</div>',
|
||||
sHtmlTemplateStartTag : '<!-- se_object_template_start -->',
|
||||
sHtmlTemplateEndTag : '<!-- se_object_template_end -->',
|
||||
sHtmlFilterTag : '{=sType}_{=sSubType}_{=nSeq}',
|
||||
sTplHtmlFilterTag : '<!--{=sType}_{=sSubType}_(\\d+)-->',
|
||||
sImgComServerPath : nhn.husky.SE2M_Configuration.LinkageDomain.sCommonStatic + '/static/img/reviewitem',
|
||||
nMaxWidth : 548
|
||||
};
|
||||
|
||||
nhn.husky.SE2M_Configuration.SE2M_ReEditAction = {
|
||||
bUsed : true,
|
||||
nSecDisplayDulationReEditMsg : 3,
|
||||
aReEditGuideMsg : [
|
||||
'이미지 파일은 1회 클릭 시 크기 조절, 더블클릭 시 재편집이 가능합니다.',
|
||||
'첨부한 파일을 더블클릭 시 재편집이 가능합니다.',
|
||||
'첨부한 글양식 테이블을 드래그시 테이블 재편집이 가능합니다.',
|
||||
'첨부한 표를 드래그 시 표 재편집이 가능합니다.'
|
||||
]
|
||||
};
|
||||
|
||||
nhn.husky.SE2M_Configuration.SE2M_ColorPalette = {
|
||||
bUseRecentColor : false
|
||||
};
|
||||
|
||||
nhn.husky.SE2M_Configuration.QuickEditor = {
|
||||
common : {
|
||||
bUseConfig : false
|
||||
}
|
||||
};
|
||||
71
plugin/editor/smarteditor2/js/SE2B_Configuration_Service.js
Normal file
71
plugin/editor/smarteditor2/js/SE2B_Configuration_Service.js
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Smart Editor 2 Configuration : This setting must be changed by service
|
||||
*/
|
||||
window.nhn = window.nhn || {};
|
||||
nhn.husky = nhn.husky || {};
|
||||
nhn.husky.SE2M_Configuration = nhn.husky.SE2M_Configuration || {};
|
||||
|
||||
/**
|
||||
* 스마트에디터2에서 접근하는 JS, IMG 디렉토리
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.Editor = {
|
||||
sJsBaseURL : './js_src',
|
||||
sImageBaseURL : './img/'
|
||||
};
|
||||
|
||||
/**
|
||||
* JS LazyLoad를 위한 경로
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.LazyLoad = {
|
||||
sJsBaseURI : "js_lazyload"
|
||||
};
|
||||
|
||||
/**
|
||||
* CSS LazyLoad를 위한 경로
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.SE2B_CSSLoader = {
|
||||
sCSSBaseURI : "css"
|
||||
};
|
||||
|
||||
/**
|
||||
* 편집영역 설정
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.SE_EditingAreaManager = {
|
||||
sCSSBaseURI : "css",
|
||||
sBlankPageURL : "smart_editor2_inputarea.html",
|
||||
sBlankPageURL_EmulateIE7 : "smart_editor2_inputarea_ie8.html",
|
||||
aAddtionalEmulateIE7 : [] // IE8 default 사용, IE9 ~ 선택적 사용
|
||||
};
|
||||
|
||||
/**
|
||||
* 스마트에디터2에서 사용하는 도메인 정보
|
||||
* http://wiki.nhncorp.com/pages/viewpage.action?pageId=74253685
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.LinkageDomain = {
|
||||
sCommonAPI : 'http://api.se2.naver.com',
|
||||
sCommonStatic : 'http://static.se2.naver.com',
|
||||
sCommonImage : 'http://images.se2.naver.com'
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* [웹접근성]
|
||||
* 단축키 ALT+, ALT+. 을 이용하여 스마트에디터 영역의 이전/이후 요소로 이동할 수 있다.
|
||||
* sBeforeElementId : 스마트에디터 영역 이전 요소의 id
|
||||
* sNextElementId : 스마트에디터 영역 이후 요소의 id
|
||||
*
|
||||
* 스마트에디터 영역 이외의 제목 영역 (예:스마트에디터가 적용된 블로그 쓰기 페이지에서의 제목 영역) 에 해당하는 엘리먼트에서 Tab키를 누르면 에디팅 영역으로 포커스를 이동시킬 수 있다.
|
||||
* sTitleElementId : 제목에 해당하는 input 요소의 id.
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.SE2M_Accessibility = {
|
||||
sBeforeElementId : '',
|
||||
sNextElementId : '',
|
||||
sTitleElementId : ''
|
||||
};
|
||||
|
||||
/**
|
||||
* 링크 기능 옵션
|
||||
*/
|
||||
nhn.husky.SE2M_Configuration.SE2M_Hyperlink = {
|
||||
bAutolink : true // 자동링크기능 사용여부(기본값:true)
|
||||
};
|
||||
91
plugin/editor/smarteditor2/js/SE2BasicCreator.js
Normal file
91
plugin/editor/smarteditor2/js/SE2BasicCreator.js
Normal file
@ -0,0 +1,91 @@
|
||||
function createSEditor2(elIRField, htParams, elSeAppContainer){
|
||||
if(!window.$Jindo){
|
||||
parent.document.body.innerHTML="진도 프레임웍이 필요합니다.<br>\n<a href='http://dev.naver.com/projects/jindo/download'>http://dev.naver.com/projects/jindo/download</a>에서 Jindo 1.5.3 버전의 jindo.min.js를 다운로드 받아 /js 폴더에 복사 해 주세요.\n(아직 Jindo 2 는 지원하지 않습니다.)";
|
||||
return;
|
||||
}
|
||||
|
||||
var elAppContainer = (elSeAppContainer || jindo.$("smart_editor2"));
|
||||
var elEditingArea = jindo.$$.getSingle("DIV.husky_seditor_editing_area_container", elAppContainer);
|
||||
var oWYSIWYGIFrame = jindo.$$.getSingle("IFRAME.se2_input_wysiwyg", elEditingArea);
|
||||
var oIRTextarea = elIRField?elIRField:jindo.$$.getSingle("TEXTAREA.blind", elEditingArea);
|
||||
var oHTMLSrc = jindo.$$.getSingle("TEXTAREA.se2_input_htmlsrc", elEditingArea);
|
||||
var oTextArea = jindo.$$.getSingle("TEXTAREA.se2_input_text", elEditingArea);
|
||||
var sEditorMode = "open";
|
||||
|
||||
if(!htParams){
|
||||
htParams = {};
|
||||
htParams.fOnBeforeUnload = null;
|
||||
}
|
||||
htParams.elAppContainer = elAppContainer; // 에디터 UI 최상위 element 셋팅
|
||||
htParams.oNavigator = jindo.$Agent().navigator(); // navigator 객체 셋팅
|
||||
|
||||
var oEditor = new nhn.husky.HuskyCore(htParams);
|
||||
oEditor.registerPlugin(new nhn.husky.CorePlugin(htParams?htParams.fOnAppLoad:null));
|
||||
oEditor.registerPlugin(new nhn.husky.StringConverterManager());
|
||||
|
||||
var htDimension = {
|
||||
nMinHeight:320,
|
||||
nMinWidth:parseInt(elIRField.style.minWidth, 10)||570,
|
||||
nHeight:elIRField.style.height||elIRField.offsetHeight,
|
||||
nWidth:elIRField.style.width||elIRField.offsetWidth
|
||||
};
|
||||
|
||||
var htConversionMode = {
|
||||
bUseVerticalResizer : htParams.bUseVerticalResizer,
|
||||
bUseModeChanger : htParams.bUseModeChanger
|
||||
};
|
||||
|
||||
var aAdditionalFontList = htParams.aAdditionalFontList;
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaManager("WYSIWYG", oIRTextarea, htDimension, htParams.fOnBeforeUnload, elAppContainer));
|
||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_WYSIWYG(oWYSIWYGIFrame)); // Tab Editor 모드
|
||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_HTMLSrc(oHTMLSrc)); // Tab HTML 모드
|
||||
oEditor.registerPlugin(new nhn.husky.SE_EditingArea_TEXT(oTextArea)); // Tab Text 모드
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_EditingModeChanger(elAppContainer, htConversionMode)); // 모드간 변경(Editor, HTML, Text)
|
||||
oEditor.registerPlugin(new nhn.husky.SE_PasteHandler()); // WYSIWYG Paste Handler
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.HuskyRangeManager(oWYSIWYGIFrame));
|
||||
oEditor.registerPlugin(new nhn.husky.Utils());
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_UtilPlugin());
|
||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyler());
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_Toolbar(elAppContainer));
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.Hotkey()); // 단축키
|
||||
oEditor.registerPlugin(new nhn.husky.SE_EditingAreaVerticalResizer(elAppContainer, htConversionMode)); // 편집영역 리사이즈
|
||||
oEditor.registerPlugin(new nhn.husky.DialogLayerManager());
|
||||
oEditor.registerPlugin(new nhn.husky.ActiveLayerManager());
|
||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGStyleGetter()); // 커서 위치 스타일 정보 가져오기
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE2B_Customize_ToolBar(elAppContainer)); // 상단 툴바 (Basic)
|
||||
oEditor.registerPlugin(new nhn.husky.SE_WYSIWYGEnterKey("P")); // 엔터 시 처리, 현재는 P로 처리
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_ColorPalette(elAppContainer)); // 색상 팔레트
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontColor(elAppContainer)); // 글자색
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_BGColor(elAppContainer)); // 글자배경색
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontNameWithLayerUI(elAppContainer, aAdditionalFontList)); // 글꼴종류
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_FontSizeWithLayerUI(elAppContainer)); // 글꼴크기
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_LineStyler());
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_ExecCommand(oWYSIWYGIFrame));
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_LineHeightWithLayerUI(elAppContainer)); // 줄간격
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_Quote(elAppContainer)); // 인용구
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_Hyperlink(elAppContainer)); // 링크
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_SCharacter(elAppContainer)); // 특수문자
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_FindReplacePlugin(elAppContainer)); // 찾기/바꾸기
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableCreator(elAppContainer)); // 테이블 생성
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableEditor(elAppContainer)); // 테이블 편집
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_TableBlockStyler(elAppContainer)); // 테이블 스타일
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_AttachQuickPhoto(elAppContainer)); // 사진
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.MessageManager(oMessageMap));
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_QuickEditor_Common(elAppContainer)); // 퀵에디터 공통(표, 이미지)
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE2B_CSSLoader()); // CSS lazy load
|
||||
oEditor.registerPlugin(new nhn.husky.SE_OuterIFrameControl(elAppContainer, 100));
|
||||
|
||||
oEditor.registerPlugin(new nhn.husky.SE_ToolbarToggler(elAppContainer, htParams.bUseToolbar));
|
||||
oEditor.registerPlugin(new nhn.husky.SE2M_Accessibility(elAppContainer)); // 에디터내의 웹접근성 관련 기능모음 플러그인
|
||||
|
||||
return oEditor;
|
||||
}
|
||||
1
plugin/editor/smarteditor2/js/jindo.min.js
vendored
Normal file
1
plugin/editor/smarteditor2/js/jindo.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
plugin/editor/smarteditor2/js/jindo_component.js
Normal file
1
plugin/editor/smarteditor2/js/jindo_component.js
Normal file
File diff suppressed because one or more lines are too long
21291
plugin/editor/smarteditor2/js/smarteditor2.js
Normal file
21291
plugin/editor/smarteditor2/js/smarteditor2.js
Normal file
File diff suppressed because it is too large
Load Diff
1
plugin/editor/smarteditor2/js/smarteditor2.min.js
vendored
Normal file
1
plugin/editor/smarteditor2/js/smarteditor2.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user