From 04c56954ea838223f54096b861e707bc9738b949 Mon Sep 17 00:00:00 2001 From: taggon Date: Thu, 8 Dec 2011 09:33:21 +0000 Subject: [PATCH] issue 867: fixed multimedeia component bug git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9924 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/editor/components/multimedia_link/tpl/popup.js | 7 +++++-- modules/editor/components/multimedia_link/tpl/popup.min.js | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/editor/components/multimedia_link/tpl/popup.js b/modules/editor/components/multimedia_link/tpl/popup.js index 789809dff..b217ba909 100644 --- a/modules/editor/components/multimedia_link/tpl/popup.js +++ b/modules/editor/components/multimedia_link/tpl/popup.js @@ -22,6 +22,9 @@ jQuery(function($){ get_by_id('multimedia_'+key).value = val; }); + // auto start? + get_by_id('multimedia_auto_start').checked = ($node.attr('auto_start') == 'true'); + })(); $('.btnArea button').click(function(){ @@ -29,7 +32,7 @@ $('.btnArea button').click(function(){ var el_wmode = get_by_id('fo').elements['multimedia_wmode']; var attrs = { - alt : get_by_id('multimedia_caption').value, + alt : encodeURIComponent(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, @@ -44,7 +47,7 @@ $('.btnArea button').click(function(){ var html = ''; - html = html.replace(/(\w+)=""/, function(m0,m1) { + html = html.replace(/(\w+)=""/g, function(m0,m1) { return attrs[m1] ? (m1+'="'+attrs[m1]+'"') : ''; }); diff --git a/modules/editor/components/multimedia_link/tpl/popup.min.js b/modules/editor/components/multimedia_link/tpl/popup.min.js index 20a71bc7f..c35abf925 100644 --- a/modules/editor/components/multimedia_link/tpl/popup.min.js +++ b/modules/editor/components/multimedia_link/tpl/popup.min.js @@ -2,4 +2,4 @@ * 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})})();$('.btnArea button').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='';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()})}) \ No newline at end of file +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});get_by_id('multimedia_auto_start').checked=($node.attr('auto_start')=='true')})();$('.btnArea button').click(function(){if(!is_def(opener))return;var el_wmode=get_by_id('fo').elements['multimedia_wmode'],attrs={alt:encodeURIComponent(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='';html=html.replace(/(\w+)=""/g,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()})}) \ No newline at end of file