mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@614 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
4ebffe05b9
commit
55f420bd67
5 changed files with 273 additions and 3 deletions
|
|
@ -41,7 +41,12 @@
|
|||
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
|
||||
**/
|
||||
function transHTML($xml_obj) {
|
||||
return;
|
||||
$width = $xml_obj->attrs->width;
|
||||
$height = $xml_obj->attrs->height;
|
||||
$body = $xml_obj->body;
|
||||
|
||||
$output = sprintf('<div style="width:%s;height:%s">%s</div>', $width, $height, $body);
|
||||
return $output;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
<!--%import("slide_show.js")-->
|
||||
<script type='text/javascript'>
|
||||
var _tmp_srl = {$srl};
|
||||
z_gallery_opacity[_tmp_srl] = 0.3;
|
||||
z_gallery_highlight_speed[_tmp_srl] = 50; // ms
|
||||
z_gallery_highlight_opacity[_tmp_srl] = 0.1;
|
||||
|
||||
{foreach from=$file_list item=obj}
|
||||
{if $obj->thumbnail_url}
|
||||
z_add_gallery(_tmp_srl,'{$obj->thumbnail_url}','{$obj->download_url}');
|
||||
{/if}
|
||||
{/foreach}
|
||||
</script>
|
||||
|
||||
<div style="border:1px solid #DDDDDD;">
|
||||
<div id='zone_gallery_{$srl}' style='width:auto;background-Color:#FFFFFF;padding:10px 10px 10px 10px;text-align:center;'>
|
||||
<span style="color:#000000;font-size:8pt;">loading...</span>
|
||||
</div>
|
||||
|
||||
<div id='zone_thumbnail_{$srl}' style='width:auto;background-Color:#FFFFFF;padding:10px 10px 10px 10px;text-align:center;'></div>
|
||||
</div>
|
||||
|
||||
<script type='text/javascript'>
|
||||
_gallery_srl_list[_gallery_srl_list.length] = _tmp_srl;
|
||||
xAddEventListener(window,'load',z_start_gallery);
|
||||
</script>
|
||||
|
||||
232
modules/editor/components/slide_show/slideshow/slide_show.js
Normal file
232
modules/editor/components/slide_show/slideshow/slide_show.js
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
/**********************************************************
|
||||
* image gallery in zeroboard5
|
||||
* created by zero (zero@nzeo.com, http://www.nzeo.com)
|
||||
*********************************************************/
|
||||
|
||||
var z_gallery_opacity = new Array();
|
||||
var z_gallery_highlight_speed = new Array();
|
||||
var z_gallery_highlight_opacity = new Array();
|
||||
|
||||
var _gallery_srl_list = new Array();
|
||||
var _gallery_images = new Array();
|
||||
var _gallery_idx = new Array();
|
||||
var _obj_thumbnail = new Array();
|
||||
|
||||
function z_add_gallery(srl, thumbnail_url, source_file_url) {
|
||||
var obj = new Array();
|
||||
|
||||
var image = new Image();
|
||||
image.src = source_file_url;
|
||||
|
||||
var t_image = new Image();
|
||||
t_image.src = thumbnail_url.replace("&","&");
|
||||
|
||||
obj['thumbnail_url'] = thumbnail_url;
|
||||
obj['source_url'] = source_file_url;
|
||||
obj['thumbnail'] = t_image;
|
||||
obj['gallery'] = image;
|
||||
|
||||
if(typeof(_gallery_images[srl])=='undefined') {
|
||||
_gallery_images[srl] = new Array();
|
||||
_gallery_idx[srl] = 0;
|
||||
_obj_thumbnail[srl] = new Array();
|
||||
}
|
||||
|
||||
_gallery_images[srl][_gallery_images[srl].length] = obj;
|
||||
}
|
||||
|
||||
function z_start_gallery() {
|
||||
|
||||
for(var i = 0; i < _gallery_srl_list.length; i++) {
|
||||
var srl = _gallery_srl_list[i];
|
||||
|
||||
if(!_gallery_images[srl].length) continue;
|
||||
|
||||
var zone_gallery = xGetElementById('zone_gallery_'+srl);
|
||||
var zone_thumbnail = xGetElementById('zone_thumbnail_'+srl);
|
||||
|
||||
xInnerHtml(zone_gallery,'');
|
||||
|
||||
var obj = _gallery_images[srl][0];
|
||||
|
||||
var obj_gallery = new Image();
|
||||
obj_gallery.src = obj['gallery'].src;
|
||||
obj_gallery.id = 'main_gallery_'+srl;
|
||||
obj_gallery.srl = srl;
|
||||
obj_gallery.style.cursor = 'pointer';
|
||||
obj_gallery.style.opacity = 1;
|
||||
obj_gallery.style.filter = "alpha(opacity=100)";
|
||||
obj_gallery.start_opacity = 0;
|
||||
|
||||
zone_gallery.appendChild(obj_gallery);
|
||||
|
||||
for(var idx = 0; idx < _gallery_images[srl].length; idx++) {
|
||||
var s_obj = _gallery_images[srl][idx];
|
||||
|
||||
if(s_obj) {
|
||||
_obj_thumbnail[srl][idx] = new Image();
|
||||
_obj_thumbnail[srl][idx].src = s_obj['thumbnail'].src;
|
||||
_obj_thumbnail[srl][idx].start_opacity = 0;
|
||||
_obj_thumbnail[srl][idx].id = 'thumbnail_'+srl+'_'+idx;
|
||||
_obj_thumbnail[srl][idx].srl = srl;
|
||||
_obj_thumbnail[srl][idx].idx = idx;
|
||||
_obj_thumbnail[srl][idx].style.cursor = 'pointer';
|
||||
if(idx == _gallery_idx[srl]) {
|
||||
_obj_thumbnail[srl][idx].style.opacity = 1;
|
||||
_obj_thumbnail[srl][idx].style.filter = "alpha(opacity=100)";
|
||||
} else {
|
||||
_obj_thumbnail[srl][idx].style.opacity = 0.3;
|
||||
_obj_thumbnail[srl][idx].style.filter = "alpha(opacity=30)";
|
||||
}
|
||||
_obj_thumbnail[srl][idx].style.margin = '0px 5px 5px 5px';
|
||||
zone_thumbnail.appendChild(_obj_thumbnail[srl][idx]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(xIE4Up) {
|
||||
xAddEventListener(document,'mousewheel',z_gallery_check_wheel);
|
||||
}
|
||||
xAddEventListener(document,'mouseup',z_change_gallery);
|
||||
xAddEventListener(document,'mouseover',z_gallery_do_focus);
|
||||
xAddEventListener(document,'mouseout',z_gallery_do_focusout);
|
||||
|
||||
_gallery_srl_list = new Array();
|
||||
}
|
||||
|
||||
function z_show_gallery(srl, idx) {
|
||||
if(!_gallery_images[srl].length) return;
|
||||
if(_gallery_idx[srl] == idx) return;
|
||||
|
||||
_gallery_idx[srl] = idx;
|
||||
|
||||
var obj = _gallery_images[srl][_gallery_idx[srl]];
|
||||
var obj_gallery = xGetElementById('main_gallery_'+srl);
|
||||
if(obj['gallery'].src == obj_gallery.src) return;
|
||||
|
||||
obj_gallery.parentNode.removeChild(obj_gallery);
|
||||
|
||||
obj_gallery = new Image();
|
||||
obj_gallery.src = obj['gallery'].src;
|
||||
obj_gallery.id = 'main_gallery_'+srl;
|
||||
obj_gallery.srl = srl;
|
||||
obj_gallery.style.cursor = 'pointer';
|
||||
|
||||
obj_gallery.start_opacity = 0;
|
||||
obj_gallery.style.width = obj['gallery'].width;
|
||||
obj_gallery.style.height = obj['gallery'].height;
|
||||
obj_gallery.style.opacity = 0;
|
||||
obj_gallery.style.filter = "alpha(opacity=0)";
|
||||
obj_gallery.start_opacity = 1;
|
||||
|
||||
var zone_gallery = xGetElementById('zone_gallery_'+srl);
|
||||
zone_gallery.appendChild(obj_gallery);
|
||||
|
||||
setTimeout(function _start() {z_gallery_opacity_up(obj_gallery,z_gallery_opacity[srl],z_gallery_highlight_opacity[srl]);}, z_gallery_highlight_speed[srl]);
|
||||
|
||||
for(var idx = 0; idx < _gallery_images[srl].length; idx ++) {
|
||||
var s_obj = xGetElementById('thumbnail_'+srl+'_'+idx);
|
||||
if(!s_obj) continue;
|
||||
|
||||
if(idx == _gallery_idx[srl]) {
|
||||
s_obj.style.opacity = 1;
|
||||
s_obj.style.filter = "alpha(opacity=100)";
|
||||
} else {
|
||||
s_obj.style.opacity = z_gallery_opacity[srl];
|
||||
s_obj.style.filter = "alpha(opacity="+(z_gallery_opacity[srl]*100)+")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function z_gallery_opacity_up(obj,opacity,up) {
|
||||
var srl = obj.srl;
|
||||
if(obj.start_opacity!=1) {
|
||||
if(obj.id == 'main_gallery_'+srl || obj.idx == _gallery_idx[srl]) {
|
||||
obj.style.opacity = 1;
|
||||
obj.style.filter = "alpha(opacity=100)";
|
||||
} else {
|
||||
obj.style.opacity = z_gallery_opacity[srl];
|
||||
obj.style.filter = "alpha(opacity="+(z_gallery_opacity[srl]*100)+")";
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(opacity<1) {
|
||||
up = z_gallery_highlight_opacity[srl];
|
||||
opacity += up;
|
||||
if(opacity>=1) opacity = 1.0;
|
||||
if(opacity>=0.5) opacity = 1.0;
|
||||
obj.style.opacity = opacity;
|
||||
obj.style.filter = "alpha(opacity="+(opacity*100)+")";
|
||||
if(opacity<1) setTimeout(function _opacity_up() {z_gallery_opacity_up(obj, opacity,up);},z_gallery_highlight_speed[srl]);
|
||||
} else {
|
||||
obj.start_opacity = 0;
|
||||
}
|
||||
}
|
||||
|
||||
function z_change_next_gallery(srl) {
|
||||
var idx = _gallery_idx[srl] +1;
|
||||
if(idx>=_gallery_images[srl].length) idx = 0;
|
||||
setTimeout(function show_gallery() { z_show_gallery(srl, idx); }, 50);
|
||||
}
|
||||
|
||||
function z_change_prev_gallery(srl) {
|
||||
var idx = _gallery_idx[srl] -1;
|
||||
if(idx<0) idx = _gallery_images[srl].length-1;
|
||||
setTimeout(function show_gallery() { z_show_gallery(srl, idx); }, 50);
|
||||
}
|
||||
|
||||
function z_change_gallery(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
var srl = obj.srl;
|
||||
var idx = obj.idx;
|
||||
if(typeof(srl)=='undefined') return;
|
||||
if(typeof(idx)=='undefined') z_change_next_gallery(srl);
|
||||
else {
|
||||
setTimeout(function show_gallery() { z_show_gallery(srl, idx); }, 50);
|
||||
}
|
||||
}
|
||||
|
||||
function z_gallery_do_focus(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
var srl = obj.srl;
|
||||
if(typeof(srl)=='undefined') return;
|
||||
if(obj.idx == _gallery_idx[srl]) return;
|
||||
if(obj.id == 'main_gallery_'+srl) return;
|
||||
obj.start_opacity = 1;
|
||||
z_gallery_opacity_up(obj,z_gallery_opacity[srl],z_gallery_highlight_opacity[srl]);
|
||||
xPreventDefault(evt);
|
||||
xStopPropagation(evt);
|
||||
}
|
||||
|
||||
function z_gallery_do_focusout(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
var srl = obj.srl;
|
||||
if(typeof(srl)=='undefined') return;
|
||||
if(obj.idx == _gallery_idx[srl]) return;
|
||||
if(obj.id == 'main_gallery_'+srl) return;
|
||||
obj.start_opacity = 0;
|
||||
obj.style.opacity = z_gallery_opacity[srl];
|
||||
obj.style.filter = "alpha(opacity="+(z_gallery_opacity[srl]*100)+")";
|
||||
}
|
||||
|
||||
function z_gallery_check_wheel(evt) {
|
||||
var e = new xEvent(evt);
|
||||
var obj = e.target;
|
||||
var srl = obj.srl;
|
||||
if(typeof(srl)=='undefined') return;
|
||||
if(e.target.id != 'main_gallery_'+srl) return;
|
||||
if(evt.wheelDelta<0) z_change_next_gallery(srl);
|
||||
else z_change_prev_gallery(srl);
|
||||
xPreventDefault(evt);
|
||||
xStopPropagation(evt);
|
||||
}
|
||||
|
||||
function zb5_board_cancel(url) {
|
||||
if(!confirm(alert_msg['msg_cancel'])) return false;
|
||||
location.href=url;
|
||||
return false;
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
<div class="body"><input type="text" class="editor_input" id="height" value="600" />px</div>
|
||||
|
||||
<div class="header">{$lang->cmd_make_thumbnail}</div>
|
||||
<div class="body"><input type="checkbox" name="make_thumbnail" value="Y" checked="true" /></div>
|
||||
<div class="body"><input type="checkbox" id="make_thumbnail" value="Y" checked="true" /></div>
|
||||
|
||||
<div class="header">{$lang->image_list}</div>
|
||||
<div class="body">
|
||||
|
|
|
|||
|
|
@ -11,8 +11,11 @@ function getSlideShow() {
|
|||
|
||||
var width = xWidth(selected_node)-6;
|
||||
var height = xHeight(selected_node)-6;
|
||||
var make_thumbnail = selected_node.getAttribute("make_thumbnail");
|
||||
xGetElementById("width").value = width;
|
||||
xGetElementById("height").value = height;
|
||||
if(make_thumbnail=="Y") xGetElementById("make_thumbnail").checked = true;
|
||||
else xGetElementById("make_thumbnail").checked = false;
|
||||
|
||||
selected_images = xInnerHtml(selected_node);
|
||||
}
|
||||
|
|
@ -61,6 +64,8 @@ function insertSlideShow() {
|
|||
|
||||
var width = xGetElementById("width").value;
|
||||
var height = xGetElementById("height").value;
|
||||
var make_thumbnail = "N";
|
||||
if(xGetElementById("make_thumbnail").checked) make_thumbnail = "Y";
|
||||
var images_list = "";
|
||||
for(var i=0; i<list.length;i++) {
|
||||
images_list += list[i]+"\n";
|
||||
|
|
@ -70,11 +75,12 @@ function insertSlideShow() {
|
|||
if(selected_node) {
|
||||
selected_node.setAttribute("width", width);
|
||||
selected_node.setAttribute("height", height);
|
||||
selected_node.setAttribute("make_thumbnail", make_thumbnail);
|
||||
selected_node.style.width = width+"px";
|
||||
selected_node.style.height = height+"px";
|
||||
xInnerHtml(selected_node, images_list);
|
||||
} else {
|
||||
var text = "<div editor_component=\"slide_show\" class=\"editor_component_output\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;\" >"+images_list+"</div>";
|
||||
var text = "<div editor_component=\"slide_show\" class=\"editor_component_output\" make_thumbnail=\""+make_thumbnail+"\" width=\""+width+"\" height=\""+height+"\" style=\"width:"+width+"px;height:"+height+"px;\" >"+images_list+"</div>";
|
||||
opener.editorFocus(opener.editorPrevSrl);
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue