git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-12 03:59:52 +00:00
commit 8326004cb2
2773 changed files with 91485 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<?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);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 595 B

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">글의 배경색 변경</title>
<title xml:lang="jp">文字の背景色変更</title>
<title xml:lang="zh-CN">背景颜色</title>
<title xml:lang="en">Change the background color of article</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">글의 배경색을 변경합니다.</description>
<description xml:lang="jp">文字の背景色を変更します。</description>
<description xml:lang="zh-CN">可修改字体背景颜色。</description>
<description xml:lang="en">It will change the background color of article.</description>
</author>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View file

@ -0,0 +1,51 @@
@charset "utf-8";
.colorpicker {
width:275px;
height:100px;
padding:5px;
clear:both;
}
li { list-style:none; float:left; margin-right:5px; }
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 {
text-align:center;
height:25px;
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;
}

View file

@ -0,0 +1,17 @@
<!--%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()">
<ul>
<li><img src="blank.gif" alt="blank" class="preview_color" id="preview_color" /></li>
<li>#</li>
<li><input type="text" id="color_input" size="6" maxlength="6" class="popup_input" value="FFFFFF" onkeyup="manual_select_color(this)"/></li>
<li><input type="submit" value="{$lang->cmd_select}" class="popup_submit"/></li>
</ul>
</form>
</div>

View 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;
}

View file

@ -0,0 +1,37 @@
<?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);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 549 B

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">글자색 변경</title>
<title xml:lang="jp">文字色変更</title>
<title xml:lang="zh-CN">字体颜色</title>
<title xml:lang="en">Change the color of text</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">글자색을 변경합니다.</description>
<description xml:lang="jp">文字色を変更します。</description>
<description xml:lang="zh-CN">可修改字体颜色。</description>
<description xml:lang="en">It will change the color of text.</description>
</author>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

View file

@ -0,0 +1,51 @@
@charset "utf-8";
.colorpicker {
width:275px;
height:100px;
padding:5px;
clear:both;
}
li { list-style:none; float:left; margin-right:5px; }
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 {
text-align:center;
height:25px;
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;
}

View file

@ -0,0 +1,17 @@
<!--%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()">
<ul>
<li><img src="blank.gif" alt="blank" class="preview_color" id="preview_color" /></li>
<li>#</li>
<li><input type="text" id="color_input" size="6" maxlength="6" class="popup_input" value="000000" onkeyup="manual_select_color(this)"/></li>
<li><input type="submit" value="{$lang->cmd_select}" class="popup_submit"/></li>
</ul>
</form>
</div>

View 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;
}

View file

@ -0,0 +1,41 @@
<?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);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">이모티콘 출력</title>
<title xml:lang="jp">顔文字</title>
<title xml:lang="zh-CN">表情图标</title>
<title xml:lang="en">Display Emoticons</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">이모티콘을 에디터에 삽입할 수 있습니다.</description>
<description xml:lang="jp">顔文字(イモティコン)をエディターに追加することができます。</description>
<description xml:lang="zh-CN">可以插入表情图标到编辑器。</description>
<description xml:lang="en">It can insert emoticons to editor.</description>
</author>
</component>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,015 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,022 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,013 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,007 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,016 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 989 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 980 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 987 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,004 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 953 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,9 @@
@charset "utf-8";
@import url(../../../../../../modules/admin/tpl/css/admin.css);
img.emoticon {
margin:10px;
cursor:pointer;
}

View file

@ -0,0 +1,18 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<div id="popHeadder">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
</div>
<div id="popBody">
<!--@foreach($emoticon_list as $emoticon)-->
<img src="images/{$emoticon}" alt="emoticon" onclick="insertEmoticon(this); return false;" class="emoticon" />
<!--@end-->
</div>
<div id="popFooter" class="tCenter">
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>

View file

@ -0,0 +1,15 @@
function insertEmoticon(obj) {
if(typeof(opener)=='undefined') return;
var url = obj.src.replace(request_uri,'');
var text = "<img src=\""+url+"\" 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();
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

@ -0,0 +1,71 @@
<?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);
$oTemplate = &TemplateHandler::getInstance();
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->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;
$images_list = $xml_obj->attrs->images_list;
$images_list = preg_replace('/\.(gif|jpg|jpeg|png) /i',".\\1\n",$images_list);
$gallery_info->images_list = explode("\n",trim($images_list));
preg_match_all('/(width|height)([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
$gallery_info->width = trim($matches[3][0]);
if(!$gallery_info->width) $gallery_info->width = 400;
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';
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
?>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">기본 이미지 갤러리</title>
<title xml:lang="jp">イメージギャラリー</title>
<title xml:lang="zh-CN">图片相册</title>
<title xml:lang="en">Basic Image Gallery</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">첨부된 이미지파일을 이용하여 슬라이드/목록형 이미지 갤러리를 만들 수 있습니다.</description>
<description xml:lang="jp">添付されたイメージファイルを利用して、スライド型・リスト型のイメージギャラリーが作成できます。</description>
<description xml:lang="zh-CN">利用上传的图片文件实现幻灯片式或目录型相册图片。</description>
<description xml:lang="en">It can create image gallery of slide/list style by using attached image file.</description>
</author>
</component>

View file

@ -0,0 +1,27 @@
<?php
/**
* @file /modules/editor/components/image_gallery/lang/en.lang.php
* @author zero <zero@nzeo.com>
* @brief editor module > language pack of image_gallery component.
**/
$lang->image_gallery = "Make Image Gallery";
$lang->width = "Width";
$lang->height = "Height";
$lang->image_list = "Image List";
$lang->gallery_style = "Gallery Style";
$lang->gallery_slide_style = "Slide Style";
$lang->gallery_slide_align = "Align Style";
$lang->gallery_slide_center = "Center";
$lang->gallery_slide_left = "Left";
$lang->gallery_slide_right = "Right";
$lang->gallery_list_style = "Expand All";
$lang->gallery_border_color = "Border Color";
$lang->gallery_border_thickness = "Border Thickness";
$lang->gallery_bg_color = "Background Color";
$lang->about_image_list = "Select file to add to the image gallery. You can drag it after selecting or shift+click(for selecting widely), ctrl+click(for selecting individually)";
$lang->cmd_gallery_prev = "Previous Picture";
$lang->cmd_gallery_next = "Next Picture";
$lang->cmd_gallery_thumbnail = "Thumbnail";
?>

View file

@ -0,0 +1,26 @@
<?php
/**
* @file /modules/editor/components/image_gallery/lang/jp.lang.php
* @author zero <zero@nzeo.com> 翻訳RisaPapa
* @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 = "サムネール表示";
?>

View 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 = "썸네일 보기";
?>

View file

@ -0,0 +1,27 @@
<?php
/**
* @file /modules/editor/components/image_gallery/lang/zh-CN.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 = "查看缩略图il";
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

View file

@ -0,0 +1,14 @@
<!--%import("list_gallery.js")-->
<script type='text/javascript'>
// 이미지갤러리에 보여줄 이미지 등록
<!--@foreach($gallery_info->images_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>

View file

@ -0,0 +1,85 @@
/**
* @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;
if(image_url.indexOf('files')==0) image_url = request_uri+image_url;
// 객체 생성
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";
}
}

View file

@ -0,0 +1,35 @@
@charset "utf-8";
@import url(../../../../../../modules/admin/tpl/css/admin.css);
li { float:left; list-style:none; margin-right:5px; }
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;
}
.editor_color_box { clear:both; height:65px; width:400px; border:1px solid #DDDDDD; padding:2px; }
.image_list { width:100%; border:1px solid #EEEEEE; }

View file

@ -0,0 +1,89 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("../lang")-->
<div id="popHeadder">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
</div>
<form action="./" method="get" onSubmit="return false" id="fo">
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="120" />
<col />
<tr>
<th scope="row">{$lang->width}</th>
<td><input type="text" class="inputTypeText" size="3" id="width" value="400" />px</td>
</tr>
<tr>
<th scope="row">{$lang->gallery_style}</th>
<td>
<select id="gallery_style">
<option value="slide">{$lang->gallery_slide_style}</option>
<option value="list">{$lang->gallery_list_style}</option>
</select>
</td>
</tr>
<tr>
<th scope="row">{$lang->gallery_slide_align}</th>
<td>
<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>
</td>
</tr>
<tr>
<th scope="row">{$lang->gallery_border_thickness}</th>
<td><input type="text" class="inputTypeText" size="1" id="border_thickness" value="0" />px</td>
</tr>
<tr>
<th scope="row">{$lang->gallery_border_color}</th>
<td>
<div class="editor_color_box">
<script type="text/javascript">
printColor("border", "{$tpl_path}/images/blank.gif");
</script>
</div>
<ul class="buttonLeft">
<li><img src="./images/border_solid.gif" alt="blank" class="border_preview_color" id="border_preview_color" /></li>
<li>#<input type="text" id="border_color_input" size="6" maxlength="6" class="inputTypeText" value="000000" onkeyup="manual_select_color('border',this)"/></li>
</ul>
</td>
</tr>
<tr>
<th scope="row">{$lang->gallery_bg_color}</th>
<td>
<div class="editor_color_box">
<script type="text/javascript">
printColor("bg", "{$tpl_path}/images/blank.gif");
</script>
</div>
<ul class="buttonLeft">
<li><img src="./images/blank.gif" alt="blank" class="bg_preview_color" id="bg_preview_color" /></li>
<li>#<input type="text" id="bg_color_input" size="6" maxlength="6" class="inputTypeText" value="FFFFFF" onkeyup="manual_select_color('bg',this)"/></li>
</ul>
</td>
</tr>
<tr>
<th scope="row">{$lang->image_list}</th>
<td>
<select id="image_list" size="6" multiple="true" class="image_list">
</select>
<p>{$lang->about_image_list}</p>
</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter">
<a href="#" onclick="insertSlideShow()" class="button"><span>{$lang->cmd_insert}</span></a>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
<a href="#" onclick="winopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
</div>
</form>

View file

@ -0,0 +1,162 @@
var selected_node = null;
function getSlideShow() {
// 부모창이 있는지 체크
if(typeof(opener)=="undefined") return;
// 부모 위지윅 에디터에서 선택된 영역이 있으면 처리
var node = opener.editorPrevNode;
var selected_images = "";
if(node && node.nodeName == "IMG") {
selected_node = node;
var width = xWidth(selected_node)-4;
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 = selected_node.getAttribute("images_list");
}
// 부모창의 업로드된 파일중 이미지 목록을 모두 가져와서 세팅
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);
if(parent_list_obj) {
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.replace(request_uri,'');
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.replace(request_uri,'');
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()+" ";
}
if(selected_node) {
selected_node.setAttribute("width", width);
selected_node.setAttribute("gallery_style", gallery_style);
selected_node.setAttribute("align", gallery_align);
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.setAttribute("images_list", images_list);
selected_node.style.width = width+"px";
} else {
var text = "<img src=\"./common/tpl/images/blank.gif\" editor_component=\"image_gallery\" width=\""+width+"\" gallery_style=\""+gallery_style+"\" align=\""+gallery_align+"\" gallery_align=\""+gallery_align+"\" border_thickness=\""+border_thickness+"\" border_color=\""+border_color+"\" bg_color=\""+bg_color+"\" style=\"width:"+width+"px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;\" images_list=\""+images_list+"\" />";
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);

View file

@ -0,0 +1,51 @@
@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:center;
}
.slide_gallery_thumbnail_image_box img {
border:1px solid #555555;
padding:1px;
margin:4px;
}
.slide_gallery_filename {
margin:5px 0px 10px 0px;
}
.slide_gallery_filename A {
color:#000000;
text-decoration:none;
}

View file

@ -0,0 +1,26 @@
<!--%import("slide_gallery.js")-->
<!--%import("slide_gallery.css")-->
<!--%import("../lang")-->
<script type='text/javascript'>
// 이미지갤러리에 보여줄 이미지 등록
<!--@foreach($gallery_info->images_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_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_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_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 id='zone_gallery_image_filename_{$gallery_info->srl}' class="slide_gallery_filename"></div>
</div>

View file

@ -0,0 +1,194 @@
/**
* @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;
if(image_url.indexOf('files')==0) image_url = request_uri+image_url;
// 객체 생성
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_url = image_url;
// 원본 이미지를 미리 로딩
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 source_filename = obj.image_url;
var tmp_arr = source_filename.split('/');
var filename = tmp_arr[tmp_arr.length-1];
xInnerHtml("zone_gallery_image_filename_"+obj.srl, "<a href='#' onclick=\"winopen('"+source_filename+"');return false;\">"+unescape(filename)+"</a>");
// 네이게이션 영역의 숫자 변경
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";
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 828 B

View file

@ -0,0 +1,85 @@
<?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);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/**
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 코드를 html로 변경하여 주는 method
*
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
**/
function transHTML($xml_obj) {
$src = $xml_obj->attrs->src;
$width = $xml_obj->attrs->width;
$height = $xml_obj->attrs->height;
$align = $xml_obj->attrs->align;
$alt = $xml_obj->attrs->alt;
$border = $xml_obj->attrs->border;
$link_url = $xml_obj->attrs->link_url;
$open_window = $xml_obj->attrs->open_window;
if(!$alt) {
$tmp_arr = explode('/',$src);
$alt = array_pop($tmp_arr);
}
$src = str_replace(array('&','"'), array('&amp;','&qout;'), $src);
if(!$alt) $alt = $src;
$attr_output = array();
$style_output = array();
$attr_output = array("src=\"".$src."\"");
if($alt) {
$attr_output[] = "alt=\"".$alt."\"";
$attr_output[] = "title=\"".$alt."\"";
}
if($align) $attr_output[] = "align=\"".$align."\"";
if(eregi("\.png$",$src)) $attr_output[] = "class=\"iePngFix\"";
if($width) $style_output[] = "width:".$width."px";
if($height) $style_output[] = "height:".$height."px";
if(!$align) $style_output[] = "display:block";
if($border) $style_output[] = "border:".$border."px";
$code = sprintf("<img %s style=\"%s\" />", implode(" ",$attr_output), implode(";",$style_output));
if($link_url) {
if($open_window =='Y') $code = sprintf('<a href="%s" onclick="window.open(this.href);return false;">%s</a>', $link_url, $code);
else $code = sprintf('<a href="%s" >%s</a>', $link_url, $code);
}
return $code;
}
}
?>

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">이미지 추가</title>
<title xml:lang="jp">イメージ追加</title>
<title xml:lang="zh-CN">插入图像</title>
<title xml:lang="en">Add Images</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">에디터에 이미지를 추가하거나 속성을 변경할 수 있습니다.</description>
<description xml:lang="jp">エディターにイメージを追加したり、属性を変更したりすることができます。</description>
<description xml:lang="zh-CN">可以插入图像或编辑其相应属性。</description>
<description xml:lang="en">It can add an image to editor or change the attribution of image.</description>
</author>
</component>

View file

@ -0,0 +1,21 @@
<?php
/**
* @file /modules/editor/components/image_link/lang/en.lang.php
* @author zero <zero@nzeo.com>
* @brief editor Module > language pack of image_link component
**/
$lang->image_url = "Image Path";
$lang->image_alt = "Input Description";
$lang->image_scale = "Image Size";
$lang->image_align = "Align Style";
$lang->image_align_normal = "Occupy a Paragraph";
$lang->image_align_left = "Left of Article";
$lang->image_align_middle = "Center";
$lang->image_align_right = "Right of Article";
$lang->image_border = "Border Thickness";
$lang->urllink_url = "URL";
$lang->about_url_link_open_window = "Make the link to open as a new window";
$lang->cmd_get_scale = "Get Image Size";
?>

View file

@ -0,0 +1,23 @@
<?php
/**
* @file /modules/editor/components/image_link/lang/jp.lang.php
* @author zero <zero@nzeo.com> 翻訳RisaPapa
* @brief ウィジウィグエディターeditorモジュール > イメージリンクimage_linkコンポネント言語パッケージ
**/
$lang->image_url = "イメージパス";
$lang->image_alt = "説明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->urllink_url = "URL";
$lang->about_url_link_open_window = "チェックするとリンクをクリックした時に、新しいウィンドウで開きます。";
$lang->cmd_get_scale = "サイズ表示";
$lang->cmd_get_scale = "サイズ表示";
?>

View file

@ -0,0 +1,22 @@
<?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->urllink_open_window = "새창열기";
$lang->about_url_link_open_window = "선택하시면 링크 선택시 새창으로 열립니다";
$lang->cmd_get_scale = "크기 구하기";
?>

View file

@ -0,0 +1,21 @@
<?php
/**
* @file /modules/editor/components/image_link/lang/zh-CN.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->urllink_url = "URL";
$lang->about_url_link_open_window = "将在新窗口中打开链接。";
$lang->cmd_get_scale = "获得图片大小";
?>

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 379 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 B

View file

@ -0,0 +1,10 @@
@charset "utf-8";
@import url(../../../../../../modules/admin/tpl/css/admin.css);
.image_align {
margin:0px 0px 5px 0px;
float:left;
width:200px;
}
li {list-style:none; float:left; margin-right:.5em;}

View file

@ -0,0 +1,90 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("../lang")-->
<div id="popHeadder">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
</div>
<form action="./" method="get" onSubmit="return false" id="fo">
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->image_url}</th>
<td><input type="text" id="image_url" value="{url_decode($manual_url)}" onblur="getImageScale();" class="inputTypeText w100" /></td>
</tr>
<tr>
<th scope="row">{$lang->image_scale}</th>
<td>
<ul>
<li><input type="text" id="width" value="0" size="4" class="inputTypeText" onblur="setScale('width');return false;" />px </li>
<li><input type="text" id="height" value="0" size="4" class="inputTypeText" onblur="setScale('height');return false;" />px </li>
<li><a href="#" onclick="getImageScale(); return false;" class="button"><span>{$lang->cmd_get_scale}</span></a></li>
</ul>
</td>
</tr>
<tr>
<th scope="row">URL</th>
<td><input type="text" id="link_url" value="" class="inputTypeText w100"/></td>
</tr>
<tr>
<th scope="row">{$lang->urllink_open_window}</th>
<td><input type="checkbox" id="open_window" value="Y" /> {$lang->about_url_link_open_window}</td>
</tr>
<tr>
<th scope="row">{$lang->image_alt}</th>
<td><input type="text" id="image_alt" value="" class="inputTypeText w100"/></td>
</tr>
<tr>
<th scope="row">{$lang->image_align}</th>
<td>
<div class="image_align">
<input type="radio" name="align" value="" id="align_normal" checked="checked"/>
<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>
</td>
</tr>
<tr>
<th scope="row">{$lang->image_border}</th>
<td><input type="text" id="image_border" value="0" size="2" class="inputTypeText" />px</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter">
<a href="#" onclick="insertImage()" class="button"><span>{$lang->cmd_insert}</span></a>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
<a href="#" onclick="winopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
</div>
</form>

View file

@ -0,0 +1,135 @@
/**
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 이미지가 있는지 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
var orig_width = 0;
var orig_height = 0;
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");
orig_width = width;
orig_height = height;
var link_url = node.getAttribute("link_url");
var open_window = node.getAttribute("open_window");
xGetElementById("image_url").value = src;
xGetElementById("image_alt").value = alt;
if(link_url) {
link_url = link_url.replace(/<([^>]*)>/ig,'').replace(/&lt;/ig,'<').replace(/&gt;/ig,'>').replace(/&amp;/ig,'&');
xGetElementById('link_url').value = link_url;
}
if(open_window == 'Y') xGetElementById('open_window').checked = "true";
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;
orig_width = img.width;
orig_height = img.height;
}
function insertImage(obj) {
if(typeof(opener)=="undefined") return;
var link_url = xGetElementById('link_url').value;
if(link_url) link_url = link_url.replace(/&/ig,'&amp;').replace(/</ig,'&lt;').replace(/>/ig,'&gt;');
var open_window = 'N';
if(xGetElementById('open_window').checked) open_window = 'Y';
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;
}
url = url.replace(request_uri,'');
var text = "<img editor_component=\"image_link\" src=\""+url+"\" border=\""+border+"\" ";
if(alt) text+= " alt=\""+alt+"\"";
if(width) text+= " width=\""+width+"\" ";
if(height) text+= " height=\""+height+"\" ";
if(link_url) text+= " link_url=\""+link_url+"\" ";
if(open_window=='Y') text+= " open_window=\"Y\" ";
if(align) text+= " align=\""+align+"\" ";
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);
function setScale(type) {
switch(type) {
case 'width' :
if(!orig_height) return;
var n_width = xGetElementById('width').value;
var p = n_width/orig_width;
var n_height = parseInt(orig_height * p,10);
xGetElementById('height').value = n_height;
break;
case 'height' :
if(!orig_width) return;
var n_height = xGetElementById('height').value;
var p = n_height/orig_height;
var n_width = parseInt(orig_width * p,10);
xGetElementById('width').value = n_width;
break;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">멀티미디어 자료 관리</title>
<title xml:lang="jp">マルチメディア管理</title>
<title xml:lang="zh-CN">多媒体</title>
<title xml:lang="en">Manage Multimedia Data</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">에디터에 wmv,avi,flv등의 멀티미디어 자료를 추가하거나 속성을 수정할 수 있습니다.</description>
<description xml:lang="jp">エディターに拡張子が「wmv,avi,flv」などのマルチメディアコンテンツを追加したり、属性を修正したりすることができます。</description>
<description xml:lang="zh-CN">插入wmv,avi,flv等多媒体文件或修改其相应属性 。</description>
<description xml:lang="en">It can add multimedia data like wmv,avi,flv to editor or change the attribution of multimedia data.</description>
</author>
</component>

Some files were not shown because too many files have changed in this diff Show more