Merge branch 'master' of github.com:gnuboard/g5-update
This commit is contained in:
@ -1,9 +1,9 @@
|
|||||||
// ================================================================
|
// ================================================================
|
||||||
// CHEditor 5.1.9.3-p4
|
// CHEditor 5.1.9.4
|
||||||
// ----------------------------------------------------------------
|
// ----------------------------------------------------------------
|
||||||
// Homepage: http://www.chcode.com
|
// Homepage: http://www.chcode.com
|
||||||
// EMail: support@chcode.com
|
// EMail: support@chcode.com
|
||||||
// Copyright (c) 1997-2020 CHSOFT
|
// Copyright (c) 1997-2021 CHSOFT
|
||||||
// ================================================================
|
// ================================================================
|
||||||
var GB = {
|
var GB = {
|
||||||
colors: ['#000000','#313131','#434343','#535353','#666666','#999999','#a0a0a0','#b5b5b5','#c0c0c0','#dcdcdc','#eeeeee','#ffffff',
|
colors: ['#000000','#313131','#434343','#535353','#666666','#999999','#a0a0a0','#b5b5b5','#c0c0c0','#dcdcdc','#eeeeee','#ffffff',
|
||||||
@ -568,6 +568,7 @@ function setConfig() {
|
|||||||
this.cheditor.tabSpaces = '';
|
this.cheditor.tabSpaces = '';
|
||||||
this.cheditor.modifyState = false;
|
this.cheditor.modifyState = false;
|
||||||
this.cheditor.tabSpaces = new Array(this.config.tabIndent + 1).join(' ');
|
this.cheditor.tabSpaces = new Array(this.config.tabIndent + 1).join(' ');
|
||||||
|
this.URI = URI;
|
||||||
}
|
}
|
||||||
|
|
||||||
function cheditor() {
|
function cheditor() {
|
||||||
|
|||||||
BIN
plugin/editor/cheditor5/icons/imageUpload/broken.png
Normal file
BIN
plugin/editor/cheditor5/icons/imageUpload/broken.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
include_once("_common.php");
|
include_once("_common.php");
|
||||||
|
|
||||||
define("CHE_UPLOAD_IMG_CHECK", 1); // <EFBFBD>̹<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>Ҽ<EFBFBD> <20>ִ<EFBFBD><D6B4><EFBFBD> <20><><EFBFBD>θ<EFBFBD> üũ<C3BC>մϴ<D5B4>. ( <20>ش<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̹<EFBFBD><CCB9><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ<C3BC>մϴ<D5B4>. 1<≯<EFBFBD> <20><><EFBFBD><EFBFBD>, 0<≯<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> )
|
define("CHE_UPLOAD_IMG_CHECK", 1); // 이미지 파일을 썸네일 할수 있는지 여부를 체크합니다. ( 해당 파일이 이미지 파일인지 체크합니다. 1이면 사용, 0이면 사용 안함 )
|
||||||
|
|
||||||
// ---------------------------------------------------------------------------
|
// ---------------------------------------------------------------------------
|
||||||
|
|
||||||
# <EFBFBD>̹<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>丮<EFBFBD><E4B8AE> <20><>ü <20><><EFBFBD>θ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
# 이미지가 저장될 디렉토리의 전체 경로를 설정합니다.
|
||||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(/)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
# 끝에 슬래쉬(/)는 붙이지 않습니다.
|
||||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20>бⰡ <20><><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ֽʽÿ<CABD>.
|
# 주의: 이 경로의 접근 권한은 쓰기, 읽기가 가능하도록 설정해 주십시오.
|
||||||
|
|
||||||
# data/editor <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>丮<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>찡 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>丮<EFBFBD><E4B8AE> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0><EFBFBD>. kagla 140305
|
# data/editor 디렉토리가 없는 경우가 있을수 있으므로 디렉토리를 생성하는 코드를 추가함. kagla 140305
|
||||||
|
|
||||||
@mkdir(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
|
@mkdir(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
|
||||||
@chmod(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
|
@chmod(G5_DATA_PATH.'/'.G5_EDITOR_DIR, G5_DIR_PERMISSION);
|
||||||
@ -24,8 +24,8 @@ define("SAVE_DIR", $data_dir);
|
|||||||
@mkdir(SAVE_DIR, G5_DIR_PERMISSION);
|
@mkdir(SAVE_DIR, G5_DIR_PERMISSION);
|
||||||
@chmod(SAVE_DIR, G5_DIR_PERMISSION);
|
@chmod(SAVE_DIR, G5_DIR_PERMISSION);
|
||||||
|
|
||||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 'SAVE_DIR'<EFBFBD><EFBFBD> URL<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
# 위에서 설정한 'SAVE_DIR'의 URL을 설정합니다.
|
||||||
# <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(/)<29><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
|
# 끝에 슬래쉬(/)는 붙이지 않습니다.
|
||||||
|
|
||||||
define("SAVE_URL", $data_url);
|
define("SAVE_URL", $data_url);
|
||||||
|
|
||||||
|
|||||||
@ -93,9 +93,9 @@ if ($found != true || $filename_len != 23) {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD>: <20><><EFBFBD><EFBFBD><EFBFBD>Ͻú<CFBD><C3BA><EFBFBD>_<EFBFBD><5F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8<EFBFBD><38>
|
// 저장 파일 이름: 년월일시분초_렌덤문자8자
|
||||||
// 20140327125959_abcdefghi.jpg
|
// 20140327125959_abcdefghi.jpg
|
||||||
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20≯<EFBFBD>: $_POST["origname"]
|
// 원본 파일 이름: $_POST["origname"]
|
||||||
|
|
||||||
$filename = che_replace_filename($filename);
|
$filename = che_replace_filename($filename);
|
||||||
$savefile = SAVE_DIR . '/' . $filename;
|
$savefile = SAVE_DIR . '/' . $filename;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html>
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html lang="ko">
|
||||||
<head>
|
<head>
|
||||||
<title>CHEditor</title>
|
<title>CHEditor</title>
|
||||||
<meta name="robots" content="noindex, nofollow" />
|
<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" />
|
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||||
<script src="js/dialog.js" type="text/javascript"></script>
|
<script src="js/dialog.js" type="text/javascript"></script>
|
||||||
<script src="js/flash.js" type="text/javascript"></script>
|
<script src="js/flash.js" type="text/javascript"></script>
|
||||||
@ -11,12 +11,12 @@
|
|||||||
<body>
|
<body>
|
||||||
<div class="flash-movie-source">
|
<div class="flash-movie-source">
|
||||||
<div style="margin-bottom: 10px;width: 562px">
|
<div style="margin-bottom: 10px;width: 562px">
|
||||||
<span class="font-normal"><동영상 소스 코드> iframe 또는 object 태그를 입력하세요.</span>
|
<span class="font-normal">동영상 링크 URL 또는 IFRAME이나 EMBED 소스 코드를 붙여 넣거나 입력하세요.</span>
|
||||||
</div>
|
</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>
|
||||||
<div class="spacer"></div>
|
<div class="spacer"></div>
|
||||||
<div class="flash-player-wrapper" id="fm_player"></div>
|
<div class="flash-player-wrapper" id="fm_player"></div>
|
||||||
<div class="bottom-status" id="buttonWrapper"></div>
|
<div class="bottom-status" id="buttonWrapper"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -6,13 +6,13 @@
|
|||||||
<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" />
|
<link rel="stylesheet" type="text/css" href="../css/dialog.css" />
|
||||||
<script src="js/dialog.js" type="text/javascript"></script>
|
<script src="js/dialog.js" type="text/javascript"></script>
|
||||||
<script src="https://maps.google.com/maps/api/js?V=3&language=ko®ion=KR" type="text/javascript"></script>
|
<script src="https://maps.google.com/maps/api/js?V=3&language=ko®ion=KR&key=JS_MAPS_API_KEY" type="text/javascript"></script>
|
||||||
<script src="js/google_map.js" type="text/javascript"></script>
|
<script src="js/google_map.js" type="text/javascript"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="initMap(5)">
|
<body onload="initMap(5)">
|
||||||
<div style="padding-left:10px">
|
<div style="padding-left:10px">
|
||||||
<span class="font-normal">찾을 주소: </span>
|
<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>
|
<span id="map_search"></span>
|
||||||
<div class="font-normal" style="margin: 5px 0px 0px 58px;color:#666">찾으실 도로명 주소, 지번 또는 건물명을 입력하세요.</div>
|
<div class="font-normal" style="margin: 5px 0px 0px 58px;color:#666">찾으실 도로명 주소, 지번 또는 건물명을 입력하세요.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -64,6 +64,7 @@
|
|||||||
<div style="margin-top:5px;font-size: 12px">
|
<div style="margin-top:5px;font-size: 12px">
|
||||||
<input type="checkbox" name="use_spacer" value="1" checked="checked" />사진 여백 넣기
|
<input type="checkbox" name="use_spacer" value="1" checked="checked" />사진 여백 넣기
|
||||||
</div>
|
</div>
|
||||||
|
<div id="webgl_logo_wrapper" class="webgl_logo_wrapper" style="text-align: center;"></div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
// ================================================================
|
// ================================================================
|
||||||
// CHEditor 5
|
// Movie
|
||||||
// ================================================================
|
// ================================================================
|
||||||
var button = [
|
var button = [
|
||||||
{ alt : '', img : 'play.gif', cmd : doPlay },
|
{ alt : '', img : 'play.gif', cmd : doPlay },
|
||||||
@ -7,7 +7,10 @@ var button = [
|
|||||||
{ alt : '', img : 'cancel.gif', cmd : popupClose }
|
{ alt : '', img : 'cancel.gif', cmd : popupClose }
|
||||||
],
|
],
|
||||||
oEditor = null,
|
oEditor = null,
|
||||||
iframeSource = false;
|
iframeSource = null,
|
||||||
|
showMovie = false,
|
||||||
|
defaultMovieWidth = 640,
|
||||||
|
defaultMovieHeight = 360;
|
||||||
|
|
||||||
function init(dialog) {
|
function init(dialog) {
|
||||||
var dlg = new Dialog(this);
|
var dlg = new Dialog(this);
|
||||||
@ -17,52 +20,65 @@ function init(dialog) {
|
|||||||
dlg.setDialogHeight();
|
dlg.setDialogHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
function doPlay()
|
function getSource() {
|
||||||
{
|
return oEditor.trimSpace(document.getElementById("fm_source").value);
|
||||||
var elem = oEditor.trimSpace(document.getElementById("fm_embed").value),
|
}
|
||||||
embed = null, div = document.createElement('div'),
|
|
||||||
pos, str, object, child, movieHeight, movieWidth, i, params = [];
|
|
||||||
|
|
||||||
elem = oEditor.trimSpace(elem);
|
function doPlay() {
|
||||||
if (elem == '') {
|
var embed = null,
|
||||||
|
div = document.createElement('div'),
|
||||||
|
pos, str, object, child, movieHeight, movieWidth, params = [], showWrapper,
|
||||||
|
source = getSource(), iframe;
|
||||||
|
|
||||||
|
showMovie = true;
|
||||||
|
if (source === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elem.toLowerCase().indexOf("iframe") !== -1) {
|
showWrapper = document.getElementById('fm_player');
|
||||||
document.getElementById('fm_player').innerHTML = elem;
|
if (source.toLowerCase().indexOf("iframe") !== -1) {
|
||||||
iframeSource = true;
|
showWrapper.innerHTML = source;
|
||||||
|
iframeSource = source;
|
||||||
return;
|
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) {
|
if (pos !== -1) {
|
||||||
str = elem.substr(pos);
|
str = source.substr(pos);
|
||||||
pos = str.indexOf(">");
|
pos = str.indexOf(">");
|
||||||
div.innerHTML = "<" + str.substr(0, pos) + ">";
|
div.innerHTML = "<" + str.substr(0, pos) + ">";
|
||||||
embed = div.firstChild;
|
embed = div.firstChild;
|
||||||
} else {
|
} else {
|
||||||
div.innerHTML = elem;
|
div.innerHTML = source;
|
||||||
object = div.getElementsByTagName('OBJECT')[0];
|
object = div.getElementsByTagName('OBJECT')[0];
|
||||||
if (object && object.hasChildNodes()) {
|
if (object && object.hasChildNodes()) {
|
||||||
child = object.firstChild;
|
child = object.firstChild;
|
||||||
movieWidth = (isNaN(object.width) !== true) ? object.width : 320;
|
movieWidth = (isNaN(object.width) !== true) ? object.width : defaultMovieWidth;
|
||||||
movieHeight = (isNaN(object.height) !== true) ? object.height : 240;
|
movieHeight = (isNaN(object.height) !== true) ? object.height : defaultMovieHeight;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((child.nodeName === 'PARAM') && (typeof child.name !== 'undefined') && (typeof child.value !== 'undefined')) {
|
if (child.nodeName === 'PARAM' && typeof child.name !== 'undefined' && typeof child.value !== 'undefined')
|
||||||
params.push({key: (child.name == 'movie') ? 'src' : child.name, val: child.value});
|
{
|
||||||
|
params.push({
|
||||||
|
key: child.name === 'movie' ? 'src' : child.name,
|
||||||
|
val: child.value
|
||||||
|
});
|
||||||
}
|
}
|
||||||
child = child.nextSibling;
|
child = child.nextSibling;
|
||||||
} while (child);
|
} while (child);
|
||||||
|
|
||||||
if (params.length > 0) {
|
if (params.length > 0) {
|
||||||
embed = document.createElement('embed');
|
embed = createEmbedElement(movieWidth, movieHeight, params, null);
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,6 +88,89 @@ 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() {
|
function popupClose() {
|
||||||
document.getElementById('fm_player').innerHTML = '';
|
document.getElementById('fm_player').innerHTML = '';
|
||||||
oEditor.popupWinCancel();
|
oEditor.popupWinCancel();
|
||||||
@ -79,13 +178,17 @@ function popupClose() {
|
|||||||
|
|
||||||
function doSubmit()
|
function doSubmit()
|
||||||
{
|
{
|
||||||
var source = String(oEditor.trimSpace(document.getElementById("fm_embed").value));
|
var source = getSource();
|
||||||
if (source === '') {
|
if (source === '') {
|
||||||
popupClose();
|
popupClose();
|
||||||
}
|
}
|
||||||
|
if (!showMovie) {
|
||||||
|
document.getElementById('fm_player').style.visibility = 'hidden';
|
||||||
|
doPlay();
|
||||||
|
}
|
||||||
|
|
||||||
if (iframeSource || source.indexOf("iframe") !== -1) {
|
if (iframeSource) {
|
||||||
oEditor.insertHtmlPopup(source);
|
oEditor.insertHtmlPopup(iframeSource);
|
||||||
} else {
|
} else {
|
||||||
oEditor.insertFlash(source);
|
oEditor.insertFlash(source);
|
||||||
}
|
}
|
||||||
@ -93,3 +196,4 @@ function doSubmit()
|
|||||||
document.getElementById('fm_player').innerHTML = '';
|
document.getElementById('fm_player').innerHTML = '';
|
||||||
oEditor.popupWinClose();
|
oEditor.popupWinClose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,9 @@ var oEditor = null,
|
|||||||
mapWidth = 512,
|
mapWidth = 512,
|
||||||
mapHeight = 320,
|
mapHeight = 320,
|
||||||
panorama,
|
panorama,
|
||||||
panoramaVisible = false;
|
panoramaVisible = false,
|
||||||
|
marker,
|
||||||
|
staticMapsAPI = 'STATIC_MAPS_API_KEY';
|
||||||
|
|
||||||
function doSubmit() {
|
function doSubmit() {
|
||||||
var mapImg = document.createElement("img"),
|
var mapImg = document.createElement("img"),
|
||||||
@ -29,10 +31,9 @@ function doSubmit() {
|
|||||||
mapImg.style.width = mapWidth + 'px';
|
mapImg.style.width = mapWidth + 'px';
|
||||||
mapImg.style.height = mapHeight + 'px';
|
mapImg.style.height = mapHeight + 'px';
|
||||||
mapImg.style.border = '1px #000 solid';
|
mapImg.style.border = '1px #000 solid';
|
||||||
mapImg.setAttribute("alt", "Google Map");
|
mapImg.setAttribute('alt', 'Google Map');
|
||||||
mapImg.onload = function () {
|
mapImg.onload = function () {
|
||||||
oEditor.insertHtmlPopup(mapImg);
|
oEditor.insertHtmlPopup(mapImg);
|
||||||
oEditor.setImageEvent(true);
|
|
||||||
oEditor.popupWinClose();
|
oEditor.popupWinClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -41,42 +42,46 @@ function doSubmit() {
|
|||||||
panoramaHeading = panorama.getPov().heading;
|
panoramaHeading = panorama.getPov().heading;
|
||||||
panoramaZoom = panorama.getPov().zoom;
|
panoramaZoom = panorama.getPov().zoom;
|
||||||
panoramaPosition = panorama.getPosition();
|
panoramaPosition = panorama.getPosition();
|
||||||
|
mapImg.src = "http://maps.googleapis.com/maps/api/streetview?" +
|
||||||
mapImg.src = "http://maps.googleapis.com/maps/api/streetview?location=" + panoramaPosition +
|
"location=" + panoramaPosition.lat() + ',' + panoramaPosition.lng() +
|
||||||
"&pitch=" + panoramaPitch +
|
"&pitch=" + panoramaPitch +
|
||||||
"&heading=" + panoramaHeading +
|
"&heading=" + panoramaHeading +
|
||||||
"&size=" + mapWidth + 'x' + mapHeight +
|
"&size=" + mapWidth + 'x' + mapHeight +
|
||||||
"&zoom=" + panoramaZoom +
|
"&zoom=" + panoramaZoom +
|
||||||
"&sensor=false" +
|
"&sensor=false" +
|
||||||
"®ion=KR";
|
"®ion=KR" +
|
||||||
|
"&key=" + staticMapsAPI;
|
||||||
} else {
|
} else {
|
||||||
mapImg.src = "http://maps.google.com/maps/api/staticmap?center=" + centerLat + ',' + centerLng +
|
mapImg.src = "http://maps.google.com/maps/api/staticmap?" +
|
||||||
|
"center=" + centerLat + ',' + centerLng +
|
||||||
"&zoom=" + setZoom +
|
"&zoom=" + setZoom +
|
||||||
"&size=" + mapWidth + 'x' + mapHeight +
|
"&size=" + mapWidth + 'x' + mapHeight +
|
||||||
"&maptype=" + mapType +
|
"&maptype=" + mapType +
|
||||||
//"&markers=" + marker_lat + ',' + marker_lng +
|
"&markers=" + marker_lat + ',' + marker_lng +
|
||||||
"&sensor=false" +
|
"&sensor=false" +
|
||||||
"&language=ko" +
|
"&language=ko" +
|
||||||
"®ion=KR";
|
"®ion=KR" +
|
||||||
|
"&key=" + staticMapsAPI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function searchAddress() {
|
function searchAddress() {
|
||||||
var address = document.getElementById('fm_address').value,
|
var address = document.getElementById('fm_address').value,
|
||||||
geocoder = new google.maps.Geocoder();
|
geocoder = new google.maps.Geocoder();
|
||||||
//var results, status;
|
|
||||||
//var marker = new google.maps.Marker({ 'map': map, 'draggable': true });
|
|
||||||
|
|
||||||
geocoder.geocode({'address' : address},
|
geocoder.geocode({'address' : address},
|
||||||
function (results, status) {
|
function (results, status) {
|
||||||
if (status === google.maps.GeocoderStatus.OK) {
|
if (status === google.maps.GeocoderStatus.OK) {
|
||||||
centerLat = results[0].geometry.location.lat();
|
centerLat = results[0].geometry.location.lat();
|
||||||
centerLng = results[0].geometry.location.lng();
|
centerLng = results[0].geometry.location.lng();
|
||||||
latlng = new google.maps.LatLng(centerLat, centerLng);
|
latlng = new google.maps.LatLng(centerLat, centerLng);
|
||||||
map.setCenter(latlng);
|
map.setCenter(latlng);
|
||||||
map.setZoom(setZoom);
|
map.setZoom(setZoom);
|
||||||
}
|
marker = new google.maps.Marker({ 'map': map, 'draggable': true, 'position': latlng,
|
||||||
});
|
animation: google.maps.Animation.DROP});
|
||||||
|
marker.setMap(map);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initMap(zoom) {
|
function initMap(zoom) {
|
||||||
|
|||||||
@ -36,7 +36,8 @@ var activeImage = null,
|
|||||||
uploadImagePath = '',
|
uploadImagePath = '',
|
||||||
uploadMaxNumber = 12,
|
uploadMaxNumber = 12,
|
||||||
uploadScript,
|
uploadScript,
|
||||||
useWebGL = false;
|
useWebGL = false,
|
||||||
|
supportImageOrientation;
|
||||||
|
|
||||||
if (ArrayBuffer && !ArrayBuffer.prototype.slice) {
|
if (ArrayBuffer && !ArrayBuffer.prototype.slice) {
|
||||||
ArrayBuffer.prototype.slice = function (start, end) {
|
ArrayBuffer.prototype.slice = function (start, end) {
|
||||||
@ -437,11 +438,6 @@ function fileFilterError(file) {
|
|||||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
||||||
}
|
}
|
||||||
|
|
||||||
function explorerFileFilterError(file) {
|
|
||||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
|
||||||
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
|
|
||||||
}
|
|
||||||
|
|
||||||
function imgComplete(img, imgSize, boxId) {
|
function imgComplete(img, imgSize, boxId) {
|
||||||
var resizeW, resizeH, M, elem;
|
var resizeW, resizeH, M, elem;
|
||||||
img.setAttribute("border", '0');
|
img.setAttribute("border", '0');
|
||||||
@ -929,7 +925,7 @@ function DoUpload() {
|
|||||||
|
|
||||||
blob = new Blob();
|
blob = new Blob();
|
||||||
for (key in blob) {
|
for (key in blob) {
|
||||||
if (blob.hasOwnProperty(key)) {
|
if ({}.hasOwnProperty.call(blob, key)) {
|
||||||
(function (key) {
|
(function (key) {
|
||||||
Object.defineProperty(MYBLOB.prototype,
|
Object.defineProperty(MYBLOB.prototype,
|
||||||
key,
|
key,
|
||||||
@ -967,13 +963,7 @@ DoUpload.prototype = {
|
|||||||
file = files[i];
|
file = files[i];
|
||||||
|
|
||||||
if (!file.type.match(fileTypeRe)) {
|
if (!file.type.match(fileTypeRe)) {
|
||||||
// 엣지를 제외한 ie브라우저인지 체크
|
fileFilterError(file.name);
|
||||||
var agent = navigator.userAgent.toLowerCase();
|
|
||||||
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
|
|
||||||
explorerFileFilterError(file.name);
|
|
||||||
} else {
|
|
||||||
FileFilterError(file.name);
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this.list.push(file);
|
this.list.push(file);
|
||||||
@ -1032,15 +1022,22 @@ DoUpload.prototype = {
|
|||||||
offset = 2,
|
offset = 2,
|
||||||
marker, little, tags, i;
|
marker, little, tags, i;
|
||||||
|
|
||||||
|
// JPEG가 아닌 경우, 알 수 없음
|
||||||
if (view.getUint16(0, false) !== 0xffd8) {
|
if (view.getUint16(0, false) !== 0xffd8) {
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (offset < length) {
|
while (offset < length) {
|
||||||
|
// 알 수 없음
|
||||||
|
if (view.getUint16(offset + 2, false) <= 8) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
marker = view.getUint16(offset, false);
|
marker = view.getUint16(offset, false);
|
||||||
offset += 2;
|
offset += 2;
|
||||||
|
|
||||||
if (marker === 0xffe1) {
|
if (marker === 0xffe1) {
|
||||||
|
// 알 수 없음
|
||||||
if (view.getUint32(offset += 2, false) !== 0x45786966) {
|
if (view.getUint32(offset += 2, false) !== 0x45786966) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1061,7 +1058,7 @@ DoUpload.prototype = {
|
|||||||
offset += view.getUint16(offset, false);
|
offset += view.getUint16(offset, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 알 수 없음
|
||||||
return -1;
|
return -1;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1076,7 +1073,7 @@ DoUpload.prototype = {
|
|||||||
|| window.MSBlobBuilder;
|
|| window.MSBlobBuilder;
|
||||||
|
|
||||||
if (e.name === 'TypeError' && window.BlobBuilder) {
|
if (e.name === 'TypeError' && window.BlobBuilder) {
|
||||||
blobb = new BlobBuilder();
|
// eslint-disable-next-line no-undef
|
||||||
blobb.append(data);
|
blobb.append(data);
|
||||||
blob = blobb.getBlob(datatype);
|
blob = blobb.getBlob(datatype);
|
||||||
console.log("TypeError");
|
console.log("TypeError");
|
||||||
@ -1089,50 +1086,46 @@ DoUpload.prototype = {
|
|||||||
return blob;
|
return blob;
|
||||||
},
|
},
|
||||||
|
|
||||||
imageResize : function (image, filetype, resizeWidth, orientation, addWaterMark) {
|
imageResize : function (image, filetype, resize_w, orientation, addWaterMark) {
|
||||||
var canvas, source_w = image.width, source_h = image.height,
|
var canvas = document.createElement("canvas"),
|
||||||
resize_h, resize_w, ratio_w, ratio_h, ratio_w_half, ratio_h_half,
|
ctx = canvas.getContext("2d"),
|
||||||
|
source_w = image.width,
|
||||||
|
source_h = image.height,
|
||||||
|
resize_h, ratio_w, ratio_h, ratio_w_half, ratio_h_half,
|
||||||
source_img, resize_img, source_data, resize_data, j, i,
|
source_img, resize_img, source_data, resize_data, j, i,
|
||||||
x2, weight, weights, weights_alpha, gx_a, gx_b, gx_g, gx_r, center_x, center_y, x_start, x_stop,
|
x2, weight, weights, weights_alpha, gx_a, gx_b, gx_g, gx_r,
|
||||||
y_start, y_stop, y, dy, part_w, x, dx, w, pos_x,
|
center_x, center_y, x_start, x_stop,
|
||||||
ctx, gl, imageData = null;
|
y_start, y_stop, y, dy, part_w, x, dx, w, pos_x, gl, imageData = null;
|
||||||
|
|
||||||
// 카메라 로테이션 보정
|
// 카메라 로테이션 보정
|
||||||
if (orientation > 0) {
|
if (orientation > 0 && !supportImageOrientation) {
|
||||||
canvas = document.createElement("canvas");
|
if ([5,6,7,8].indexOf(orientation) > -1) {
|
||||||
canvas.width = source_w;
|
canvas.width = source_h;
|
||||||
canvas.height = source_h;
|
canvas.height = source_w;
|
||||||
ctx = canvas.getContext("2d");
|
} else {
|
||||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
canvas.width = source_w;
|
||||||
ctx.save();
|
canvas.height = source_h;
|
||||||
|
}
|
||||||
|
|
||||||
switch (orientation) {
|
switch (orientation) {
|
||||||
case 2 :
|
case 2 : ctx.transform(-1, 0, 0, 1, source_w, 0); break;
|
||||||
ctx.translate(-1, 0, 0, 1, canvas.width, 0); break;
|
case 3 : ctx.transform(-1, 0, 0, -1, source_w, source_h); break;
|
||||||
case 3 :
|
case 4 : ctx.transform(1, 0, 0, -1, 0, source_h); break;
|
||||||
ctx.translate(-1, 0, 0, -1, canvas.width, canvas.height); break;
|
case 5 : ctx.transform(0, 1, 1, 0, 0, 0); break;
|
||||||
case 4 :
|
case 6 : ctx.transform(0, 1, -1, 0, source_h, 0); break;
|
||||||
ctx.translate(1, 0, 0, -1, 0, canvas.height); break;
|
case 7 : ctx.transform(0, -1, -1, 0, source_h, source_w); break;
|
||||||
case 5 :
|
case 8 : ctx.transform(0, -1, 1, 0, 0, source_w); break;
|
||||||
ctx.translate(0, 1, 1, 0, 0, 0); break;
|
|
||||||
case 6 :
|
|
||||||
ctx.translate(0, 1, -1, 0, canvas.height, 0); break;
|
|
||||||
case 7 :
|
|
||||||
ctx.translate(0, -1, -1, 0, canvas.height, canvas.width); break;
|
|
||||||
case 8 :
|
|
||||||
ctx.translate(0, -1, 1, 0, 0, canvas.width); break;
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.drawImage(image, 0, 0);
|
ctx.drawImage(image, 0, 0, source_w, source_h);
|
||||||
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
source_w = canvas.width;
|
source_w = canvas.width;
|
||||||
source_h = canvas.height;
|
source_h = canvas.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source_w > resizeWidth) {
|
if (source_w > resize_w) {
|
||||||
resize_w = resizeWidth;
|
|
||||||
resize_h = Math.ceil(resize_w / source_w * source_h);
|
resize_h = Math.ceil(resize_w / source_w * source_h);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1143,8 +1136,6 @@ DoUpload.prototype = {
|
|||||||
canvas = gl_canvas;
|
canvas = gl_canvas;
|
||||||
});
|
});
|
||||||
} catch (ignore) {
|
} catch (ignore) {
|
||||||
canvas = document.createElement("canvas");
|
|
||||||
ctx = canvas.getContext("2d");
|
|
||||||
canvas.width = source_w;
|
canvas.width = source_w;
|
||||||
canvas.height = source_h;
|
canvas.height = source_h;
|
||||||
|
|
||||||
@ -1216,14 +1207,10 @@ DoUpload.prototype = {
|
|||||||
canvas.height = resize_h;
|
canvas.height = resize_h;
|
||||||
ctx.putImageData(resize_img, 0, 0);
|
ctx.putImageData(resize_img, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
canvas = document.createElement("canvas"),
|
canvas.width = source_w;
|
||||||
canvas.width = source_w; canvas.height = source_h;
|
canvas.height = source_h;
|
||||||
ctx = canvas.getContext("2d");
|
|
||||||
ctx.drawImage(image, 0, 0);
|
ctx.drawImage(image, 0, 0);
|
||||||
resize_h = source_h;
|
|
||||||
resize_w = source_w;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.reader.watermark && addWaterMark) {
|
if (this.reader.watermark && addWaterMark) {
|
||||||
@ -1276,7 +1263,8 @@ DoUpload.prototype = {
|
|||||||
filename = evt.target.file.name,
|
filename = evt.target.file.name,
|
||||||
filetype = evt.target.file.type,
|
filetype = evt.target.file.type,
|
||||||
file = evt.target.file,
|
file = evt.target.file,
|
||||||
blob, image, orientation = 1, slice = 64 * 1024;
|
blob, image, orientation = 1,
|
||||||
|
slice = 64 * 1024;
|
||||||
|
|
||||||
if (slice > file.size - 1) {
|
if (slice > file.size - 1) {
|
||||||
slice = file.size;
|
slice = file.size;
|
||||||
@ -1298,12 +1286,12 @@ DoUpload.prototype = {
|
|||||||
|
|
||||||
xhr.open('POST', uploadScript, true);
|
xhr.open('POST', uploadScript, true);
|
||||||
|
|
||||||
if (imageResizeWidth > 0) {
|
fileFormat = filename.substring(filename.lastIndexOf('.'));
|
||||||
|
if (imageResizeWidth > 0 && fileFormat !== '.gif') {
|
||||||
bitmapData = self.imageResize(this, filetype, imageResizeWidth, orientation, true);
|
bitmapData = self.imageResize(this, filetype, imageResizeWidth, orientation, true);
|
||||||
file = self.canvasToBlob(bitmapData, filetype);
|
file = self.canvasToBlob(bitmapData, filetype);
|
||||||
}
|
}
|
||||||
|
|
||||||
fileFormat = filename.substring(filename.lastIndexOf('.'));
|
|
||||||
randomName = self.makeFilename(fileFormat);
|
randomName = self.makeFilename(fileFormat);
|
||||||
|
|
||||||
data.append('origname', filename);
|
data.append('origname', filename);
|
||||||
@ -1375,7 +1363,6 @@ DoUpload.prototype = {
|
|||||||
blob = null;
|
blob = null;
|
||||||
xhr.send(data);
|
xhr.send(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
image.src = blob.getURL();
|
image.src = blob.getURL();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1484,7 +1471,7 @@ function setResizeWidth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init(dialog) {
|
function init(dialog) {
|
||||||
var dlg, i, elem, input, select, value, name, xhr_f, xhr_v, tmpcanvas, glicon;
|
var dlg, i, elem, input, select, value, name, xhr_f, xhr_v, tmpcanvas, glicon, testImg;
|
||||||
|
|
||||||
oEditor = this;
|
oEditor = this;
|
||||||
oEditor.dialog = dialog;
|
oEditor.dialog = dialog;
|
||||||
@ -1588,8 +1575,24 @@ function init(dialog) {
|
|||||||
xhr_f.send();
|
xhr_f.send();
|
||||||
xhr_v.send();
|
xhr_v.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
glicon = new Image();
|
glicon = new Image();
|
||||||
glicon.className = 'webgl_logo';
|
glicon.className = 'webgl_logo';
|
||||||
glicon.src = uploadImagePath + (useWebGL ? "/webgl.png" : "/webgl-off.png");
|
glicon.src = uploadImagePath + (useWebGL ? "/webgl.png" : "/webgl-off.png");
|
||||||
document.getElementById('webgl_logo_wrapper').appendChild(glicon);
|
document.getElementById('webgl_logo_wrapper').appendChild(glicon);
|
||||||
|
|
||||||
|
// 브라우저가 사진 Orientation 보정을 자동으로 지원하지는지 확인
|
||||||
|
testImg = new Image();
|
||||||
|
testImg.onload = function () {
|
||||||
|
supportImageOrientation = testImg.width === 2 && testImg.height === 3;
|
||||||
|
};
|
||||||
|
testImg.src =
|
||||||
|
'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +
|
||||||
|
'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +
|
||||||
|
'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +
|
||||||
|
'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/x' +
|
||||||
|
'ABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAA' +
|
||||||
|
'AAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQ' +
|
||||||
|
'voP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXw' +
|
||||||
|
'H/9k=';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,8 +35,9 @@ var activeImage = null,
|
|||||||
tmpTop = 0,
|
tmpTop = 0,
|
||||||
uploadImagePath = '',
|
uploadImagePath = '',
|
||||||
uploadMaxNumber = 12,
|
uploadMaxNumber = 12,
|
||||||
uploadScript;
|
uploadScript,
|
||||||
useWebGL = false;
|
useWebGL = false,
|
||||||
|
supportImageOrientation;
|
||||||
|
|
||||||
if (ArrayBuffer && !ArrayBuffer.prototype.slice) {
|
if (ArrayBuffer && !ArrayBuffer.prototype.slice) {
|
||||||
ArrayBuffer.prototype.slice = function (start, end) {
|
ArrayBuffer.prototype.slice = function (start, end) {
|
||||||
@ -434,12 +435,7 @@ function startUpload(list) {
|
|||||||
|
|
||||||
function fileFilterError(file) {
|
function fileFilterError(file) {
|
||||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
||||||
"gif, png, jpg, webp 사진 파일만 전송할 수 있습니다.");
|
"gif, png, jpg 사진 파일만 전송할 수 있습니다.");
|
||||||
}
|
|
||||||
|
|
||||||
function explorerFileFilterError(file) {
|
|
||||||
alert("선택하신 '" + file + "' 파일은 전송할 수 없습니다.\n" +
|
|
||||||
"익스플로러 환경에서는 gif, png, jpg 사진 파일만 \n전송할 수 있습니다.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function imgComplete(img, imgSize, boxId) {
|
function imgComplete(img, imgSize, boxId) {
|
||||||
@ -967,16 +963,10 @@ DoUpload.prototype = {
|
|||||||
file = files[i];
|
file = files[i];
|
||||||
|
|
||||||
if (!file.type.match(fileTypeRe)) {
|
if (!file.type.match(fileTypeRe)) {
|
||||||
// 엣지를 제외한 ie브라우저인지 체크
|
fileFilterError(file.name);
|
||||||
var agent = navigator.userAgent.toLowerCase();
|
|
||||||
if (agent.indexOf('trident') != -1 || agent.indexOf("msie") != -1) {
|
|
||||||
explorerFileFilterError(file.name);
|
|
||||||
} else {
|
|
||||||
FileFilterError(file.name);
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
this.list.push(file);
|
this.list.push(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.list.length < 1) {
|
if (this.list.length < 1) {
|
||||||
@ -1089,50 +1079,46 @@ DoUpload.prototype = {
|
|||||||
return blob;
|
return blob;
|
||||||
},
|
},
|
||||||
|
|
||||||
imageResize : function (image, filetype, resizeWidth, orientation, addWaterMark) {
|
imageResize : function (image, filetype, resize_w, orientation, addWaterMark) {
|
||||||
var canvas, source_w = image.width, source_h = image.height,
|
var canvas = document.createElement("canvas"),
|
||||||
resize_h, resize_w, ratio_w, ratio_h, ratio_w_half, ratio_h_half,
|
ctx = canvas.getContext("2d"),
|
||||||
|
source_w = image.width,
|
||||||
|
source_h = image.height,
|
||||||
|
resize_h, ratio_w, ratio_h, ratio_w_half, ratio_h_half,
|
||||||
source_img, resize_img, source_data, resize_data, j, i,
|
source_img, resize_img, source_data, resize_data, j, i,
|
||||||
x2, weight, weights, weights_alpha, gx_a, gx_b, gx_g, gx_r, center_x, center_y, x_start, x_stop,
|
x2, weight, weights, weights_alpha, gx_a, gx_b, gx_g, gx_r,
|
||||||
y_start, y_stop, y, dy, part_w, x, dx, w, pos_x,
|
center_x, center_y, x_start, x_stop,
|
||||||
ctx, gl, imageData = null;
|
y_start, y_stop, y, dy, part_w, x, dx, w, pos_x, gl, imageData = null;
|
||||||
|
|
||||||
// 카메라 로테이션 보정
|
// 카메라 로테이션 보정
|
||||||
if (orientation > 0) {
|
if (orientation > 0 && !supportImageOrientation) {
|
||||||
canvas = document.createElement("canvas");
|
if ([5,6,7,8].indexOf(orientation) > -1) {
|
||||||
canvas.width = source_w;
|
canvas.width = source_h;
|
||||||
canvas.height = source_h;
|
canvas.height = source_w;
|
||||||
ctx = canvas.getContext("2d");
|
} else {
|
||||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
canvas.width = source_w;
|
||||||
ctx.save();
|
canvas.height = source_h;
|
||||||
|
}
|
||||||
|
|
||||||
switch (orientation) {
|
switch (orientation) {
|
||||||
case 2 :
|
case 2 : ctx.transform(-1, 0, 0, 1, source_w, 0); break;
|
||||||
ctx.translate(-1, 0, 0, 1, canvas.width, 0); break;
|
case 3 : ctx.transform(-1, 0, 0, -1, source_w, source_h); break;
|
||||||
case 3 :
|
case 4 : ctx.transform(1, 0, 0, -1, 0, source_h); break;
|
||||||
ctx.translate(-1, 0, 0, -1, canvas.width, canvas.height); break;
|
case 5 : ctx.transform(0, 1, 1, 0, 0, 0); break;
|
||||||
case 4 :
|
case 6 : ctx.transform(0, 1, -1, 0, source_h, 0); break;
|
||||||
ctx.translate(1, 0, 0, -1, 0, canvas.height); break;
|
case 7 : ctx.transform(0, -1, -1, 0, source_h, source_w); break;
|
||||||
case 5 :
|
case 8 : ctx.transform(0, -1, 1, 0, 0, source_w); break;
|
||||||
ctx.translate(0, 1, 1, 0, 0, 0); break;
|
|
||||||
case 6 :
|
|
||||||
ctx.translate(0, 1, -1, 0, canvas.height, 0); break;
|
|
||||||
case 7 :
|
|
||||||
ctx.translate(0, -1, -1, 0, canvas.height, canvas.width); break;
|
|
||||||
case 8 :
|
|
||||||
ctx.translate(0, -1, 1, 0, 0, canvas.width); break;
|
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.drawImage(image, 0, 0);
|
ctx.drawImage(image, 0, 0, source_w, source_h);
|
||||||
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
source_w = canvas.width;
|
source_w = canvas.width;
|
||||||
source_h = canvas.height;
|
source_h = canvas.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source_w > resizeWidth) {
|
if (source_w > resize_w) {
|
||||||
resize_w = resizeWidth;
|
|
||||||
resize_h = Math.ceil(resize_w / source_w * source_h);
|
resize_h = Math.ceil(resize_w / source_w * source_h);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1143,8 +1129,6 @@ DoUpload.prototype = {
|
|||||||
canvas = gl_canvas;
|
canvas = gl_canvas;
|
||||||
});
|
});
|
||||||
} catch (ignore) {
|
} catch (ignore) {
|
||||||
canvas = document.createElement("canvas");
|
|
||||||
ctx = canvas.getContext("2d");
|
|
||||||
canvas.width = source_w;
|
canvas.width = source_w;
|
||||||
canvas.height = source_h;
|
canvas.height = source_h;
|
||||||
|
|
||||||
@ -1216,14 +1200,10 @@ DoUpload.prototype = {
|
|||||||
canvas.height = resize_h;
|
canvas.height = resize_h;
|
||||||
ctx.putImageData(resize_img, 0, 0);
|
ctx.putImageData(resize_img, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
canvas = document.createElement("canvas"),
|
canvas.width = source_w;
|
||||||
canvas.width = source_w; canvas.height = source_h;
|
canvas.height = source_h;
|
||||||
ctx = canvas.getContext("2d");
|
|
||||||
ctx.drawImage(image, 0, 0);
|
ctx.drawImage(image, 0, 0);
|
||||||
resize_h = source_h;
|
|
||||||
resize_w = source_w;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.reader.watermark && addWaterMark) {
|
if (this.reader.watermark && addWaterMark) {
|
||||||
@ -1484,7 +1464,7 @@ function setResizeWidth() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function init(dialog) {
|
function init(dialog) {
|
||||||
var dlg, i, elem, input, select, value, name, xhr_f, xhr_v, tmpcanvas, glicon;
|
var dlg, i, elem, input, select, value, name, xhr_f, xhr_v, tmpcanvas, glicon, testImg;
|
||||||
|
|
||||||
oEditor = this;
|
oEditor = this;
|
||||||
oEditor.dialog = dialog;
|
oEditor.dialog = dialog;
|
||||||
@ -1556,11 +1536,6 @@ function init(dialog) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.mobile) {
|
|
||||||
input = document.getElementById('inputImageUpload');
|
|
||||||
input.setAttribute('capture', 'filesystem');
|
|
||||||
}
|
|
||||||
|
|
||||||
tmpcanvas = document.createElement('canvas');
|
tmpcanvas = document.createElement('canvas');
|
||||||
if (tmpcanvas.getContext('webgl', {preserveDrawingBuffer: true}) ||
|
if (tmpcanvas.getContext('webgl', {preserveDrawingBuffer: true}) ||
|
||||||
tmpcanvas.getContext('experimental-webgl', {preserveDrawingBuffer: true}))
|
tmpcanvas.getContext('experimental-webgl', {preserveDrawingBuffer: true}))
|
||||||
@ -1588,8 +1563,24 @@ function init(dialog) {
|
|||||||
xhr_f.send();
|
xhr_f.send();
|
||||||
xhr_v.send();
|
xhr_v.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
glicon = new Image();
|
glicon = new Image();
|
||||||
glicon.className = 'webgl_logo';
|
glicon.className = 'webgl_logo';
|
||||||
glicon.src = uploadImagePath + (useWebGL ? "/webgl.png" : "/webgl-off.png");
|
glicon.src = uploadImagePath + (useWebGL ? "/webgl.png" : "/webgl-off.png");
|
||||||
document.getElementById('webgl_logo_wrapper').appendChild(glicon);
|
document.getElementById('webgl_logo_wrapper').appendChild(glicon);
|
||||||
|
|
||||||
|
// 브라우저가 사진 Orientation 보정을 자동으로 지원하지는지 확인
|
||||||
|
testImg = new Image();
|
||||||
|
testImg.onload = function () {
|
||||||
|
supportImageOrientation = testImg.width === 2 && testImg.height === 3;
|
||||||
|
};
|
||||||
|
testImg.src =
|
||||||
|
'data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAA' +
|
||||||
|
'AAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBA' +
|
||||||
|
'QEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE' +
|
||||||
|
'BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/x' +
|
||||||
|
'ABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAA' +
|
||||||
|
'AAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQ' +
|
||||||
|
'voP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXw' +
|
||||||
|
'H/9k=';
|
||||||
}
|
}
|
||||||
|
|||||||
43
plugin/editor/cheditor5/template.dtd
Normal file
43
plugin/editor/cheditor5/template.dtd
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8'?>
|
||||||
|
<!ELEMENT Template (Container|PopupWindow|Toolbar)*>
|
||||||
|
<!ELEMENT Container (Html)*>
|
||||||
|
<!ELEMENT Html (#PCDATA)>
|
||||||
|
<!ELEMENT PopupWindow (Html)*>
|
||||||
|
<!ELEMENT Toolbar (Image|Group)*>
|
||||||
|
<!ELEMENT Image EMPTY>
|
||||||
|
<!ATTLIST Image
|
||||||
|
file CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
<!ELEMENT Group (Button)*>
|
||||||
|
<!ATTLIST Group
|
||||||
|
name CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
<!ELEMENT Button (Attribute)*>
|
||||||
|
<!ATTLIST Button
|
||||||
|
name CDATA #IMPLIED
|
||||||
|
tooltip CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
<!ELEMENT Attribute (Icon|Execution)*>
|
||||||
|
<!ATTLIST Attribute
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
width CDATA #IMPLIED
|
||||||
|
height CDATA #IMPLIED
|
||||||
|
check CDATA #IMPLIED
|
||||||
|
default CDATA #IMPLIED
|
||||||
|
use CDATA #IMPLIED
|
||||||
|
type CDATA #IMPLIED
|
||||||
|
node CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
<!ELEMENT Icon EMPTY>
|
||||||
|
<!ATTLIST Icon
|
||||||
|
position CDATA #IMPLIED
|
||||||
|
width CDATA #IMPLIED
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
margin CDATA #IMPLIED
|
||||||
|
alt CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
<!ELEMENT Execution EMPTY>
|
||||||
|
<!ATTLIST Execution
|
||||||
|
method CDATA #IMPLIED
|
||||||
|
value CDATA #IMPLIED
|
||||||
|
>
|
||||||
Reference in New Issue
Block a user