git-svn-id: http://xe-core.googlecode.com/svn/trunk@842 201d5d3c-b55e-5fd7-737f-ddc643e51545
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @class colorpicker_bg
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 글자 배경색을 지정하는 컴포넌트
|
||||
**/
|
||||
|
||||
class colorpicker_bg extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function colorpicker_bg($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
BIN
modules/editor/components/colorpicker_bg/icon.gif
Normal file
|
After Width: | Height: | Size: 595 B |
8
modules/editor/components/colorpicker_bg/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">글의 배경색 변경</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">글의 배경색을 변경합니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
BIN
modules/editor/components/colorpicker_bg/tpl/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
46
modules/editor/components/colorpicker_bg/tpl/popup.css
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
@charset "utf-8";
|
||||
.colorpicker {
|
||||
width:160px;
|
||||
padding:5px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
img.preview_color {
|
||||
width:30px;
|
||||
height:16px;
|
||||
border:1px solid #000000;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
img.color_icon {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #FFFFFF;
|
||||
}
|
||||
|
||||
img.color_icon_over {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #000000;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.input_area {
|
||||
width:160px;
|
||||
padding:5px;
|
||||
font-family:tahoma;
|
||||
font-size:8pt;
|
||||
clear:both;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
}
|
||||
|
||||
.popup_input {
|
||||
border:1px solid #AAAAAA;
|
||||
height:14px;
|
||||
}
|
||||
|
||||
.popup_submit {
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
}
|
||||
19
modules/editor/components/colorpicker_bg/tpl/popup.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<div class="colorpicker">
|
||||
<script type='text/javascript'>
|
||||
printColor("{$tpl_path}/blank.gif");
|
||||
</script>
|
||||
</div>
|
||||
<div class="input_area">
|
||||
<form action="./" method="get" onsubmit="return applyColor()">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><img src="blank.gif" alt="blank" class="preview_color" id="preview_color" /></td>
|
||||
<td>#</td>
|
||||
<td><input type="text" id="color_input" size="6" maxlength="6" class="popup_input" value="FFFFFF" onkeyup="manual_select_color(this)"/></td>
|
||||
<td><input type="submit" value="{$lang->cmd_select}" class="popup_submit"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
49
modules/editor/components/colorpicker_bg/tpl/popup.js
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
/* 부모창의 위지윅 에디터의 선택된 영역의 글자색을 변경 */
|
||||
function applyColor() {
|
||||
var code = xGetElementById("color_input").value;
|
||||
|
||||
if(opener.xIE4Up) opener.editorDo("BackColor","#"+code, opener.editorPrevSrl);
|
||||
else opener.editorDo("hilitecolor","#"+code, opener.editorPrevSrl);
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* 색상 클릭시 */
|
||||
function select_color(code) {
|
||||
xGetElementById("color_input").value = code;
|
||||
xGetElementById("preview_color").style.backgroundColor = "#"+code;
|
||||
}
|
||||
|
||||
/* 색상표를 출력 */
|
||||
function printColor(blank_img_src) {
|
||||
var colorTable = new Array('22','44','66','88','AA','CC','EE');
|
||||
var html = "";
|
||||
|
||||
for(var i=0;i<8;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
for(var i=0; i<colorTable.length; i+=3) {
|
||||
for(var j=0; j<colorTable.length; j+=2) {
|
||||
for(var k=0; k<colorTable.length; k++) {
|
||||
var code = colorTable[i] + colorTable[j] + colorTable[k];
|
||||
html += printColorBlock(code, blank_img_src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var i=8;i<16;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
document.write(html);
|
||||
}
|
||||
|
||||
/* 개별 색상 block 출력 함수 */
|
||||
function printColorBlock(code, blank_img_src) {
|
||||
return "<div style=\"float:left;background-color:#"+code+"\"><img src=\""+blank_img_src+"\" class=\"color_icon\" onmouseover=\"this.className='color_icon_over'\" onmouseout=\"this.className='color_icon'\" onclick=\"select_color('"+code+"')\" alt=\"color\" \/><\/div>";
|
||||
}
|
||||
|
||||
/* 수동 색상 변경시 */
|
||||
function manual_select_color(obj) {
|
||||
if(obj.value.length!=6) return;
|
||||
xGetElementById("preview_color").style.backgroundColor = "#"+obj.value;
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @class colorpicker_text
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 글자색 변경하는 컴포넌트
|
||||
**/
|
||||
|
||||
class colorpicker_text extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function colorpicker_text($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
BIN
modules/editor/components/colorpicker_text/icon.gif
Normal file
|
After Width: | Height: | Size: 549 B |
8
modules/editor/components/colorpicker_text/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">글자색 변경</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">글자색을 변경합니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
BIN
modules/editor/components/colorpicker_text/tpl/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
47
modules/editor/components/colorpicker_text/tpl/popup.css
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.colorpicker {
|
||||
width:160px;
|
||||
padding:5px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
img.preview_color {
|
||||
width:30px;
|
||||
height:16px;
|
||||
border:1px solid #000000;
|
||||
background-color:#000000;
|
||||
}
|
||||
|
||||
img.color_icon {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #FFFFFF;
|
||||
}
|
||||
|
||||
img.color_icon_over {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #000000;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.input_area {
|
||||
width:160px;
|
||||
padding:5px;
|
||||
font-family:tahoma;
|
||||
font-size:8pt;
|
||||
clear:both;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
}
|
||||
|
||||
.popup_input {
|
||||
border:1px solid #AAAAAA;
|
||||
height:14px;
|
||||
}
|
||||
|
||||
.popup_submit {
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
}
|
||||
19
modules/editor/components/colorpicker_text/tpl/popup.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<div class="colorpicker">
|
||||
<script type='text/javascript'>
|
||||
printColor("{$tpl_path}/blank.gif");
|
||||
</script>
|
||||
</div>
|
||||
<div class="input_area">
|
||||
<form action="./" method="get" onsubmit="return applyColor()">
|
||||
<table border="0">
|
||||
<tr>
|
||||
<td><img src="blank.gif" alt="blank" class="preview_color" id="preview_color" /></td>
|
||||
<td>#</td>
|
||||
<td><input type="text" id="color_input" size="6" maxlength="6" class="popup_input" value="000000" onkeyup="manual_select_color(this)"/></td>
|
||||
<td><input type="submit" value="{$lang->cmd_select}" class="popup_submit"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
50
modules/editor/components/colorpicker_text/tpl/popup.js
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
/* 부모창의 위지윅 에디터의 선택된 영역의 글자색을 변경 */
|
||||
function applyColor() {
|
||||
var code = xGetElementById("color_input").value;
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
opener.editorDo("ForeColor", "#"+code, opener.editorPrevSrl);
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
self.close();
|
||||
}
|
||||
|
||||
/* 색상 클릭시 */
|
||||
function select_color(code) {
|
||||
xGetElementById("color_input").value = code;
|
||||
xGetElementById("preview_color").style.backgroundColor = "#"+code;
|
||||
}
|
||||
|
||||
/* 색상표를 출력 */
|
||||
function printColor(blank_img_src) {
|
||||
var colorTable = new Array('22','44','66','88','AA','CC','EE');
|
||||
var html = "";
|
||||
|
||||
for(var i=0;i<8;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
for(var i=0; i<colorTable.length; i+=3) {
|
||||
for(var j=0; j<colorTable.length; j+=2) {
|
||||
for(var k=0; k<colorTable.length; k++) {
|
||||
var code = colorTable[i] + colorTable[j] + colorTable[k];
|
||||
html += printColorBlock(code, blank_img_src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var i=8;i<16;i+=1) html += printColorBlock(i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
document.write(html);
|
||||
}
|
||||
|
||||
/* 개별 색상 block 출력 함수 */
|
||||
function printColorBlock(code, blank_img_src) {
|
||||
return "<div style=\"float:left;background-color:#"+code+"\"><img src=\""+blank_img_src+"\" class=\"color_icon\" onmouseover=\"this.className='color_icon_over'\" onmouseout=\"this.className='color_icon'\" onclick=\"select_color('"+code+"')\" alt=\"color\" \/><\/div>";
|
||||
}
|
||||
|
||||
/* 수동 색상 변경시 */
|
||||
function manual_select_color(obj) {
|
||||
if(obj.value.length!=6) return;
|
||||
xGetElementById("preview_color").style.backgroundColor = "#"+obj.value;
|
||||
}
|
||||
42
modules/editor/components/emoticon/emoticon.class.php
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* @class emoticon
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 이모티콘 이미지 연결 컴포넌트
|
||||
**/
|
||||
|
||||
class emoticon extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function emoticon($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
// 이모티콘을 모두 가져옴
|
||||
$emoticon_list = FileHandler::readDir($tpl_path.'/images');
|
||||
Context::set('emoticon_list', $emoticon_list);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
BIN
modules/editor/components/emoticon/icon.gif
Normal file
|
After Width: | Height: | Size: 1,018 B |
8
modules/editor/components/emoticon/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">이모티콘 출력</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">이모티콘을 에디터에 삽입할 수 있습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
BIN
modules/editor/components/emoticon/tpl/images/msn001.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn002.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn003.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn004.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn005.gif
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn006.gif
Normal file
|
After Width: | Height: | Size: 1,022 B |
BIN
modules/editor/components/emoticon/tpl/images/msn007.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn008.gif
Normal file
|
After Width: | Height: | Size: 1,015 B |
BIN
modules/editor/components/emoticon/tpl/images/msn009.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn010.gif
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn011.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn012.gif
Normal file
|
After Width: | Height: | Size: 1,015 B |
BIN
modules/editor/components/emoticon/tpl/images/msn013.gif
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn014.gif
Normal file
|
After Width: | Height: | Size: 1,022 B |
BIN
modules/editor/components/emoticon/tpl/images/msn015.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn016.gif
Normal file
|
After Width: | Height: | Size: 953 B |
BIN
modules/editor/components/emoticon/tpl/images/msn017.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn018.gif
Normal file
|
After Width: | Height: | Size: 944 B |
BIN
modules/editor/components/emoticon/tpl/images/msn019.gif
Normal file
|
After Width: | Height: | Size: 1,013 B |
BIN
modules/editor/components/emoticon/tpl/images/msn020.gif
Normal file
|
After Width: | Height: | Size: 975 B |
BIN
modules/editor/components/emoticon/tpl/images/msn021.gif
Normal file
|
After Width: | Height: | Size: 1,007 B |
BIN
modules/editor/components/emoticon/tpl/images/msn022.gif
Normal file
|
After Width: | Height: | Size: 1,016 B |
BIN
modules/editor/components/emoticon/tpl/images/msn023.gif
Normal file
|
After Width: | Height: | Size: 977 B |
BIN
modules/editor/components/emoticon/tpl/images/msn024.gif
Normal file
|
After Width: | Height: | Size: 989 B |
BIN
modules/editor/components/emoticon/tpl/images/msn025.gif
Normal file
|
After Width: | Height: | Size: 980 B |
BIN
modules/editor/components/emoticon/tpl/images/msn026.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn027.gif
Normal file
|
After Width: | Height: | Size: 971 B |
BIN
modules/editor/components/emoticon/tpl/images/msn028.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn029.gif
Normal file
|
After Width: | Height: | Size: 968 B |
BIN
modules/editor/components/emoticon/tpl/images/msn030.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn031.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn032.gif
Normal file
|
After Width: | Height: | Size: 987 B |
BIN
modules/editor/components/emoticon/tpl/images/msn033.gif
Normal file
|
After Width: | Height: | Size: 992 B |
BIN
modules/editor/components/emoticon/tpl/images/msn034.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn035.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn036.gif
Normal file
|
After Width: | Height: | Size: 1,004 B |
BIN
modules/editor/components/emoticon/tpl/images/msn037.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn038.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
BIN
modules/editor/components/emoticon/tpl/images/msn039.gif
Normal file
|
After Width: | Height: | Size: 953 B |
BIN
modules/editor/components/emoticon/tpl/images/msn040.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
45
modules/editor/components/emoticon/tpl/popup.css
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.editor_window {
|
||||
width:300px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_emoticon {
|
||||
padding:10px;
|
||||
}
|
||||
|
||||
.editor_window img {
|
||||
margin:2px;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.editor_title {
|
||||
font-size:10pt;
|
||||
font-weight:bold;
|
||||
clear:both;
|
||||
height:20px;
|
||||
background-color:#555555;
|
||||
color:#EFEFEF;
|
||||
vertical-align:middle;
|
||||
padding-top:5px;
|
||||
border-bottom:1px solid #000000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_button_area {
|
||||
border-top:1px solid #AAAAAA;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding:2px 0px 2px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
margin-top:4px;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
font-size:9pt;
|
||||
}
|
||||
17
modules/editor/components/emoticon/tpl/popup.html
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
|
||||
<div class="editor_window">
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&act=viewComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
|
||||
|
||||
<div class="editor_emoticon">
|
||||
<!--@foreach($emoticon_list as $emoticon)-->
|
||||
<img src="images/{$emoticon}" alt="emoticon" onclick="insertEmoticon(this); return false;" />
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertImage()" />
|
||||
<input type="button" value="{$lang->cmd_close}" class="editor_button" onclick="window.close();" />
|
||||
</div>
|
||||
</div>
|
||||
14
modules/editor/components/emoticon/tpl/popup.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
function insertEmoticon(obj) {
|
||||
if(typeof(opener)=='undefined') return;
|
||||
|
||||
var text = "<img src=\""+obj.src+"\" border=\"0\" alt=\"emoticon\" />";
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
window.close();
|
||||
}
|
||||
38
modules/editor/components/html_editor/html_editor.class.php
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @class html_editor
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 직접 html code를 수정할 수 있는 컴포넌트
|
||||
**/
|
||||
|
||||
class html_editor extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function html_editor($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
BIN
modules/editor/components/html_editor/icon.gif
Normal file
|
After Width: | Height: | Size: 1,023 B |
8
modules/editor/components/html_editor/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">HTML 코드 수정</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">에디터에서 HTML 코드를 직접 수정하거나 추가할 수 있습니다.\n보안 문제로 인하여 가능한 끄는 것이 좋습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
46
modules/editor/components/html_editor/tpl/popup.css
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.editor_window {
|
||||
width:400px;
|
||||
background-color:#F3F3F3;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_title {
|
||||
font-size:10pt;
|
||||
font-weight:bold;
|
||||
clear:both;
|
||||
height:20px;
|
||||
background-color:#555555;
|
||||
color:#EFEFEF;
|
||||
vertical-align:middle;
|
||||
padding-top:5px;
|
||||
border-bottom:1px solid #000000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_textarea {
|
||||
width:385px;
|
||||
height:400px;
|
||||
border:1px solid #888888;
|
||||
clear:both;
|
||||
font-size:9pt;
|
||||
margin:10px 0px 10px 0px;
|
||||
}
|
||||
|
||||
.editor_button_area {
|
||||
border-top:1px solid #AAAAAA;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding:2px 0px 2px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
margin-top:4px;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
font-size:9pt;
|
||||
}
|
||||
15
modules/editor/components/html_editor/tpl/popup.html
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
<!--%import("popup.css")-->
|
||||
<!--%import("popup.js")-->
|
||||
|
||||
<div class="editor_window">
|
||||
<form action='./' method='post' id='fo' onSubmit="return false" style="display:inline">
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&act=viewComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
|
||||
|
||||
<div><textarea name="text" id='editor' class="editor_textarea"></textarea></div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type='button' class="editor_button" value='{$lang->cmd_insert}' onclick='insertHtml()' />
|
||||
<input type='button' class="editor_button" value='{$lang->cmd_close}' onclick='window.close();' />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
20
modules/editor/components/html_editor/tpl/popup.js
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
function setText() {
|
||||
if(typeof(opener)=='undefined') return;
|
||||
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
|
||||
xGetElementById("editor").value = text;
|
||||
xGetElementById("editor").focus();
|
||||
}
|
||||
|
||||
function insertHtml() {
|
||||
var text = xGetElementById("editor").value;
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, 'load', setText);
|
||||
BIN
modules/editor/components/image_gallery/icon.gif
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
|
|
@ -0,0 +1,72 @@
|
|||
<?php
|
||||
/**
|
||||
* @class image_gallery
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 업로드된 이미지로 이미지갤러리를 만듬
|
||||
**/
|
||||
|
||||
class image_gallery extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function image_gallery($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method
|
||||
*
|
||||
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
|
||||
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
||||
**/
|
||||
function transHTML($xml_obj) {
|
||||
$gallery_info->srl = rand(111111,999999);
|
||||
$gallery_info->width = $xml_obj->attrs->width;
|
||||
$gallery_info->border_thickness = $xml_obj->attrs->border_thickness;
|
||||
$gallery_info->gallery_style = $xml_obj->attrs->gallery_style;
|
||||
$gallery_info->border_color = $xml_obj->attrs->border_color;
|
||||
$gallery_info->bg_color = $xml_obj->attrs->bg_color;
|
||||
$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
|
||||
|
||||
preg_match_all("/([^\"]){0,1}http([a-zA-Z0-9\_\-\:\/\.\~]*)(gif|jpg|jpeg|png)/i",trim($xml_obj->body),$matches);
|
||||
$image_list = $matches[0];
|
||||
$image_count = count($image_list);
|
||||
for($i=0;$i<$image_count;$i++) $image_list[$i] = preg_replace('/^(\>|\s)/','', $image_list[$i]);
|
||||
$gallery_info->image_list = $image_list;
|
||||
|
||||
Context::set('gallery_info', $gallery_info);
|
||||
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
if($gallery_info->gallery_style == "list") $tpl_file = 'list_gallery.html';
|
||||
else $tpl_file = 'slide_gallery.html';
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
8
modules/editor/components/image_gallery/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">기본 이미지 갤러리</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">첨부된 이미지파일을 이용하여 슬라이드/목록형 이미지 갤러리를 만들 수 있습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
27
modules/editor/components/image_gallery/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/image_gallery/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈 > 이미지갤러리(image_gallery) 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->image_gallery = "이미지 갤러리 제작";
|
||||
$lang->width = "가로크기";
|
||||
$lang->height = "세로크기";
|
||||
$lang->image_list = "이미지 목록";
|
||||
$lang->gallery_style = "갤러리형식 ";
|
||||
$lang->gallery_slide_style = "슬라이드 형식";
|
||||
$lang->gallery_slide_align = "정렬방식";
|
||||
$lang->gallery_slide_center = "가운데";
|
||||
$lang->gallery_slide_left = "왼쪽";
|
||||
$lang->gallery_slide_right = "오른쪽";
|
||||
$lang->gallery_list_style = "모두 펼침";
|
||||
$lang->gallery_border_color = "테두리색";
|
||||
$lang->gallery_border_thickness = "테두리 두께";
|
||||
$lang->gallery_bg_color = "배경색";
|
||||
$lang->about_image_list = "이미지 갤러리에 추가할 파일을 선택하세요. 선택후 드래그 또는 shift+클릭(범위선택), ctrl+클릭(개별선택) 가능합니다";
|
||||
|
||||
$lang->cmd_gallery_prev = "이전 그림 보기";
|
||||
$lang->cmd_gallery_next = "다음 그림 보기";
|
||||
$lang->cmd_gallery_thumbnail = "썸네일 보기";
|
||||
?>
|
||||
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 382 B |
|
After Width: | Height: | Size: 379 B |
|
After Width: | Height: | Size: 368 B |
BIN
modules/editor/components/image_gallery/tpl/images/blank.gif
Normal file
|
After Width: | Height: | Size: 43 B |
|
After Width: | Height: | Size: 89 B |
BIN
modules/editor/components/image_gallery/tpl/images/next.gif
Normal file
|
After Width: | Height: | Size: 176 B |
BIN
modules/editor/components/image_gallery/tpl/images/prev.gif
Normal file
|
After Width: | Height: | Size: 177 B |
|
|
@ -0,0 +1,14 @@
|
|||
<!--%import("list_gallery.js")-->
|
||||
<script type='text/javascript'>
|
||||
// 이미지갤러리에 보여줄 이미지 등록
|
||||
<!--@foreach($gallery_info->image_list as $image)-->
|
||||
list_gallery_add_image({$gallery_info->srl},'{$image}');
|
||||
<!--@end-->
|
||||
|
||||
// window.onLoad 이벤트 후에 이미지갤러리 시작
|
||||
xAddEventListener(window,'load',start_list_gallery);
|
||||
</script>
|
||||
|
||||
<div align="{$gallery_info->gallery_align}">
|
||||
<div id='zone_list_gallery_{$gallery_info->srl}' style="width:{$gallery_info->width}px;background-color:#{$gallery_info->bg_color};border:{$gallery_info->border_thickness}px solid #{$gallery_info->border_color};text-align:left;"></div>
|
||||
</div>
|
||||
84
modules/editor/components/image_gallery/tpl/list_gallery.js
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
/**
|
||||
* @file list_gallery.js
|
||||
* @brief 이미지 이미지갤러리 쇼 스크립트
|
||||
* @author zero (zero@nzeo.com)
|
||||
**/
|
||||
|
||||
// 이미지갤러리쇼를 하기 위한 변수
|
||||
var list_gallery_images = new Array();
|
||||
|
||||
// 이미지갤러리쇼 이미지 목록에 추가
|
||||
function list_gallery_add_image(srl, image_url) {
|
||||
if(!image_url) return;
|
||||
|
||||
// 객체 생성
|
||||
var obj = {"srl":0, "image_url":null, "image":null}
|
||||
|
||||
// list_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화
|
||||
if(typeof(list_gallery_images[srl])=="undefined") list_gallery_images[srl] = new Array();
|
||||
|
||||
// 이미지갤러리쇼 고유번호를 세팅
|
||||
obj.srl = srl;
|
||||
obj.idx = list_gallery_images[srl].length;
|
||||
|
||||
// 원본 이미지를 미리 로딩
|
||||
obj.image = new Image();
|
||||
obj.image.src = image_url;
|
||||
obj.image.srl = obj.srl;
|
||||
obj.image.idx = obj.idx;
|
||||
|
||||
// 생성된 객체를 list_gallery_images[이미지갤러리쇼 고유번호]에 추가
|
||||
list_gallery_images[srl][list_gallery_images[srl].length] = obj;
|
||||
}
|
||||
|
||||
// 이미지갤러리쇼 시작
|
||||
function start_list_gallery() {
|
||||
|
||||
// 등록된 모든 이미지 목록을 돌면서 목록을 만들어줌
|
||||
for(var srl in list_gallery_images) {
|
||||
|
||||
// 등록된 이미지가 없으면 pass~
|
||||
if(!list_gallery_images[srl].length) continue;
|
||||
|
||||
// 메인이미지가 나올 곳과 썸네일이 노출될 곳의 객체를 구함
|
||||
var zone = xGetElementById('zone_list_gallery_'+srl);
|
||||
|
||||
// 갤러리 외부 박스보다 이미지가 클 경우 resizing시킴
|
||||
var borderTop = parseInt(zone.style.borderTopWidth.replace(/px$/,''),10);
|
||||
var borderLeft = parseInt(zone.style.borderLeftWidth.replace(/px$/,''),10);
|
||||
var borderRight = parseInt(zone.style.borderRightWidth.replace(/px$/,''),10);
|
||||
var borderBottom = parseInt(zone.style.borderBottomWidth.replace(/px$/,''),10);
|
||||
|
||||
var zone_width = xWidth(zone)-borderLeft-borderRight;
|
||||
|
||||
// 이미지 출력
|
||||
for(var i=0; i<list_gallery_images[srl].length;i++) {
|
||||
var obj = list_gallery_images[srl][i];
|
||||
var image_width = obj.image.width;
|
||||
var image_height = obj.image.height;
|
||||
var resize_scale = 1;
|
||||
|
||||
// 이미지갤러리 쇼 박스보다 큰 이미지는 크기를 줄여서 출력
|
||||
if(image_width>(zone_width-25)) {
|
||||
resize_scale = (zone_width-25)/image_width;
|
||||
image_width = parseInt(image_width*resize_scale,10);
|
||||
image_height = parseInt(image_height*resize_scale,10);
|
||||
}
|
||||
|
||||
obj.image.style.width = image_width+"px";
|
||||
obj.image.style.height = image_height+"px";
|
||||
obj.image.style.marginLeft = "10px";
|
||||
obj.image.style.marginBottom = "10px";
|
||||
obj.image.style.display = "block";
|
||||
|
||||
// resize_scale이 1이 아니면, 즉 리사이즈 되었다면 해당 이미지 클릭시 원본을 새창으로 띄워줌
|
||||
if(resize_scale!=1) {
|
||||
obj.image.style.cursor = 'pointer';
|
||||
xAddEventListener(obj.image, 'click', showOriginalImage);
|
||||
}
|
||||
|
||||
zone.appendChild(obj.image);
|
||||
}
|
||||
zone.style.paddingTop = "10px";
|
||||
}
|
||||
}
|
||||
135
modules/editor/components/image_gallery/tpl/popup.css
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.editor_window {
|
||||
width:550px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_title {
|
||||
font-size:10pt;
|
||||
font-weight:bold;
|
||||
clear:both;
|
||||
height:20px;
|
||||
background-color:#555555;
|
||||
color:#EFEFEF;
|
||||
vertical-align:middle;
|
||||
padding-top:5px;
|
||||
border-bottom:1px solid #000000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.short_header {
|
||||
float:left;
|
||||
width:80px;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.short_body {
|
||||
float:left;
|
||||
width:90px;
|
||||
text-align:left;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.header {
|
||||
float:left;
|
||||
width:80px;
|
||||
clear:left;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.body {
|
||||
float:left;
|
||||
width:350px;
|
||||
text-align:left;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.image_list {
|
||||
width:380px;
|
||||
}
|
||||
|
||||
.about_image_list {
|
||||
margin-top:10px;
|
||||
font-size:9pt;
|
||||
color:#AAAAAA;
|
||||
}
|
||||
|
||||
.editor_input {
|
||||
width:40px;
|
||||
height:13px;
|
||||
font-size:9pt;
|
||||
border:1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.editor_button_area {
|
||||
border-top:1px solid #AAAAAA;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding:2px 0px 2px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
margin-top:4px;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.editor_color_box {
|
||||
clear:both;
|
||||
height:65px;
|
||||
width:400px;
|
||||
border:1px solid #DDDDDD;
|
||||
padding:2px;
|
||||
margin-bottom:3px;
|
||||
}
|
||||
|
||||
.editor_color_input {
|
||||
clear:both;
|
||||
}
|
||||
|
||||
img.bg_preview_color {
|
||||
width:30px;
|
||||
height:16px;
|
||||
border:1px solid #000000;
|
||||
background-color:#FFFFFF;
|
||||
}
|
||||
|
||||
img.border_preview_color {
|
||||
width:30px;
|
||||
height:16px;
|
||||
border:1px solid #EEEEEE;
|
||||
background-color:#000000;
|
||||
}
|
||||
|
||||
img.color_icon {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #FFFFFF;
|
||||
}
|
||||
|
||||
img.color_icon_over {
|
||||
width:14px;
|
||||
height:14px;
|
||||
border:1px solid #000000;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.table_input {
|
||||
width:40px;
|
||||
height:13px;
|
||||
font-size:9pt;
|
||||
border:1px solid #AAAAAA;
|
||||
}
|
||||
86
modules/editor/components/image_gallery/tpl/popup.html
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
|
||||
<div class="editor_window">
|
||||
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&act=viewComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
|
||||
|
||||
<div class="short_header">{$lang->width}</div>
|
||||
<div class="short_body"><input type="text" class="editor_input" id="width" value="600" />px</div>
|
||||
|
||||
<div class="header">{$lang->gallery_style}</div>
|
||||
<div class="body">
|
||||
<select id="gallery_style">
|
||||
<option value="slide">{$lang->gallery_slide_style}</option>
|
||||
<option value="list">{$lang->gallery_list_style}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->gallery_slide_align}</div>
|
||||
<div class="body">
|
||||
<select id="gallery_align">
|
||||
<option value="center">{$lang->gallery_slide_center}</option>
|
||||
<option value="left">{$lang->gallery_slide_left}</option>
|
||||
<option value="right">{$lang->gallery_slide_right}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->gallery_border_thickness}</div>
|
||||
<div class="body"><input type="text" class="editor_input" id="border_thickness" value="0" />px</div>
|
||||
|
||||
<div class="header">{$lang->gallery_border_color}</div>
|
||||
<div class="body">
|
||||
<div class="editor_color_box">
|
||||
<script type="text/javascript">
|
||||
printColor("border", "{$tpl_path}/images/blank.gif");
|
||||
</script>
|
||||
</div>
|
||||
<div class="editor_color_input">
|
||||
<table border="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><img src="./images/border_solid.gif" alt="blank" class="border_preview_color" id="border_preview_color" /></td>
|
||||
<td>#</td>
|
||||
<td><input type="text" id="border_color_input" size="6" maxlength="6" class="table_input" value="000000" onkeyup="manual_select_color('border',this)"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->gallery_bg_color}</div>
|
||||
<div class="body">
|
||||
<div class="editor_color_box">
|
||||
<script type="text/javascript">
|
||||
printColor("bg", "{$tpl_path}/images/blank.gif");
|
||||
</script>
|
||||
</div>
|
||||
<div class="editor_color_input">
|
||||
<table border="0" cellspacing="0">
|
||||
<tr>
|
||||
<td><img src="./images/blank.gif" alt="blank" class="bg_preview_color" id="bg_preview_color" /></td>
|
||||
<td>#</td>
|
||||
<td><input type="text" id="bg_color_input" size="6" maxlength="6" class="table_input" value="FFFFFF" onkeyup="manual_select_color('bg',this)"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->image_list}</div>
|
||||
<div class="body">
|
||||
<div>
|
||||
<select id="image_list" size="10" class="image_list" multiple="true">
|
||||
</select>
|
||||
</div>
|
||||
<div class="about_image_list">{$lang->about_image_list}</div>
|
||||
</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertSlideShow()" />
|
||||
<input type="button" value="{$lang->cmd_close}" class="editor_button" onclick="window.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
158
modules/editor/components/image_gallery/tpl/popup.js
Normal file
|
|
@ -0,0 +1,158 @@
|
|||
var selected_node = null;
|
||||
function getSlideShow() {
|
||||
// 부모창이 있는지 체크
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있으면 처리
|
||||
var node = opener.editorPrevNode;
|
||||
var selected_images = "";
|
||||
if(node && node.nodeName == "DIV") {
|
||||
selected_node = node;
|
||||
|
||||
var width = xWidth(selected_node)-6;
|
||||
var gallery_style = selected_node.getAttribute("gallery_style");
|
||||
var gallery_align = selected_node.getAttribute("gallery_align");
|
||||
var border_color = selected_node.getAttribute("border_color");
|
||||
var bg_color = selected_node.getAttribute("bg_color");
|
||||
var border_thickness = selected_node.getAttribute("border_thickness");
|
||||
if(!border_thickness) border_thickness = 1;
|
||||
|
||||
xGetElementById("width").value = width;
|
||||
|
||||
if(gallery_style=="list") xGetElementById("gallery_style").selectedIndex = 1;
|
||||
else xGetElementById("gallery_style").selectedIndex = 0;
|
||||
|
||||
if(!gallery_align || gallery_align=="center") xGetElementById("gallery_align").selectedIndex = 0;
|
||||
else if(gallery_align=="left") xGetElementById("gallery_align").selectedIndex = 1;
|
||||
else if(gallery_align=="right") xGetElementById("gallery_align").selectedIndex = 2;
|
||||
|
||||
xGetElementById("border_thickness").value = border_thickness;
|
||||
|
||||
xGetElementById("border_color_input").value = border_color;
|
||||
manual_select_color("border", xGetElementById("border_color_input"));
|
||||
|
||||
xGetElementById("bg_color_input").value = bg_color;
|
||||
manual_select_color("bg", xGetElementById("bg_color_input"));
|
||||
|
||||
selected_images = xInnerHtml(selected_node);
|
||||
}
|
||||
|
||||
// 부모창의 업로드된 파일중 이미지 목록을 모두 가져와서 세팅
|
||||
var fo = xGetElementById("fo");
|
||||
var upload_target_srl = fo.upload_target_srl.value;
|
||||
|
||||
var parent_list_obj = opener.xGetElementById("uploaded_file_list_"+upload_target_srl);
|
||||
|
||||
var list_obj = xGetElementById("image_list");
|
||||
|
||||
for(var i=0;i<parent_list_obj.length;i++) {
|
||||
var opt = parent_list_obj.options[i];
|
||||
var file_srl = opt.value;
|
||||
var file_obj = opener.uploaded_files[file_srl];
|
||||
var filename = file_obj.uploaded_filename;
|
||||
if((/(jpg|jpeg|gif|png)$/i).test(filename)) {
|
||||
var selected = false;
|
||||
if(selected_images.indexOf(filename)!=-1) selected = true;
|
||||
var opt = new Option(opt.text, opt.value, false, selected);
|
||||
list_obj.options.add(opt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function insertSlideShow() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var list = new Array();
|
||||
var list_obj = xGetElementById("image_list");
|
||||
for(var i=0;i<list_obj.length;i++) {
|
||||
var opt = list_obj.options[i];
|
||||
if(opt.selected) {
|
||||
var file_srl = opt.value;
|
||||
var file_obj = opener.uploaded_files[file_srl];
|
||||
var filename = file_obj.uploaded_filename;
|
||||
list[list.length] = filename;
|
||||
}
|
||||
}
|
||||
|
||||
if(!list.length) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
var width = xGetElementById("width").value;
|
||||
|
||||
var gallery_style = xGetElementById("gallery_style").options[xGetElementById("gallery_style").selectedIndex].value;
|
||||
var gallery_align = xGetElementById("gallery_align").options[xGetElementById("gallery_align").selectedIndex].value;
|
||||
var border_thickness = xGetElementById("border_thickness").value;
|
||||
var border_color = xGetElementById("border_color_input").value;
|
||||
var bg_color = xGetElementById("bg_color_input").value;
|
||||
|
||||
var images_list = "";
|
||||
for(var i=0; i<list.length;i++) {
|
||||
images_list += list[i].trim()+"\n";
|
||||
}
|
||||
if(selected_node) {
|
||||
selected_node.setAttribute("width", width);
|
||||
selected_node.setAttribute("gallery_style", gallery_style);
|
||||
selected_node.setAttribute("gallery_align", gallery_align);
|
||||
selected_node.setAttribute("border_thickness", border_thickness);
|
||||
selected_node.setAttribute("border_color", border_color);
|
||||
selected_node.setAttribute("bg_color", bg_color);
|
||||
selected_node.style.width = width+"px";
|
||||
xInnerHtml(selected_node, images_list);
|
||||
} else {
|
||||
var text = "<div editor_component=\"image_gallery\" class=\"editor_component_output\" width=\""+width+"\" gallery_style=\""+gallery_style+"\" gallery_align=\""+gallery_align+"\" border_thickness=\""+border_thickness+"\" border_color=\""+border_color+"\" bg_color=\""+bg_color+"\" style=\"width:"+width+"px;\" >"+images_list+"</div>";
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
}
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
/* 색상 클릭시 */
|
||||
function select_color(type, code) {
|
||||
xGetElementById(type+"_preview_color").style.backgroundColor = "#"+code;
|
||||
xGetElementById(type+"_color_input").value = code;
|
||||
}
|
||||
|
||||
/* 수동 색상 변경시 */
|
||||
function manual_select_color(type, obj) {
|
||||
if(obj.value.length!=6) return;
|
||||
code = obj.value;
|
||||
xGetElementById(type+"_preview_color").style.backgroundColor = "#"+code;
|
||||
}
|
||||
|
||||
/* 색상표를 출력 */
|
||||
function printColor(type, blank_img_src) {
|
||||
var colorTable = new Array('22','44','66','88','AA','CC','EE');
|
||||
var html = "";
|
||||
|
||||
for(var i=0;i<8;i+=1) html += printColorBlock(type, i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
for(var i=0; i<colorTable.length; i+=3) {
|
||||
for(var j=0; j<colorTable.length; j+=2) {
|
||||
for(var k=0; k<colorTable.length; k++) {
|
||||
var code = colorTable[i] + colorTable[j] + colorTable[k];
|
||||
html += printColorBlock(type, code, blank_img_src);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(var i=8;i<16;i+=1) html += printColorBlock(type, i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16)+i.toString(16), blank_img_src);
|
||||
|
||||
document.write(html);
|
||||
}
|
||||
|
||||
/* 개별 색상 block 출력 함수 */
|
||||
function printColorBlock(type, code, blank_img_src) {
|
||||
if(type=="bg") {
|
||||
return "<div style=\"float:left;background-color:#"+code+"\"><img src=\""+blank_img_src+"\" class=\"color_icon\" onmouseover=\"this.className='color_icon_over'\" onmouseout=\"this.className='color_icon'\" onclick=\"select_color('"+type+"','"+code+"')\" alt=\"color\" \/><\/div>";
|
||||
} else {
|
||||
return "<div style=\"float:left;background-color:#"+code+"\"><img src=\""+blank_img_src+"\" class=\"color_icon\" onmouseover=\"this.className='color_icon_over'\" onmouseout=\"this.className='color_icon'\" onclick=\"select_color('"+type+"','"+code+"')\" alt=\"color\" \/><\/div>";
|
||||
}
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getSlideShow);
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
@charset "utf-8";
|
||||
.slide_gallery_loading_text {
|
||||
color:#555555;
|
||||
font-size:8pt;
|
||||
font-family:tahoma;
|
||||
font-weight:bold;
|
||||
margin:20px 0px 20px 0px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.slide_gallery_navigator_box {
|
||||
font-size:9pt;
|
||||
text-align:center;
|
||||
margin:5px 0px 5px 0px;
|
||||
}
|
||||
|
||||
.zone_gallery_navigator_status {
|
||||
color:#444444;
|
||||
font-family:verdana;
|
||||
font-size:8pt;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.slide_gallery_navigator_box img {
|
||||
vertical-align:bottom;
|
||||
}
|
||||
|
||||
.slide_gallery_main_image_box {
|
||||
border:3px solid #EEEEEE;
|
||||
margin:10px;
|
||||
}
|
||||
|
||||
.slide_gallery_thumbnail_image_box {
|
||||
margin:10px;
|
||||
text-align:left;
|
||||
}
|
||||
|
||||
.slide_gallery_thumbnail_image_box img {
|
||||
border:1px solid #555555;
|
||||
padding:1px;
|
||||
margin:4px;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
<!--%import("slide_gallery.js")-->
|
||||
<!--%import("slide_gallery.css")-->
|
||||
<!--%import("../lang")-->
|
||||
<script type='text/javascript'>
|
||||
// 이미지갤러리에 보여줄 이미지 등록
|
||||
//
|
||||
<!--@foreach($gallery_info->image_list as $image)-->
|
||||
slide_gallery_add_image({$gallery_info->srl},'{$image}');
|
||||
<!--@end-->
|
||||
|
||||
// window.onLoad 이벤트 후에 이미지갤러리 시작
|
||||
xAddEventListener(window,'load',start_slide_gallery);
|
||||
</script>
|
||||
|
||||
<div align="{$gallery_info->gallery_align}">
|
||||
<div id='zone_slide_gallery_{$gallery_info->srl}' style="width:{$gallery_info->width}px;background-color:#{$gallery_info->bg_color};border:{$gallery_info->border_thickness}px solid #{$gallery_info->border_color};text-align:left;">
|
||||
<div id='zone_image_navigator_{$gallery_info->srl}' class="slide_gallery_navigator_box">
|
||||
<a href="#" onclick="gallery_view_prev('{$gallery_info->srl}');return false;"><img src="./images/prev.gif" alt="{$lang->cmd_gallery_prev}" title="{$lang->cmd_gallery_prev}" border="0" /></a>
|
||||
<span class="zone_gallery_navigator_status" title="{$lang->cmd_gallery_thumbnail}" id="zone_gallery_navigator_status_{$gallery_info->srl}" onclick="gallery_view_thumbnail('{$gallery_info->srl}');return false;">1/1</span>
|
||||
<a href="#" onclick="gallery_view_next('{$gallery_info->srl}');return false;"><img src="./images/next.gif" alt="{$lang->cmd_gallery_next}" title="{$lang->cmd_gallery_next}" border="0" /></a>
|
||||
</div>
|
||||
<div id='zone_thumbnail_{$gallery_info->srl}' class="slide_gallery_thumbnail_image_box" style="display:none"></div>
|
||||
<div id="slide_gallery_loading_text_{$gallery_info->srl}" class="slide_gallery_loading_text">loading images...</div>
|
||||
<img id="slide_gallery_main_image_{$gallery_info->srl}" border="0" style="display:none" alt="slide_gallery" src="./images/blank.gif" />
|
||||
</div>
|
||||
</div>
|
||||
186
modules/editor/components/image_gallery/tpl/slide_gallery.js
Normal file
|
|
@ -0,0 +1,186 @@
|
|||
/**
|
||||
* @file slide_gallery.js
|
||||
* @brief 이미지 이미지갤러리 쇼 스크립트
|
||||
* @author zero (zero@nzeo.com)
|
||||
**/
|
||||
|
||||
// 이미지갤러리쇼를 하기 위한 변수
|
||||
var slide_gallery_images = new Array();
|
||||
var thumbnail_zone_height = new Array();
|
||||
|
||||
// 이미지갤러리쇼 이미지 목록에 추가
|
||||
function slide_gallery_add_image(srl, image_url) {
|
||||
if(!image_url) return;
|
||||
|
||||
// 객체 생성
|
||||
var obj = {"srl":0, "thumbnail_url":null, "thumbnail":null, "image_url":null, "image":null}
|
||||
|
||||
// slide_gallery_images에 이미지갤러리 쇼 고유번호에 해당하는 공간을 초기화
|
||||
if(typeof(slide_gallery_images[srl])=="undefined") slide_gallery_images[srl] = new Array();
|
||||
|
||||
// 이미지갤러리쇼 고유번호를 세팅
|
||||
obj.srl = srl;
|
||||
obj.idx = slide_gallery_images[srl].length;
|
||||
|
||||
// 원본 이미지를 미리 로딩
|
||||
obj.image = new Image();
|
||||
obj.image.src = image_url;
|
||||
//if(!obj.image.width) return;
|
||||
|
||||
// 썸네일 이미지를 미리 로딩
|
||||
obj.thumbnail = new Image();
|
||||
obj.thumbnail.src = image_url;
|
||||
obj.thumbnail.style.cursor = "pointer";
|
||||
obj.thumbnail.style.width = "60px";
|
||||
obj.thumbnail.style.height = "60px";
|
||||
obj.thumbnail.style.margin = "5px";
|
||||
obj.thumbnail.style.opacity = 0.5;
|
||||
obj.thumbnail.style.filter = "alpha(opacity=50)";
|
||||
|
||||
// 썸네일 클릭시 메인 이미지로 바꾸어줌
|
||||
xAddEventListener(obj.thumbnail, "mousedown", function() { display_gallery_image(obj) });
|
||||
|
||||
// 생성된 객체를 slide_gallery_images[이미지갤러리쇼 고유번호]에 추가
|
||||
slide_gallery_images[srl][slide_gallery_images[srl].length] = obj;
|
||||
}
|
||||
|
||||
// 이미지갤러리쇼 시작
|
||||
function start_slide_gallery() {
|
||||
|
||||
// 등록된 모든 이미지 목록을 돌면서 thumbnail 목록을 만들어줌
|
||||
for(var srl in slide_gallery_images) {
|
||||
|
||||
// 등록된 이미지가 없으면 pass~
|
||||
if(!slide_gallery_images[srl].length) continue;
|
||||
|
||||
// 메인이미지가 나올 곳과 썸네일이 노출될 곳의 객체를 구함
|
||||
var zone_thumbnail = xGetElementById('zone_thumbnail_'+srl);
|
||||
|
||||
// 썸네일 출력
|
||||
for(var i=0; i<slide_gallery_images[srl].length;i++) {
|
||||
zone_thumbnail.appendChild(slide_gallery_images[srl][i].thumbnail);
|
||||
}
|
||||
thumbnail_zone_height[srl] = xHeight(zone_thumbnail)+20;
|
||||
|
||||
// 첫번째 이미지의 경우 큰 이미지 출력 시작 이미지 출력
|
||||
display_gallery_image(slide_gallery_images[srl][0],true);
|
||||
|
||||
// 로딩 텍스트 없앰
|
||||
xGetElementById("slide_gallery_loading_text_"+srl).style.display = "none";
|
||||
xGetElementById("slide_gallery_main_image_"+srl).style.display = "block";
|
||||
}
|
||||
}
|
||||
|
||||
// 메인 이미지 표시
|
||||
function display_gallery_image(obj, is_first_display) {
|
||||
// 처음으로 요청되는지에 대한 검사
|
||||
if(typeof(is_first_display)=="undefined") is_first_display = false;
|
||||
|
||||
// 썸네일 영역
|
||||
var zone_thumbnail = xGetElementById('zone_thumbnail_'+obj.srl);
|
||||
|
||||
// 슬라이드 갤러리의 영역
|
||||
var zone = xGetElementById('zone_slide_gallery_' + obj.srl );
|
||||
|
||||
// 슬라이드 갤러리 영역의 정확한 크기를 위해서 border값 검사 (border는 조절 가능하기에)
|
||||
var borderTop = parseInt(zone.style.borderTopWidth.replace(/px$/,''),10);
|
||||
var borderLeft = parseInt(zone.style.borderLeftWidth.replace(/px$/,''),10);
|
||||
var borderRight = parseInt(zone.style.borderRightWidth.replace(/px$/,''),10);
|
||||
var borderBottom = parseInt(zone.style.borderBottomWidth.replace(/px$/,''),10);
|
||||
|
||||
// 갤러리 영역의 가로 길이 구함
|
||||
var zone_width = xWidth(zone)-borderLeft-borderRight;
|
||||
|
||||
// 이미지 크기가 갤러리 영역보다 클 경우를 계산하기 위한 비율 변수 설정
|
||||
var resize_scale = 1;
|
||||
|
||||
// 이미지의 크기 구함
|
||||
var image_width = obj.image.width;
|
||||
var image_height = obj.image.height;
|
||||
|
||||
// 이미지갤러리 쇼 박스보다 큰 이미지는 크기를 줄여서 출력 (ersize_scale 조절)
|
||||
if(image_width>(zone_width-20)) {
|
||||
resize_scale = (zone_width-20)/image_width;
|
||||
image_width = parseInt(image_width*resize_scale,10);
|
||||
image_height = parseInt(image_height*resize_scale,10);
|
||||
}
|
||||
var x = parseInt((zone_width - image_width)/2,10);
|
||||
|
||||
// 이미지 표시
|
||||
var target_image = xGetElementById("slide_gallery_main_image_"+obj.srl);
|
||||
|
||||
target_image.style.marginLeft = x+"px";
|
||||
|
||||
target_image.src = obj.image.src;
|
||||
target_image.srl = obj.srl;
|
||||
target_image.idx = obj.idx;
|
||||
target_image.style.opacity = 1;
|
||||
target_image.style.filter = "alpha(opacity=100)";
|
||||
target_image.start_opacity = 0;
|
||||
xWidth(target_image, image_width);
|
||||
xHeight(target_image, image_height);
|
||||
|
||||
if(image_height<200) {
|
||||
target_image.style.marginTop = (100-image_height/2)+"px";
|
||||
target_image.style.marginBottom = (100-image_height/2)+"px";
|
||||
} else {
|
||||
target_image.style.marginTop = "10px";
|
||||
target_image.style.marginBottom = "10px";
|
||||
}
|
||||
|
||||
if(resize_scale!=1) {
|
||||
xAddEventListener(target_image, 'click', showOriginalImage);
|
||||
target_image.style.cursor = 'pointer';
|
||||
} else {
|
||||
xRemoveEventListener(target_image, 'click', showOriginalImage);
|
||||
target_image.style.cursor = 'default';
|
||||
}
|
||||
|
||||
// resize_scale이 1이 아니면, 즉 리사이즈 되었다면 해당 이미지 클릭시 원본을 새창으로 띄워줌
|
||||
var next_idx = obj.idx+1;
|
||||
if(slide_gallery_images[obj.srl].length<=next_idx) next_idx = 0;
|
||||
|
||||
// srl의 모든 썸네일의 투명도 조절
|
||||
for(var i=0; i<slide_gallery_images[obj.srl].length;i++) {
|
||||
if(i==obj.idx) {
|
||||
slide_gallery_images[obj.srl][i].thumbnail.style.opacity = 1;
|
||||
slide_gallery_images[obj.srl][i].thumbnail.style.filter = "alpha(opacity=100)";
|
||||
} else {
|
||||
slide_gallery_images[obj.srl][i].thumbnail.style.opacity = 0.5;
|
||||
slide_gallery_images[obj.srl][i].thumbnail.style.filter = "alpha(opacity=50)";
|
||||
}
|
||||
}
|
||||
|
||||
// 네이게이션 영역의 숫자 변경
|
||||
var zone_navigator = xGetElementById("zone_gallery_navigator_status_"+obj.srl);
|
||||
var html = (obj.idx+1) + " / " + slide_gallery_images[obj.srl].length;
|
||||
xInnerHtml(zone_navigator, html);
|
||||
}
|
||||
|
||||
// 이전 보기
|
||||
function gallery_view_prev(srl) {
|
||||
var target_image = xGetElementById("slide_gallery_main_image_"+srl);
|
||||
var idx = target_image.idx;
|
||||
var max_length = slide_gallery_images[srl].length;
|
||||
idx--;
|
||||
if(idx<0) idx = max_length-1;
|
||||
display_gallery_image(slide_gallery_images[srl][idx]);
|
||||
}
|
||||
|
||||
// 다음 보기
|
||||
function gallery_view_next(srl) {
|
||||
var target_image = xGetElementById("slide_gallery_main_image_"+srl);
|
||||
var idx = target_image.idx;
|
||||
var max_length = slide_gallery_images[srl].length;
|
||||
idx++;
|
||||
if(idx>max_length-1) idx = 0;
|
||||
display_gallery_image(slide_gallery_images[srl][idx]);
|
||||
}
|
||||
|
||||
// 썸네일 보기
|
||||
function gallery_view_thumbnail(srl) {
|
||||
var thumbnail_zone = xGetElementById("zone_thumbnail_"+srl);
|
||||
if(thumbnail_zone.style.display == "none") thumbnail_zone.style.display = "block";
|
||||
else thumbnail_zone.style.display = "none";
|
||||
}
|
||||
|
||||
BIN
modules/editor/components/image_link/icon.gif
Normal file
|
After Width: | Height: | Size: 1,019 B |
66
modules/editor/components/image_link/image_link.class.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
/**
|
||||
* @class image_link
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 이미지를 추가하거나 속성을 수정하는 컴포넌트
|
||||
**/
|
||||
|
||||
class image_link extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function image_link($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
Context::set("tpl_path", $tpl_path);
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method
|
||||
*
|
||||
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
|
||||
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
||||
**/
|
||||
function transHTML($xml_obj) {
|
||||
$src = $xml_obj->attrs->src;
|
||||
$alt = $xml_obj->attrs->alt;
|
||||
$width = $xml_obj->attrs->width;
|
||||
$height = $xml_obj->attrs->height;
|
||||
$align = $xml_obj->attrs->align;
|
||||
$border = $xml_obj->attrs->border;
|
||||
|
||||
$src = str_replace(array('&','"'), array('&','&qout;'), $src);
|
||||
if(!$alt) $alt = $src;
|
||||
|
||||
$output = array();
|
||||
$output = array("src=\"".$src."\"");
|
||||
if($alt) $output[] = "alt=\"".$alt."\"";
|
||||
if($alt) $output[] = "title=\"".$alt."\"";
|
||||
if($width) $output[] = "width=\"".$width."\"";
|
||||
if($height) $output[] = "height=\"".$height."\"";
|
||||
if($align) $output[] = "align=\"".$align."\"";
|
||||
if($border) $output[] = "border=\"".$border."\"";
|
||||
return "<img ".implode(" ", $output)." />";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
8
modules/editor/components/image_link/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">이미지 추가</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">에디터에 이미지를 추가하거나 속성을 변경할 수 있습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
19
modules/editor/components/image_link/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/image_link/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈 > 이미지링크(image_link) 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->image_url = "이미지 경로";
|
||||
$lang->image_alt = "설명 입력";
|
||||
$lang->image_scale = "이미지크기";
|
||||
$lang->image_align = "정렬 방법 ";
|
||||
$lang->image_align_normal = "한 문단을 차지";
|
||||
$lang->image_align_left = "글의 왼쪽으로";
|
||||
$lang->image_align_middle = "가운데";
|
||||
$lang->image_align_right = "글의 우측으로";
|
||||
$lang->image_border = "경계선 두께";
|
||||
|
||||
$lang->cmd_get_scale = "크기 구하기";
|
||||
?>
|
||||
BIN
modules/editor/components/image_link/tpl/images/align_left.gif
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
modules/editor/components/image_link/tpl/images/align_middle.gif
Normal file
|
After Width: | Height: | Size: 382 B |
BIN
modules/editor/components/image_link/tpl/images/align_normal.gif
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
modules/editor/components/image_link/tpl/images/align_right.gif
Normal file
|
After Width: | Height: | Size: 368 B |
79
modules/editor/components/image_link/tpl/popup.css
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
@charset "utf-8";
|
||||
.editor_window {
|
||||
width:500px;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.editor_title {
|
||||
font-size:10pt;
|
||||
font-weight:bold;
|
||||
clear:both;
|
||||
height:20px;
|
||||
background-color:#555555;
|
||||
color:#EFEFEF;
|
||||
vertical-align:middle;
|
||||
padding-top:5px;
|
||||
border-bottom:1px solid #000000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.header {
|
||||
float:left;
|
||||
width:100px;
|
||||
clear:left;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.body {
|
||||
float:left;
|
||||
width:350px;
|
||||
text-align:left;
|
||||
margin:5px;
|
||||
font-size:9pt;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.body label {
|
||||
cursor:pointer;
|
||||
font-size:9pt;
|
||||
}
|
||||
|
||||
.image_align {
|
||||
margin:0px 0px 5px 0px;
|
||||
float:left;
|
||||
width:150px;
|
||||
}
|
||||
|
||||
.image_url {
|
||||
width:350px;
|
||||
height:13px;
|
||||
font-size:9pt;
|
||||
border:1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.editor_input {
|
||||
width:40px;
|
||||
height:13px;
|
||||
font-size:9pt;
|
||||
border:1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
.editor_button_area {
|
||||
border-top:1px solid #AAAAAA;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding:2px 0px 2px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
margin-top:4px;
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
height:18px;
|
||||
font-size:9pt;
|
||||
}
|
||||
67
modules/editor/components/image_link/tpl/popup.html
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<div class="editor_window">
|
||||
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="winopen('./?module=editor&act=viewComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
|
||||
|
||||
<div class="header">{$lang->image_url}</div>
|
||||
<div class="body"><input type="text" class="image_url" id="image_url" value="{url_decode($manual_url)}" onblur="getImageScale();" /></div>
|
||||
|
||||
<div class="header">{$lang->image_scale}</div>
|
||||
<div class="body">
|
||||
<input type="text" class="editor_input" id="width" value="0" />px
|
||||
<input type="text" class="editor_input" id="height" value="0" />px
|
||||
<input type="button" value="{$lang->cmd_get_scale}" class="editor_button" onclick="getImageScale();return false;" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="header">{$lang->image_alt}</div>
|
||||
<div class="body"><input type="text" class="image_url" id="image_alt" value="" /></div>
|
||||
|
||||
<div class="header">{$lang->image_align}</div>
|
||||
<div class="body">
|
||||
<div class="image_align">
|
||||
<input type="radio" name="align" value="" id="align_normal" checked="true"/>
|
||||
<label for="align_normal">
|
||||
<img src="./images/align_normal.gif" alt="{$lang->image_align_normal}" />
|
||||
{$lang->image_align_normal}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="image_align">
|
||||
<input type="radio" name="align" value="left" id="align_left" />
|
||||
<label for="align_left">
|
||||
<img src="./images/align_left.gif" alt="{$lang->image_align_left}" />
|
||||
{$lang->image_align_left}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="image_align">
|
||||
<input type="radio" name="align" value="middle" id="align_middle" />
|
||||
<label for="align_middle">
|
||||
<img src="./images/align_middle.gif" alt="{$lang->image_align_middle}" />
|
||||
{$lang->image_align_middle}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="image_align">
|
||||
<input type="radio" name="align" value="right" id="align_right" />
|
||||
<label for="align_right">
|
||||
<img src="./images/align_right.gif" alt="{$lang->image_align_right}" />
|
||||
{$lang->image_align_right}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="header">{$lang->image_border}</div>
|
||||
<div class="body"><input type="text" class="editor_input" id="image_border" value="0" />px</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertImage()" />
|
||||
<input type="button" value="{$lang->cmd_close}" class="editor_button" onclick="window.close();" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
92
modules/editor/components/image_link/tpl/popup.js
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 이미지가 있는지 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
function getImage() {
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
// url이 미리 입력되어 있을 경우 scale구해줌
|
||||
if(xGetElementById("image_url").value) {
|
||||
getImageScale();
|
||||
return;
|
||||
}
|
||||
|
||||
// 부모 위지윅 에디터에서 선택된 영역이 있으면 처리
|
||||
var node = opener.editorPrevNode;
|
||||
if(!node || node.nodeName != "IMG") {
|
||||
return;
|
||||
}
|
||||
var src = node.getAttribute("src");
|
||||
var border = node.getAttribute("border");
|
||||
var align = node.getAttribute("align");
|
||||
var alt = node.getAttribute("alt");
|
||||
var width = node.getAttribute("width");
|
||||
var height = node.getAttribute("height");
|
||||
|
||||
xGetElementById("image_url").value = src;
|
||||
xGetElementById("image_alt").value = alt;
|
||||
|
||||
switch(align) {
|
||||
case 'left' : xGetElementById("align_left").checked = true; break;
|
||||
case 'middle' : xGetElementById("align_middle").checked = true; break;
|
||||
case 'right' : xGetElementById("align_right").checked = true; break;
|
||||
default : xGetElementById("align_normal").checked = true; break;
|
||||
}
|
||||
|
||||
xGetElementById("image_border").value = border;
|
||||
|
||||
xGetElementById("width").value = width;
|
||||
xGetElementById("height").value = height;
|
||||
|
||||
}
|
||||
|
||||
function getImageScale() {
|
||||
var url = xGetElementById("image_url").value;
|
||||
if(!url) return;
|
||||
|
||||
var img = new Image();
|
||||
img.src = url;
|
||||
|
||||
xGetElementById("width").value = img.width;
|
||||
xGetElementById("height").value = img.height;
|
||||
|
||||
}
|
||||
function insertImage(obj) {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var url = xGetElementById("image_url").value;
|
||||
var alt = xGetElementById("image_alt").value;
|
||||
var align = "";
|
||||
if(xGetElementById("align_normal").checked==true) align = "";
|
||||
else if(xGetElementById("align_left").checked==true) align = "left";
|
||||
else if(xGetElementById("align_middle").checked==true) align = "middle";
|
||||
else if(xGetElementById("align_right").checked==true) align = "right";
|
||||
var border = parseInt(xGetElementById("image_border").value,10);
|
||||
|
||||
var width = xGetElementById("width").value;
|
||||
var height = xGetElementById("height").value;
|
||||
|
||||
if(!url) {
|
||||
window.close();
|
||||
return;
|
||||
}
|
||||
|
||||
var text = "<img editor_component=\"image_link\" src=\""+url+"\" border=\""+border+"\" ";
|
||||
if(alt) text+= " alt=\""+alt+"\"";
|
||||
if(align) text+= " align=\""+align+"\" ";
|
||||
if(width) text+= " width=\""+width+"\" ";
|
||||
if(height) text+= " height=\""+height+"\" ";
|
||||
text+= " />";
|
||||
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", getImage);
|
||||
BIN
modules/editor/components/multimedia_link/icon.gif
Normal file
|
After Width: | Height: | Size: 1 KiB |
8
modules/editor/components/multimedia_link/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">멀티미디어 자료 관리</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">에디터에 wmv,avi,flv등의 멀티미디어 자료를 추가하거나 속성을 수정할 수 있습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
13
modules/editor/components/multimedia_link/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/multimedia_link/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈 > 멀티미디어 링크 (multimedia_link) 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->multimedia_url = "멀티미디어 경로";
|
||||
$lang->multimedia_caption = "설명 입력";
|
||||
$lang->multimedia_width = "가로크기";
|
||||
$lang->multimedia_height = "세로크기";
|
||||
$lang->multimedia_auto_start = "자동시작";
|
||||
?>
|
||||