mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-02-01 01:29:58 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@611 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
526fd1ad4d
commit
3c14b0936d
6 changed files with 47 additions and 173 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.4 KiB |
|
|
@ -1,20 +1,13 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @file /modules/editor/components/image_link/lang/ko.lang.php
|
* @file /modules/editor/components/slide_show/lang/ko.lang.php
|
||||||
* @author zero <zero@nzeo.com>
|
* @author zero <zero@nzeo.com>
|
||||||
* @brief 위지윅에디터(editor) 모듈 > 이미지링크(image_link) 컴포넌트의 언어팩
|
* @brief 위지윅에디터(editor) 모듈 > 슬라이드쇼(slide_show) 컴포넌트의 언어팩
|
||||||
**/
|
**/
|
||||||
|
|
||||||
$lang->imagelink = "이미지 자료 연결";
|
$lang->slide_show = "슬라이드쇼 제작";
|
||||||
$lang->image_url = "이미지 경로";
|
$lang->width = "가로크기";
|
||||||
$lang->image_alt = "설명 입력";
|
$lang->height = "세로크기";
|
||||||
$lang->image_scale = "이미지크기";
|
$lang->image_list = "이미지 목록";
|
||||||
$lang->image_align = "정렬 방법 ";
|
$lang->about_image_list = "슬라이드쇼에 추가할 파일을 선택하세요. 선택후 드래그 또는 shift+클릭(범위선택), ctrl+클릭(개별선택) 가능합니다";
|
||||||
$lang->image_align_normal = "한 문단을 차지";
|
|
||||||
$lang->image_align_left = "글의 왼쪽으로";
|
|
||||||
$lang->image_align_middle = "가운데";
|
|
||||||
$lang->image_align_right = "글의 우측으로";
|
|
||||||
$lang->image_border = "경계선 두께";
|
|
||||||
|
|
||||||
$lang->cmd_get_scale = "크기 구하기";
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* @class image_link
|
* @class slide_show
|
||||||
* @author zero (zero@nzeo.com)
|
* @author zero (zero@nzeo.com)
|
||||||
* @brief 이미지를 추가하거나 속성을 수정하는 컴포넌트
|
* @brief 업로드된 이미지로 슬라이드 쇼를 만듬
|
||||||
**/
|
**/
|
||||||
|
|
||||||
class image_link extends EditorHandler {
|
class slide_show extends EditorHandler {
|
||||||
|
|
||||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||||
var $upload_target_srl = 0;
|
var $upload_target_srl = 0;
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||||
**/
|
**/
|
||||||
function image_link($upload_target_srl, $component_path) {
|
function slide_show($upload_target_srl, $component_path) {
|
||||||
$this->upload_target_srl = $upload_target_srl;
|
$this->upload_target_srl = $upload_target_srl;
|
||||||
$this->component_path = $component_path;
|
$this->component_path = $component_path;
|
||||||
}
|
}
|
||||||
|
|
@ -41,25 +41,7 @@
|
||||||
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
||||||
**/
|
**/
|
||||||
function transHTML($xml_obj) {
|
function transHTML($xml_obj) {
|
||||||
$src = $xml_obj->attrs->src;
|
return;
|
||||||
$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)." />";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -35,22 +35,14 @@
|
||||||
font-size:9pt;
|
font-size:9pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
.body label {
|
.image_list {
|
||||||
cursor:pointer;
|
width:380px;
|
||||||
font-size:9pt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.image_align {
|
.about_image_list {
|
||||||
margin:0px 0px 5px 0px;
|
margin-top:10px;
|
||||||
float:left;
|
|
||||||
width:150px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image_url {
|
|
||||||
width:350px;
|
|
||||||
height:13px;
|
|
||||||
font-size:9pt;
|
font-size:9pt;
|
||||||
border:1px solid #AAAAAA;
|
color:#AAAAAA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.editor_input {
|
.editor_input {
|
||||||
|
|
|
||||||
|
|
@ -3,59 +3,26 @@
|
||||||
<!--%import("../lang")-->
|
<!--%import("../lang")-->
|
||||||
|
|
||||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
<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_window">
|
||||||
|
|
||||||
<div class="editor_title">{$lang->imagelink}</div>
|
<div class="editor_title">{$lang->slide_show}</div>
|
||||||
|
|
||||||
<div class="header">{$lang->image_url}</div>
|
<div class="header">{$lang->width}</div>
|
||||||
<div class="body"><input type="text" class="image_url" id="image_url" value="{$manual_url}" onblur="getImageScale();" /></div>
|
<div class="body"><input type="text" class="editor_input" name="width" />px</div>
|
||||||
|
|
||||||
<div class="header">{$lang->image_scale}</div>
|
<div class="header">{$lang->height}</div>
|
||||||
|
<div class="body"><input type="text" class="editor_input" name="height" />px</div>
|
||||||
|
|
||||||
|
<div class="header">{$lang->image_list}</div>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<input type="text" class="editor_input" id="width" value="0" />px
|
<div>
|
||||||
<input type="text" class="editor_input" id="height" value="0" />px
|
<select id="image_list" size="10" class="image_list" multiple="true">
|
||||||
<input type="button" value="{$lang->cmd_get_scale}" class="editor_button" onclick="getImageScale();return false;" />
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="about_image_list">{$lang->about_image_list}</div>
|
||||||
</div>
|
</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">
|
<div class="editor_button_area">
|
||||||
<input type="button" value="{$lang->cmd_insert}" class="editor_button" onclick="insertImage()" />
|
<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();" />
|
<input type="button" value="{$lang->cmd_close}" class="editor_button" onclick="window.close();" />
|
||||||
|
|
|
||||||
|
|
@ -1,92 +1,32 @@
|
||||||
/**
|
var selected_node = null;
|
||||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 이미지가 있는지 체크하여
|
function getSlideShow() {
|
||||||
* 있으면 가져와서 원하는 곳에 삽입
|
// 부모창이 있는지 체크
|
||||||
**/
|
|
||||||
function getImage() {
|
|
||||||
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
|
|
||||||
if(typeof(opener)=="undefined") return;
|
if(typeof(opener)=="undefined") return;
|
||||||
|
|
||||||
// url이 미리 입력되어 있을 경우 scale구해줌
|
// 부모창의 업로드 이미지 목록을 모두 가져와서 세팅
|
||||||
if(xGetElementById("image_url").value) {
|
var fo = xGetElementById("fo");
|
||||||
setTimeout(function() { getImageScale(); }, 500);
|
var upload_target_srl = fo.upload_target_srl.value;
|
||||||
return;
|
var parent_list_obj = opener.xGetElementById("uploaded_file_list_"+upload_target_srl);
|
||||||
|
var list_obj = xGetElementById("image_list");
|
||||||
|
|
||||||
|
var length = parent_list_obj.length;
|
||||||
|
for(var i=0;i<length;i++) {
|
||||||
|
var opt = new Option(parent_list_obj[i].text, parent_list_obj[i].value, false, false);
|
||||||
|
list_obj.options.add(opt);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 부모 위지윅 에디터에서 선택된 영역이 있으면 처리
|
// 부모 위지윅 에디터에서 선택된 영역이 있으면 처리
|
||||||
var node = opener.editorPrevNode;
|
var node = opener.editorPrevNode;
|
||||||
if(!node || node.nodeName != "IMG") {
|
if(!node || node.nodeName != "DIV") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var src = node.getAttribute("src");
|
selected_node = node;
|
||||||
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() {
|
function insertSlideShow(obj) {
|
||||||
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;
|
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();
|
window.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
xAddEventListener(window, "load", getImage);
|
xAddEventListener(window, "load", getSlideShow);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue