diff --git a/webedit/Editor.html b/webedit/Editor.html
index 49a2076..22fd97b 100644
--- a/webedit/Editor.html
+++ b/webedit/Editor.html
@@ -2,107 +2,29 @@
// 웹에디터 필드명
if($edit_name == "") $edit_name = "contents";
if($edit_width == "") $edit_width="100%";
-if($edit_height == "") $edit_height="400";
-if($edit_skin == "") $edit_skin="";
-if($edit_lang == "") $edit_lang="en-US";
+if($edit_height == "") $edit_height="300";
?>
-
-
-
=$edit_content?>
-
-
-
-}else{?>
-
-
-
+
+
+
+
-}?>
\ No newline at end of file
+var =$edit_name?> = new cheditor(); // 에디터 개체를 생성합니다.
+=$edit_name?>.config.editorHeight = '=$edit_height?>px'; // 에디터 세로폭입니다.
+=$edit_name?>.config.editorWidth = '=$edit_width?>'; // 에디터 가로폭입니다.
+=$edit_name?>.inputForm = '=$edit_name?>'; // textarea의 ID 이름입니다.
+=$edit_name?>.run(); // 에디터를 실행합니다.
+
\ No newline at end of file
diff --git a/webedit/cheditor.js b/webedit/cheditor.js
new file mode 100644
index 0000000..74785e4
--- /dev/null
+++ b/webedit/cheditor.js
@@ -0,0 +1,7815 @@
+// ================================================================
+// CHEditor 5.1.4
+// ----------------------------------------------------------------
+// Homepage: http://www.chcode.com
+// EMail: support@chcode.com
+// Copyright (c) 1997-2015 CHSOFT
+// ================================================================
+var GB = {
+ colors:["#000000","#313131","#434343","#535353","#666666","#999999","#a0a0a0","#b5b5b5","#c0c0c0","#dcdcdc","#eeeeee","#ffffff",
+ "#ff0000","#ff8000","#ffff00","#80ff00","#00ff00","#00ff99","#00ffff","#0080ff","#0000ff","#7f00ff","#ff00ff","#ff007f",
+ "#ffcccc","#ffe5cc","#ffffcc","#e5ffcc","#ccffcc","#ccffe5","#ccffff","#cce5ff","#ccccff","#e5ccff","#ffccff","#ffcce5",
+ "#ff9999","#ffcc99","#ffff99","#ccff99","#99ff99","#99ffcc","#99ffff","#99ccff","#9999ff","#cc99ff","#ff99ff","#ff99cc",
+ "#ff6666","#ffb266","#ffff66","#b2ff66","#66ff66","#66ffb2","#66ffff","#66b2ff","#6666ff","#b266ff","#ff66ff","#ff66b2",
+ "#ff3333","#ff9933","#ffff33","#99ff33","#33ff33","#33ff99","#33ffff","#3399ff","#3333ff","#9933ff","#ff33ff","#ff3399",
+ "#cc0000","#cc6600","#cccc00","#66cc00","#00cc00","#00cc66","#00cccc","#0066cc","#0000cc","#6600cc","#cc00cc","#cc0066",
+ "#990000","#994c00","#999900","#4c9900","#009900","#00994c","#009999","#004c99","#000099","#4c0099","#990099","#99004c",
+ "#660000","#663300","#666600","#336600","#006600","#006633","#006666","#003366","#000066","#330066","#660066","#660033"],
+ offElements : {
+ img:1, hr:1, table:1, embed:1, object:1, input:1, form:1, select:1, textarea:1, button:1, fieldset:1
+ },
+ emptyElements : {
+ area:1, base:1, basefont:1, col:1, frame:1, hr:1, img:1, br:1, input:1, isindex:1, link:1, meta:1,
+ param:1, source:1, track:1, wbr:1, keygen:1, menuitem:1
+ },
+ textFormatting : {
+ addr:1, acronym:1, b:1, bdo:1, big:1, cite:1, code:1, del:1, dfn:1, em:1, font:1, i:1, ins:1, kbd:1, q:1,
+ samp:1, small:1, span:1, strike:1, strong:1, sub:1, sup:1, tt:1, u:1, 'var':1
+ },
+ newLineBefore : '|div|p|blockquote|table|tbody|tr|td|th|title|head|body|script|comment|li|meta|h1|h2|h3|h4|h5|h6|hr|ul|ol|link|',
+ lineHeightBlock : '|address|blockquote|dd|div|dl|h1|h2|h3|h4|h5|h6|li|p|pre|td|th|code|section|aside|article|figcaption|',
+ doctype : '',
+ popupWindow : {
+ ImageUpload : {tmpl : 'image.html', width : 700, posv: 420, title : '내 PC 사진 넣기'},
+ ImageUrl : {tmpl : 'image_url.html', width : 350, posv: 380, title : '웹 사진 넣기'},
+ Embed : {tmpl : 'media.html', width : 430, posv: 380, title : '미디어'},
+ Table : {tmpl : 'table.html', width : 430, posv: 390, title : '표 만들기'},
+ ModifyTable : {tmpl : 'table_modify.html', width : 430, posv: 390, title : '표 고치기'},
+ Layout : {tmpl : 'layout.html', width : 430, posv: 420, title : '레이아웃'},
+ Link : {tmpl : 'link.html', width : 350, posv: 200, title : '하이퍼링크'},
+ EmotionIcon : {tmpl : 'icon.html', width : 300, posv: 200, title : '표정 아이콘'},
+ Symbol : {tmpl : 'symbol.html', width : 450, posv: 300, title : '특수 문자'},
+ GoogleMap : {tmpl : 'google_map.html', width : 538, posv: 450, title : '구글 지도'},
+ ColorPicker : {tmpl : 'color_picker.html', width : 420, posv: 200, title : '색상 선택'},
+ FlashMovie : {tmpl : 'flash.html', width : 584, posv: 474, title : '플래쉬 동영상'}
+ },
+ fontName : {
+ 'kr' : ['맑은 고딕', '돋움', '굴림', '바탕', '궁서'],
+ 'en' : ['Arial', 'Comic Sans MS', 'Courier New', 'Georgia', 'Lucida Sans Unicode', 'Tahoma', 'Times New Roman', 'Verdana']
+ },
+ fontStyle : {
+ 'FontSize':'font-size', 'FontName':'font-family', 'ForeColor':'color', 'BackColor':'background-color'
+ },
+ textAlign : {
+ 'JustifyLeft':'', 'JustifyCenter':'center','JustifyRight':'right','JustifyFull':'justify'
+ },
+ listStyle : {
+ 'ordered' : {
+ 'decimal':'숫자', 'lower-alpha':'영문 소문자', 'upper-alpha':'영문 대문자', 'lower-roman':'로마 소문자', 'upper-roman':'로마 대문자'
+ },
+ 'unOrdered' : {'desc':'동그라미', 'circle':'빈 원', 'square':'사각형'}
+ },
+ fontSize : {
+ 'pt' : [7, 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36],
+ 'px' : [9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72]
+ },
+ formatBlock : {
+ 'P' : 'Normal (P)',
+ 'H1' : 'Heading 1',
+ 'H2' : 'Heading 2',
+ 'H3' : 'Heading 3',
+ 'H4' : 'Heading 4',
+ 'H5' : 'Heading 5',
+ 'H6' : 'Heading 6',
+ 'ADDRESS' : 'Address',
+ 'DIV' : 'DIV',
+ 'PRE' : 'Preformatted (PRE)'
+ },
+ lineHeight : {
+ '한 줄 간격': 1, '1.15': 1.15, '1.5': 1.5, '1.7': 1.7, '1.8': 1.8, '두 줄 간격': 2
+ },
+ textBlock : [
+ ['1px #dedfdf solid','#f7f7f7'],
+ ['1px #aee8e8 solid','#bfffff'],
+ ['1px #d3bceb solid','#e6ccff'],
+ ['1px #e8e88b solid','#ffff99'],
+ ['1px #c3e89e solid','#d6ffad'],
+ ['1px #e8c8b7 solid','#ffdcc9'],
+ ['1px #666666 dashed','#ffffff'],
+ ['1px #d4d4d4 solid','#ffffff'],
+ ['1px #cccccc inset','#f7f7f7']
+ ],
+ node : {
+ element: 1, attribute: 2, text: 3, cdata_section: 4, entity_reference: 5, entity: 6,
+ processing_instruction: 7, comment: 8, document: 9, document_type: 10, document_fragment: 11,
+ notation: 12
+ },
+
+ selection : { none: 1, text: 2, element: 3 },
+ readyState : { 0: 'uninitialized', 1: 'loading', 2: 'loaded', 3: 'interactive', 4: 'complete' },
+
+ prettify : null,
+ dragWindow : null,
+ readyEditor: 0,
+ browser : {}
+};
+
+function isUndefined (obj) {
+ return obj === void(0); // obj === undefined;
+}
+
+function detechBrowser () {
+ function detect(ua) {
+ function getFirstMatch(regex) {
+ var match = ua.match(regex);
+ return (match && match.length > 1 && match[1]) || '';
+ }
+ var iosdevice = getFirstMatch(/(ipod|iphone|ipad)/i).toLowerCase()
+ ,likeAndroid = /like android/i.test(ua)
+ ,android = !likeAndroid && /android/i.test(ua)
+ ,versionIdentifier = getFirstMatch(/version\/(\d+(\.\d+)?)/i)
+ ,tablet = /tablet/i.test(ua)
+ ,mobile = !tablet && /[^\-]mobi/i.test(ua)
+ ,result;
+
+ if (/opera|opr/i.test(ua)) {
+ result = {
+ name: 'Opera', opera: true ,
+ version: versionIdentifier || getFirstMatch(/(?:opera|opr)[\s\/](\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/windows phone/i.test(ua)) {
+ result = {
+ name: 'Windows Phone', windowsphone: true, msie: true,
+ version: getFirstMatch(/iemobile\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/msie|trident/i.test(ua)) {
+ result = {
+ name: 'Internet Explorer', msie: true, version: getFirstMatch(/(?:msie |rv:)(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/edge/i.test(ua)) {
+ result = {
+ name: 'edge', edge: true, version: getFirstMatch(/(?:edge)\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/chrome|crios|crmo/i.test(ua)) {
+ result = {
+ name: 'Chrome', chrome: true, version: getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (iosdevice) {
+ result = {
+ name: iosdevice === 'iphone' ? 'iPhone' : iosdevice === 'ipad' ? 'iPad' : 'iPod'
+ };
+ if (versionIdentifier) { result.version = versionIdentifier; }
+ }
+ else if (/firefox|iceweasel/i.test(ua)) {
+ result = {
+ name: 'Firefox', firefox: true,
+ version: getFirstMatch(/(?:firefox|iceweasel)[ \/](\d+(\.\d+)?)/i)
+ };
+ if (/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(ua)) { result.firefoxos = true; }
+ }
+ else if (/silk/i.test(ua)) {
+ result = {
+ name: 'Amazon Silk', silk: true, version : getFirstMatch(/silk\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (android) {
+ result = { name: 'Android', version: versionIdentifier };
+ }
+ else if (/phantom/i.test(ua)) {
+ result = {
+ name: 'PhantomJS', phantom: true, version: getFirstMatch(/phantomjs\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/blackberry|\bbb\d+/i.test(ua) || /rim\stablet/i.test(ua)) {
+ result = {
+ name: 'BlackBerry', blackberry: true,
+ version: versionIdentifier || getFirstMatch(/blackberry[\d]+\/(\d+(\.\d+)?)/i)
+ };
+ }
+ else if (/(web|hpw)os/i.test(ua)) {
+ result = {
+ name: 'WebOS' , webos: true ,
+ version: versionIdentifier || getFirstMatch(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)
+ };
+ if (/touchpad\//i.test(ua)) { result.touchpad = true; }
+ }
+ else if (/safari/i.test(ua)) {
+ result = {
+ name: 'Safari', safari: true, version: versionIdentifier
+ };
+ }
+ else {
+ result = {};
+ }
+
+ if (/(apple)?webkit/i.test(ua)) {
+ result.name = result.name || "Webkit";
+ result.webkit = true;
+ if (!result.version && versionIdentifier) { result.version = versionIdentifier; }
+ }
+ else if (!result.opera && /gecko\//i.test(ua)) {
+ result.gecko = true;
+ result.version = result.version || getFirstMatch(/gecko\/(\d+(\.\d+)?)/i);
+ result.name = result.name || "Gecko";
+ }
+ if (android || result.silk) { result.android = true; }
+ else if (iosdevice) {
+ result[iosdevice] = true;
+ result.ios = true;
+ }
+
+ var osVersion = '';
+ if (iosdevice) {
+ osVersion = getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i);
+ osVersion = osVersion.replace(/[_\s]/g, '.');
+ }
+ else if (android) { osVersion = getFirstMatch(/android[ \/\-](\d+(\.\d+)*)/i); }
+ else if (result.windowsphone) { osVersion = getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i); }
+ else if (result.webos) { osVersion = getFirstMatch(/(?:web|hpw)os\/(\d+(\.\d+)*)/i); }
+ else if (result.blackberry) { osVersion = getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i); }
+
+ if (osVersion) { result.osversion = osVersion; }
+
+ var osMajorVersion = osVersion.split('.')[0];
+ if (tablet || iosdevice === 'ipad' ||
+ (android && (osMajorVersion === 3 || (osMajorVersion === 4 && !mobile))) ||
+ result.silk)
+ {
+ result.tablet = true;
+ }
+ else if (mobile || iosdevice === 'iphone' || iosdevice === 'ipod' || android ||
+ result.blackberry || result.webos)
+ {
+ result.mobile = true;
+ }
+
+ if ((result.msie && result.version >= 10) ||
+ (result.chrome && result.version >= 20) ||
+ (result.firefox && result.version >= 20.0) ||
+ (result.safari && result.version >= 6) ||
+ (result.opera && result.version >= 10.0) ||
+ (result.ios && result.osversion && result.osversion.split(".")[0] >= 6) ||
+ (result.blackberry && result.version >= 10.1))
+ {
+ result.a = true;
+ }
+ else if ((result.msie && result.version < 10) ||
+ (result.chrome && result.version < 20) ||
+ (result.firefox && result.version < 20.0) ||
+ (result.safari && result.version < 6) ||
+ (result.opera && result.version < 10.0) ||
+ (result.ios && result.osversion && result.osversion.split(".")[0] < 6))
+ {
+ result.c = true;
+ }
+ else {
+ result.x = true;
+ }
+
+ if (result.msie) {
+ if (result.version > 10) {
+ result.msie_a = true;
+ }
+ else if (result.version > 8) {
+ result.msie_b = true;
+ }
+ else {
+ result.msie_c = true;
+ }
+ }
+ return result;
+ }
+ return detect(!isUndefined(navigator) ? navigator.userAgent : null);
+}
+
+function URI (uri) {
+ this.scheme = null;
+ this.authority = null;
+ this.path = '';
+ this.query = null;
+ this.fragment = null;
+
+ this.parseUri = function (uri) {
+ var m = uri.match(/^(([A-Za-z][0-9A-Za-z+.\-]*)(:))?((\/\/)([^\/?#]*))?([^?#]*)((\?)([^#]*))?((#)(.*))?/);
+ this.scheme = m[3] ? m[2] : null;
+ this.authority = m[5] ? m[6] : null;
+ this.path = m[7];
+ this.query = m[9] ? m[10] : null;
+ this.fragment = m[12]? m[13] : null;
+ return this;
+ };
+
+ this.azToString = function () {
+ var result = '';
+ if (this.scheme !== null) { result = result + this.scheme + ':'; }
+ if (this.authority !== null) { result = result +'//'+ this.authority; }
+ if (this.path !== null) { result = result + this.path; }
+ if (this.query !== null) { result = result + '?'+ this.query; }
+ if (this.fragment !== null) { result = result + '#'+ this.fragment; }
+ return result;
+ };
+
+ this.toAbsolute = function (location) {
+ var baseUri = new URI(location);
+ var URIAbs = this;
+ var target = new URI();
+
+ function removeDotSegments (path) {
+ var result = '', rm;
+ while (path) {
+ if (path.substr(0,3) === '../' || path.substr(0,2) === './') {
+ path = path.replace(/^\.+/,'').substr(1);
+ }
+ else if (path.substr(0,3) === '/./' || path === '/.') {
+ path = '/'+path.substr(3);
+ }
+ else if (path.substr(0,4) === '/../' || path === '/..') {
+ path = '/'+path.substr(4);
+ result = result.replace(/\/?[^\/]*$/, '');
+ }
+ else if (path === '.' || path === '..') {
+ path = '';
+ }
+ else {
+ rm = path.match(/^\/?[^\/]*/)[0];
+ path = path.substr(rm.length);
+ result = result + rm;
+ }
+ }
+ return result;
+ }
+
+ if (baseUri.scheme === null) { return false; }
+ if (URIAbs.scheme !== null && URIAbs.scheme.toLowerCase() === baseUri.scheme.toLowerCase()) {
+ URIAbs.scheme = null;
+ }
+
+ if (URIAbs.scheme !== null) {
+ target.scheme = URIAbs.scheme;
+ target.authority = URIAbs.authority;
+ target.path = removeDotSegments(URIAbs.path);
+ target.query = URIAbs.query;
+ }
+ else {
+ if (URIAbs.authority !== null) {
+ target.authority = URIAbs.authority;
+ target.path = removeDotSegments(URIAbs.path);
+ target.query = URIAbs.query;
+ }
+ else {
+ if (URIAbs.path === '') {
+ target.path = baseUri.path;
+ target.query = URIAbs.query || baseUri.query;
+ }
+ else {
+ if (URIAbs.path.substr(0,1) === '/') {
+ target.path = removeDotSegments(URIAbs.path);
+ }
+ else {
+ if (baseUri.authority !== null && baseUri.path === '') {
+ target.path = '/' + URIAbs.path;
+ }
+ else {
+ target.path = baseUri.path.replace(/[^\/]+$/,'') + URIAbs.path;
+ }
+ target.path = removeDotSegments(target.path);
+ }
+ target.query = URIAbs.query;
+ }
+ target.authority = baseUri.authority;
+ }
+ target.scheme = baseUri.scheme;
+ }
+ target.fragment = URIAbs.fragment;
+ return target;
+ };
+ if (uri) {
+ this.parseUri(uri);
+ }
+}
+
+function setConfig () {
+ var config = {
+ editorWidth : '100%',
+ editorHeight : '300px',
+ editorFontSize : '12px',
+ editorFontName : '맑은 고딕, 굴림, Malgun Gothic, gulim',
+ editorFontColor : '#000',
+ editorBgColor : '#fff',
+ imgCaptionText : 'margin: 5px 0px; color: #333',
+ lineHeight : 1.6,
+ editAreaMargin : '5px 10px',
+ tabIndex : 0,
+ editorPath : null,
+ fullHTMLSource : false,
+ linkTarget : '_blank',
+ showTagPath : false,
+ colorToHex : true,
+ imgMaxWidth : 1180,
+ imgUploadNumber : 12,
+ imgUploadSortName : false,
+ imgSetAttrWidth : 1, // -1 = (width=100%, height=auto), 0 = 설정 안함, 1 = 원래대로
+ imgSetAttrAlt : true,
+ makeThumbnail : false,
+ imgDefaultAlign : "left", // [left, center, right]
+ thumbnailWidth : 120,
+ thumbnailHeight : 90,
+ imgBlockMargin : '5px 0px',
+ includeHostname : true,
+ paragraphCss : false, // true = , false =
+ xhtmlLang : 'utf-8',
+ xhtmlEncoding : 'utf-8',
+ docTitle : '내 문서',
+ template : 'template.xml',
+ fontSizeValue : 'px', // [pt, px]
+
+ // 버튼 사용 유무
+ useSource : true,
+ usePreview : true,
+ usePrint : true,
+ useNewDocument : true,
+ useUndo : true,
+ useRedo : true,
+ useCopy : true,
+ useCut : true,
+ usePaste : true,
+ usePasteFromWord: true,
+ useSelectAll : true,
+ useStrikethrough: true,
+ useUnderline : true,
+ useItalic : true,
+ useSuperscript : false,
+ useSubscript : false,
+ useJustifyLeft : true,
+ useJustifyCenter: true,
+ useJustifyRight : true,
+ useJustifyFull : true,
+ useBold : true,
+ useOrderedList : true,
+ useUnOrderedList: true,
+ useOutdent : true,
+ useIndent : true,
+ useFontName : true,
+ useFormatBlock : true,
+ useFontSize : true,
+ useLineHeight : true,
+ useBackColor : true,
+ useForeColor : true,
+ useRemoveFormat : true,
+ useClearTag : true,
+ useSymbol : true,
+ useLink : true,
+ useUnLink : true,
+ useFlash : true,
+ useMedia : false,
+ useImage : true,
+ useImageUrl : false,
+ useSmileyIcon : true,
+ useHR : true,
+ useTable : true,
+ useModifyTable : true,
+ useMap : true,
+ useTextBlock : true,
+ useFullScreen : true,
+ usePageBreak : false,
+ allowedScript : true,
+ allowedOnEvent : false
+ };
+
+ if (config.editorPath === null) {
+ var base = location.href, editorUri, locationAbs;
+ var e = document.getElementsByTagName('base'), i;
+ for (i=0; i'+this.config.docTitle+''+
+ '';
+
+ if (typeof contents === 'string') {
+ html += this.trimSpace(contents);
+ }
+
+ html += '