Skip to content

Commit

Permalink
cheditor 5.1.9.4 버전 업데이트
Browse files Browse the repository at this point in the history
  • Loading branch information
kitrio committed Jan 11, 2023
1 parent 7516424 commit d99641d
Show file tree
Hide file tree
Showing 12 changed files with 335 additions and 187 deletions.
5 changes: 3 additions & 2 deletions plugin/editor/cheditor5/cheditor.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// ================================================================
// CHEditor 5.1.9.3-p4
// CHEditor 5.1.9.4
// ----------------------------------------------------------------
// Homepage: http://www.chcode.com
// EMail: support@chcode.com
// Copyright (c) 1997-2020 CHSOFT
// Copyright (c) 1997-2021 CHSOFT
// ================================================================
var GB = {
colors: ['#000000','#313131','#434343','#535353','#666666','#999999','#a0a0a0','#b5b5b5','#c0c0c0','#dcdcdc','#eeeeee','#ffffff',
Expand Down Expand Up @@ -568,6 +568,7 @@ function setConfig() {
this.cheditor.tabSpaces = '';
this.cheditor.modifyState = false;
this.cheditor.tabSpaces = new Array(this.config.tabIndent + 1).join(' ');
// this.URI = URI;
}

function cheditor() {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions plugin/editor/cheditor5/imageUpload/config.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
include_once("_common.php");

define("CHE_UPLOAD_IMG_CHECK", 1); // 이미지 파일을 썸네일 할수 있는지 여부를 체크합니다. ( 해당 파일이 이미지 파일인지 체크합니다. 1이면 사용, 0이면 사용 안함 )
define("CHE_UPLOAD_IMG_CHECK", 1); // 이미지 파일을 썸네일 할수 있는지 여부를 체크합니다. ( 해당 파일이 이미지 파일인지 체크합니다. 1이면 사용, 0이면 사용 안함 )

// ---------------------------------------------------------------------------

# 이미지가 저장될 디렉토리의 전체 경로를 설정합니다.
# 끝에 슬래쉬(/)는 붙이지 않습니다.
# 주의: 이 경로의 접근 권한은 쓰기, 읽기가 가능하도록 설정해 주십시오.
# 이미지가 저장될 디렉토리의 전체 경로를 설정합니다.
# 끝에 슬래쉬(/)는 붙이지 않습니다.
# 주의: 이 경로의 접근 권한은 쓰기, 읽기가 가능하도록 설정해 주십시오.

# data/editor 디렉토리가 없는 경우가 있을수 있으므로 디렉토리를 생성하는 코드를 추가함. kagla 140305
# data/editor 디렉토리가 없는 경우가 있을수 있으므로 디렉토리를 생성하는 코드를 추가함. kagla 140305

@mkdir(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
@chmod(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
Expand All @@ -24,8 +24,8 @@
@mkdir(SAVE_DIR, G5_DIR_PERMISSION);
@chmod(SAVE_DIR, G5_DIR_PERMISSION);

# 위에서 설정한 'SAVE_DIR'의 URL을 설정합니다.
# 끝에 슬래쉬(/)는 붙이지 않습니다.
# 위에서 설정한 'SAVE_DIR'의 URL을 설정합니다.
# 끝에 슬래쉬(/)는 붙이지 않습니다.

define("SAVE_URL", $data_url);

Expand Down
4 changes: 2 additions & 2 deletions plugin/editor/cheditor5/imageUpload/upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ function che_reprocessImage($file_path, $callback){
exit;
}

// 저장 파일 이름: 년월일시분초_렌덤문자8자
// 저장 파일 이름: 년월일시분초_렌덤문자8자
// 20140327125959_abcdefghi.jpg
// 원본 파일 이름: $_POST["origname"]
// 원본 파일 이름: $_POST["origname"]

$filename = che_replace_filename($filename);
$savefile = SAVE_DIR . '/' . $filename;
Expand Down
12 changes: 6 additions & 6 deletions plugin/editor/cheditor5/popup/flash.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!DOCTYPE html>
<html lang="ko">
<head>
<title>CHEditor</title>
<meta name="robots" content="noindex, nofollow" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
<script src="js/dialog.js" type="text/javascript"></script>
<script src="js/flash.js" type="text/javascript"></script>
</head>
<body>
<div class="flash-movie-source">
<div style="margin-bottom: 10px;width: 562px">
<span class="font-normal">&lt;동영상 소스 코드&gt; iframe 또는 object 태그를 입력하세요.</span>
<span class="font-normal">동영상 링크 URL 또는 IFRAME이나 EMBED 소스 코드를 붙여 넣거나 입력하세요.</span>
</div>
<textarea name="embed" id="fm_embed" style="height:40px;width:99%"></textarea>
<textarea name="source" id="fm_source" style="height:40px;width:99%"></textarea>
</div>
<div class="spacer"></div>
<div class="flash-player-wrapper" id="fm_player"></div>
<div class="bottom-status" id="buttonWrapper"></div>
</body>
</html>
</html>
4 changes: 2 additions & 2 deletions plugin/editor/cheditor5/popup/google_map.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
<script src="js/dialog.js" type="text/javascript"></script>
<script src="https://maps.google.com/maps/api/js?V=3&language=ko&region=KR" type="text/javascript"></script>
<script src="https://maps.google.com/maps/api/js?V=3&language=ko&region=KR&key=JS_MAPS_API_KEY" type="text/javascript"></script>
<script src="js/google_map.js" type="text/javascript"></script>
</head>
<body onload="initMap(5)">
<div style="padding-left:10px">
<span class="font-normal">찾을 주소: </span>
<input type="text" name="address" id="fm_address" value="서울" />
<input type="text" name="address" id="fm_address" title="찾을 주소" value="서울" />
<span id="map_search"></span>
<div class="font-normal" style="margin: 5px 0px 0px 58px;color:#666">찾으실 도로명 주소, 지번 또는 건물명을 입력하세요.</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions plugin/editor/cheditor5/popup/image.html5.m.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
<div style="margin-top:5px;font-size: 12px">
<input type="checkbox" name="use_spacer" value="1" checked="checked" />사진 여백 넣기
</div>
<div id="webgl_logo_wrapper" class="webgl_logo_wrapper" style="text-align: center;"></div>
</form>
</div>
</div>
Expand Down
162 changes: 133 additions & 29 deletions plugin/editor/cheditor5/popup/js/flash.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
// ================================================================
// CHEditor 5
// Movie
// ================================================================
var button = [
{ alt : '', img : 'play.gif', cmd : doPlay },
{ alt : '', img : 'submit.gif', cmd : doSubmit },
{ alt : '', img : 'cancel.gif', cmd : popupClose }
],
oEditor = null,
iframeSource = false;
iframeSource = null,
showMovie = false,
defaultMovieWidth = 640,
defaultMovieHeight = 360;

function init(dialog) {
var dlg = new Dialog(this);
Expand All @@ -17,52 +20,65 @@ function init(dialog) {
dlg.setDialogHeight();
}

function doPlay()
{
var elem = oEditor.trimSpace(document.getElementById("fm_embed").value),
embed = null, div = document.createElement('div'),
pos, str, object, child, movieHeight, movieWidth, i, params = [];
function getSource() {
return oEditor.trimSpace(document.getElementById("fm_source").value);
}

function doPlay() {
var embed = null,
div = document.createElement('div'),
pos, str, object, child, movieHeight, movieWidth, params = [], showWrapper,
source = getSource(), iframe;

elem = oEditor.trimSpace(elem);
if (elem == '') {
showMovie = true;
if (source === '') {
return;
}

if (elem.toLowerCase().indexOf("iframe") !== -1) {
document.getElementById('fm_player').innerHTML = elem;
iframeSource = true;
showWrapper = document.getElementById('fm_player');
if (source.toLowerCase().indexOf("iframe") !== -1) {
showWrapper.innerHTML = source;
iframeSource = source;
return;
}

pos = elem.toLowerCase().indexOf("embed");
if (/https?:\/\//.test(source)) {
iframe = createIframeElement(defaultMovieWidth, defaultMovieHeight, source);
if (iframe) {
showWrapper.innerHTML = '';
showWrapper.appendChild(iframe);
iframeSource = iframe;
}
return;
}

pos = source.toLowerCase().indexOf("embed");
if (pos !== -1) {
str = elem.substr(pos);
str = source.substr(pos);
pos = str.indexOf(">");
div.innerHTML = "<" + str.substr(0, pos) + ">";
embed = div.firstChild;
} else {
div.innerHTML = elem;
div.innerHTML = source;
object = div.getElementsByTagName('OBJECT')[0];
if (object && object.hasChildNodes()) {
child = object.firstChild;
movieWidth = (isNaN(object.width) !== true) ? object.width : 320;
movieHeight = (isNaN(object.height) !== true) ? object.height : 240;
movieWidth = (isNaN(object.width) !== true) ? object.width : defaultMovieWidth;
movieHeight = (isNaN(object.height) !== true) ? object.height : defaultMovieHeight;

do {
if ((child.nodeName === 'PARAM') && (typeof child.name !== 'undefined') && (typeof child.value !== 'undefined')) {
params.push({key: (child.name == 'movie') ? 'src' : child.name, val: child.value});
if (child.nodeName === 'PARAM' && typeof child.name !== 'undefined' && typeof child.value !== 'undefined')
{
params.push({
key: child.name === 'movie' ? 'src' : child.name,
val: child.value
});
}
child = child.nextSibling;
} while (child);

if (params.length > 0) {
embed = document.createElement('embed');
embed.setAttribute("width", movieWidth);
embed.setAttribute("height", movieHeight);
for (i = 0; i < params.length; i++) {
embed.setAttribute(params[i].key, params[i].val);
}
embed.setAttribute("type", "application/x-shockwave-flash");
embed = createEmbedElement(movieWidth, movieHeight, params, null);
}
}
}
Expand All @@ -72,24 +88,112 @@ function doPlay()
}
}

function createIframeElement(width, height, src) {
var iframe = document.createElement('iframe'), uri, query, id, movie = null;

uri = new oEditor.URI(src);
if (uri.path && uri.path.charAt(0) !== '/') {
uri.path = '/' + uri.path;
}

switch (uri.authority) {
case 'youtu.be' :
case 'youtube.com':
case 'www.youtube.com':
if (uri.path === '/watch' && uri.query) {
query = uri.query.split('=');
if (query[0] === 'v') {
movie = '/' + query[1];
}
}
if (!movie && uri.path) {
movie = uri.path;
if (uri.query) {
movie += '?' + uri.query;
}
}
if (movie) {
movie = 'https://www.youtube.com/embed' + movie;
}
break;
case 'vimeo.com' :
if (uri.path) {
movie = 'https://player.vimeo.com/video' + uri.path;
}
break;
case 'afree.ca' :
if (uri.path) {
movie = 'http://play.afreecatv.com' + uri.path + '/embed';
}
break;
case 'tv.naver.com' :
if (uri.path) {
id = uri.path.substring(uri.path.lastIndexOf('/'));
movie = 'https://tv.naver.com/embed' + id + '?autoPlay=true';
}
break;
case 'tv.kakao.com' :
if (uri.path) {
id = uri.path.substring(uri.path.lastIndexOf('/'));
movie = 'https://tv.kakao.com/embed/player/cliplink' + id;
}
break;
default :
movie = null;
}
if (!movie) {
return null;
}

iframe.setAttribute('width', width);
iframe.setAttribute('height', height);
iframe.setAttribute('frameborder', "0");
iframe.setAttribute('allowfullscreen', "true");
iframe.setAttribute('src', movie);
return iframe;
}

function createEmbedElement(width, height, params, src) {
var embed = document.createElement('embed'), i;

embed.setAttribute("type", "application/x-shockwave-flash");
embed.setAttribute('width', width);
embed.setAttribute('height', height);

if (src) {
embed.setAttribute('src', src);
}

for (i = 0; i < params.length; i++) {
embed.setAttribute(params[i].key, params[i].val);
}

return embed;
}

function popupClose() {
document.getElementById('fm_player').innerHTML = '';
oEditor.popupWinCancel();
}

function doSubmit()
{
var source = String(oEditor.trimSpace(document.getElementById("fm_embed").value));
var source = getSource();
if (source === '') {
popupClose();
}
if (!showMovie) {
document.getElementById('fm_player').style.visibility = 'hidden';
doPlay();
}

if (iframeSource || source.indexOf("iframe") !== -1) {
oEditor.insertHtmlPopup(source);
if (iframeSource) {
oEditor.insertHtmlPopup(iframeSource);
} else {
oEditor.insertFlash(source);
}

document.getElementById('fm_player').innerHTML = '';
oEditor.popupWinClose();
}

Loading

0 comments on commit d99641d

Please sign in to comment.