issue 44 : from the multimedia_link editor component

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8496 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
taggon 2011-06-16 03:29:56 +00:00
parent db7403c469
commit 35714ac73e
5 changed files with 65 additions and 59 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<component version="0.2">
<title xml:lang="ko">멀티미디어 자료 관리</title>
<title xml:lang="ko">멀티미디어 링크</title>
<title xml:lang="jp">マルチメディア管理</title>
<title xml:lang="zh-CN">多媒体</title>
<title xml:lang="en">Manage Multimedia Data</title>
<title xml:lang="en">Multimedia Link</title>
<title xml:lang="es">Administrar datos multimedia </title>
<title xml:lang="ru">Управление мультимедиа данными</title>
<title xml:lang="zh-TW">多媒體管理</title>
@ -18,7 +18,7 @@
<description xml:lang="zh-TW">可新增 wmv、avi、flv 等多媒體檔案或修改其相關屬性。</description>
<description xml:lang="vi">Chèn Media dạng '.wmv,.avi,.flv,.mp3,.wma' vào bài viết.</description>
<description xml:lang="tr">wmv, avi, flv gibi çoklu ortam dosyalarını editöre ekleyebilir veya çoklu ortam dosyasının niteliğini değiştirebilir.</description>
<version>0.1</version>
<version>0.2</version>
<date>2007-02-28</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">

View file

@ -1,12 +1,17 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("../lang")-->
<!--@if(__DEBUG__)-->
<load target="popup.css" />
<load target="popup.js" />
<!--@else-->
<load target="popup.min.css" />
<load target="popup.min.js" />
<!--@end-->
<div id="popHeader">
<h3 class="xeAdmin">{$component_info->title} ver. {$component_info->version}</h3>
</div>
<form action="./" method="get" onSubmit="return false" id="fo">
<form action="./" method="get" onsubmit="return false" id="fo">
<div id="popBody">
<table cellspacing="0" class="rowTable">
<col width="150" />
@ -44,8 +49,8 @@
</table>
</div>
<div id="popFooter">
<a href="#" onclick="insertMultimedia()" class="button black strong"><span>{$lang->cmd_insert}</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>
<a href="#" class="button black strong _insert"><span>{$lang->cmd_insert}</span></a>
<a href="./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}" class="button _xe_popup"><span>{$lang->about_component}</span></a>
</div>
</form>

View file

@ -2,69 +2,60 @@
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
function getMultimedia() {
// 부모 위지윅 에디터에서 선택된 영역이 있는지 확인
if(typeof(opener)=="undefined") return;
jQuery(function($){
var node = opener.editorPrevNode;
if(!node || node.nodeName != "IMG") return;
(function(){
if(!is_def(opener)) return;
var url = node.getAttribute("multimedia_src");
var caption = node.getAttribute("alt");
var width = xWidth(node);
var height = xHeight(node);
var auto_start = node.getAttribute("auto_start");
var wmode = node.getAttribute("wmode");
var $node = $(opener.editorPrevNode).filter('img'), attrs;
if(!$node.length) return;
var fo_obj = xGetElementById('fo');
attrs = {
url : $node.attr('multimedia_src'),
caption : $node.attr('alt'),
width : $node.width() - 4,
height : $node.height() - 4,
wmode : $node.attr('wmode')
};
xGetElementById("multimedia_url").value = url;
xGetElementById("multimedia_caption").value = caption;
xGetElementById("multimedia_width").value = width-4;
xGetElementById("multimedia_height").value = height-4;
if(auto_start=="true") xGetElementById("multimedia_auto_start").checked = true;
$.each(attrs, function(key, val) {
get_by_id('multimedia_'+key).value = val;
});
if(wmode == 'window') fo_obj.multimedia_wmode.selectedIndex = 0;
else if(wmode == 'opaque') fo_obj.multimedia_wmode.selectedIndex = 1;
else fo_obj.multimedia_wmode.selectedIndex = 2;
}
})();
function insertMultimedia(obj) {
if(typeof(opener)=="undefined") return;
$('a._insert').click(function(){
if(!is_def(opener)) return;
var url = xGetElementById("multimedia_url").value;
url = url.replace(request_uri,'');
// url = encodeURI(url);
var fo_obj = xGetElementById('fo');
var el_wmode = get_by_id('fo').elements['multimedia_wmode'];
var attrs = {
alt : get_by_id('multimedia_caption').value,
width : get_by_id('multimedia_width').value || 400,
height : get_by_id('multimedia_height').value || 400,
wmode : el_wmode.value || el_wmode.options[0].value,
auto_start : get_by_id('multimedia_auto_start').checked?'true':'false',
multimedia_src : get_by_id('multimedia_url').value.replace(request_uri, '')
};
var wmode = fo_obj.multimedia_wmode.options[fo_obj.multimedia_wmode.selectedIndex].value;
var caption = xGetElementById("multimedia_caption").value;
var width = xGetElementById("multimedia_width").value;
if(!width) width = 400;
var height = xGetElementById("multimedia_height").value;
if(!height) height= 400;
var auto_start = "false";
if(xGetElementById("multimedia_auto_start").checked) auto_start = "true";
if(!url) {
if(!attrs['multimedia_src']) {
window.close();
return;
}
var text = "<img src=\"../../../../common/tpl/images/blank.gif\" editor_component=\"multimedia_link\" multimedia_src=\""+url+"\" width=\""+width+"\" height=\""+height+"\" wmode=\""+wmode+"\" style=\"display:block;width:"+width+"px;height:"+height+"px;border:2px dotted #4371B9;background:url(./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif) no-repeat center;\" auto_start=\""+auto_start+"\" alt=\""+caption+"\" />";
var html = '<img src="../../../../common/tpl/images/blank.gif" editor_component="multimedia_link" multimedia_src="" width="" height="" wmode="" style="display:block;width:'+attrs.width+'px;height:'+attrs.height+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif) no-repeat center" auto_start="" alt="" />';
html = html.replace(/(\w+)=""/, function(m0,m1) {
return attrs[m1] ? (m1+'="'+attrs[m1]+'"') : '';
});
opener.editorFocus(opener.editorPrevSrl);
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
opener.editorReplaceHTML(iframe_obj, text);
opener.editorReplaceHTML(iframe_obj, html);
opener.editorFocus(opener.editorPrevSrl);
window.close();
}
});
xAddEventListener(window, "load", getMultimedia);
});

View file

@ -0,0 +1,5 @@
/**
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
@charset "utf-8";@import "../../../../../modules/admin/tpl/css/admin.css";

View file

@ -0,0 +1,5 @@
/**
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 멀티미디어 컴포넌트 코드를 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
jQuery(function($){(function(){if(!is_def(opener))return;var $node=$(opener.editorPrevNode).filter('img'),attrs;if(!$node.length)return;attrs={url:$node.attr('multimedia_src'),caption:$node.attr('alt'),width:$node.width()-4,height:$node.height()-4,wmode:$node.attr('wmode')};$.each(attrs,function(key,val){get_by_id('multimedia_'+key).value=val})})();$('a._insert').click(function(){if(!is_def(opener))return;var el_wmode=get_by_id('fo').elements['multimedia_wmode'],attrs={alt:get_by_id('multimedia_caption').value,width:get_by_id('multimedia_width').value||400,height:get_by_id('multimedia_height').value||400,wmode:el_wmode.value||el_wmode.options[0].value,auto_start:get_by_id('multimedia_auto_start').checked?'true':'false',multimedia_src:get_by_id('multimedia_url').value.replace(request_uri,'')};if(!attrs.multimedia_src){window.close();return};var html='<img src="../../../../common/tpl/images/blank.gif" editor_component="multimedia_link" multimedia_src="" width="" height="" wmode="" style="display:block;width:'+attrs.width+'px;height:'+attrs.height+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/multimedia_link/tpl/multimedia_link_component.gif) no-repeat center" auto_start="" alt="" />';html=html.replace(/(\w+)=""/,function(m0,m1){return attrs[m1]?(m1+'="'+attrs[m1]+'"'):''});opener.editorFocus(opener.editorPrevSrl);var iframe_obj=opener.editorGetIFrame(opener.editorPrevSrl);opener.editorReplaceHTML(iframe_obj,html);opener.editorFocus(opener.editorPrevSrl);window.close()})})