merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -1,78 +1,84 @@
<?php
/**
* @class image_gallery
* @author NHN (developers@xpressengine.com)
* @brief Making images uploaded to the image gallery
**/
/**
* @class image_gallery
* @author NHN (developers@xpressengine.com)
* @brief Making images uploaded to the image gallery
*/
class image_gallery extends EditorHandler
{
// editor_sequence from the editor must attend mandatory wearing ....
var $editor_sequence = 0;
var $component_path = '';
class image_gallery extends EditorHandler {
// editor_sequence from the editor must attend mandatory wearing ....
var $editor_sequence = 0;
var $component_path = '';
/**
* @brief editor_sequence and components out of the path
*/
function image_gallery($editor_sequence, $component_path)
{
$this->editor_sequence = $editor_sequence;
$this->component_path = $component_path;
}
/**
* @brief editor_sequence and components out of the path
**/
function image_gallery($editor_sequence, $component_path) {
$this->editor_sequence = $editor_sequence;
$this->component_path = $component_path;
}
/**
* @brief popup window to display in popup window request is to add content
*/
function getPopupContent()
{
// Pre-compiled source code to compile template return to
$tpl_path = $this->component_path.'tpl';
$tpl_file = 'popup.html';
/**
* @brief popup window to display in popup window request is to add content
**/
function getPopupContent() {
// Pre-compiled source code to compile template return to
$tpl_path = $this->component_path.'tpl';
$tpl_file = 'popup.html';
Context::set("tpl_path", $tpl_path);
Context::set("tpl_path", $tpl_path);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/**
* @brief Editor of the components separately if you use a unique code to the html code for a method to change
*
* Images and multimedia, seolmundeung unique code is required for the editor component added to its own code, and then
* DocumentModule:: transContent() of its components transHtml() method call to change the html code for your own
*/
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;
$color_preg = "/^([a-fA-F0-9]{6})/";
$gallery_info->border_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->border_color);
$gallery_info->bg_color = preg_replace($color_preg,"#$1",$xml_obj->attrs->bg_color);
$gallery_info->gallery_align = $xml_obj->attrs->gallery_align;
/**
* @brief Editor of the components separately if you use a unique code to the html code for a method to change
*
* Images and multimedia, seolmundeung unique code is required for the editor component added to its own code, and then
* DocumentModule:: transContent() of its components transHtml() method call to change the html code for your own
**/
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));
// If you set the output to output the XML code generated a list of the image
if(Context::getResponseMethod() == 'XMLRPC')
{
$output = '';
for($i=0;$i<count($gallery_info->images_list);$i++)
{
$output .= sprintf('<img src="%s" alt="" /><br />', $gallery_info->images_list[$i]);
}
return $output;
}
// HTML gallery output, the output settings via the template for the conversion to generate the html code should
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;
$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));
// If you set the output to output the XML code generated a list of the image
if(Context::getResponseMethod() == 'XMLRPC') {
$output = '';
for($i=0;$i<count($gallery_info->images_list);$i++) {
$output .= sprintf('<img src="%s" alt="" /><br />', $gallery_info->images_list[$i]);
}
return $output;
}
// HTML gallery output, the output settings via the template for the conversion to generate the html code should
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);
Context::set('gallery_info', $gallery_info);
$tpl_path = $this->component_path.'tpl';
Context::set("tpl_path", $tpl_path);
$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';
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);
}
}
?>
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}
/* End of file image_gallery.class.php */
/* Location: ./modules/editor/components/image_gallery/image_gallery.class.php */

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

View file

@ -5,7 +5,7 @@
<load target="gallery.min.js" />
<load target="list_gallery.min.js" />
<!--@end-->
<script type="text/javascript">
<script>
(function(){
var gallery = xe.getApp('gallery')[0];

View file

@ -3,5 +3,5 @@
* @brief List-type image gallery
* @author NHN (developers@xpressengine.com)
**/
(function(k){var h=xe.createPlugin("list",{API_SHOW_LIST:function(i,h){var d=h[0],e,f,j,b,a,g,c;e=this.cast("GET_IMAGES",[d]);if(e.length){d=k("#zone_list_gallery_"+d).empty();width=d.innerWidth();f=0;for(j=e.length;f<j;f++)b=e[f],a=b.$obj.prop("width"),c=b.$obj.prop("height"),0==a&&(a=b.$obj.attr("width")),0==c&&(c=b.$obj.attr("height")),a>width-25&&(g=width-25,a=g/a,c=Math.floor(c*a),a=g,b.$obj.attr("rel","xe_gallery")),d.append(b.$obj),b.$obj.css({width:a+"px",height:c,margin:"0 10px",display:"block"})}}}),
i=xe.getApp("Gallery")[0];i&&i.registerPlugin(new h)})(jQuery);
(function(l){var h=xe.createPlugin("list",{API_SHOW_LIST:function(j,h){var d=h[0],e,f,k,b,a,g,c;e=this.cast("GET_IMAGES",[d]);if(e.length){d=l("#zone_list_gallery_"+d).empty();width=d.innerWidth();f=0;for(k=e.length;f<k;f++)b=e[f],a=b.$obj.prop("width"),c=b.$obj.prop("height"),0==a&&(a=b.$obj.attr("width")),0==c&&(c=b.$obj.attr("height")),a>width-25&&(g=width-25,a=g/a,c=Math.floor(c*a),a=g,b.$obj.attr("rel","xe_gallery")),d.append(b.$obj),b.$obj.css({width:a+"px",height:c,margin:"0 10px",display:"block"})}}}),
j=xe.getApp("Gallery")[0];j&&j.registerPlugin(new h)})(jQuery);

View file

@ -1,35 +1,3 @@
@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; height:200px !important; }
@import url(../../../../../common/css/bootstrap.min.css);

View file

@ -1,80 +1,68 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("../lang")-->
<h1 class="h1">{$component_info->title} ver. {$component_info->version}</h1>
<form action="./" method="get" onSubmit="return false" id="fo">
<section class="section">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
<form action="./" method="get" onSubmit="return false" id="fo" class="x_form-horizontal">
<input type="hidden" name="editor_sequence" value="{$editor_sequence}" />
<div class="table">
<table width="100%" border="1" cellspacing="0">
<col width="120" />
<col />
<tr>
<th scope="row">{$lang->width}</th>
<td><input type="text" 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" 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="7" maxlength="6" 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="7" maxlength="6" 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 class="btnArea">
<span class="btn"><button type="button" onclick="insertSlideShow()">{$lang->cmd_insert}</button></span>
<span class="btn"><a href="./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}" target="_blank" onclick="window.open('this.href','ComponentInfo','width=10,height=10');return false;">{$lang->about_component}</a></span>
</div>
</form>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->width}</label>
<div class="x_controls">
<input type="text" size="3" id="width" value="400" />px
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->gallery_style}</label>
<div class="x_controls">
<select id="gallery_style">
<option value="slide">{$lang->gallery_slide_style}</option>
<option value="list">{$lang->gallery_list_style}</option>
</select>
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->gallery_slide_align}</label>
<div class="x_controls">
<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>
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->gallery_border_thickness}</label>
<div class="x_controls">
<input type="text" size="1" id="border_thickness" value="0" />px
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->gallery_border_color}</label>
<div class="x_controls">
<input type="text" id="border_color_input" class="color-indicator" size="7" maxlength="6" value="#000000" />
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->gallery_bg_color}</label>
<div class="x_controls">
<input type="text" id="bg_color_input" class="color-indicator" size="7" maxlength="6" value="#FFFFFF" />
</div>
</div>
<div class="x_control-group">
<label for="" class="x_control-label">{$lang->image_list}</label>
<div class="x_controls">
<select id="image_list" size="6" multiple="true" class="image_list">
</select>
<p>{$lang->about_image_list}</p>
</div>
</div>
<div class="x_clearfix btnArea">
<div class="x_pull-right">
<button type="button" class="x_btn x_btn-primary" onclick="insertSlideShow()">{$lang->cmd_insert}</button>
<a class="x_btn" href="{getUrl('','module','editor','act','dispEditorComponentInfo','component_name',$component_info->component_name)}" target="_blank" onclick="window.open(this.href,'ComponentInfo','width=10,height=10');return false;">{$lang->about_component}</a>
</div>
</div>
</form>
</section>
<!--%load_js_plugin("ui.colorpicker")-->

View file

@ -11,7 +11,7 @@ function getSlideShow() {
if($node.is('img')) {
selected_node = node;
width = $(node).width() - 4;
width = $node.width();
style = $node.attr('gallery_style');
align = $node.attr('gallery_align') || 'center';
border_color = $node.attr('border_color');
@ -24,10 +24,8 @@ function getSlideShow() {
get_by_id('border_thickness').value = thickness;
get_by_id('border_color_input').value = border_color;
manual_select_color('border', get_by_id('border_color_input'));
get_by_id('bg_color_input').value = bg_color;
manual_select_color("bg", get_by_id('bg_color_input'));
selected_images = $node.attr('images_list');
}
@ -118,43 +116,6 @@ function select_color(type, code) {
get_by_id(type+"_color_input").value = code;
}
/* 수동 색상 변경시 */
function manual_select_color(type, obj) {
if(obj.value.length!=6) return;
code = obj.value;
get_by_id(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>";
}
}
jQuery(function($){
getSlideShow();
});

View file

@ -3,4 +3,4 @@
* @brief Slideshow type image gallery plugin
* @author NHN (developers@xpressengine.com)
**/
@charset "utf-8";@import "../../../../../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;height:200px !important}
@charset "utf-8";@import "../../../../../modules/admin/tpl/css/admin.css";@import "../../../../../common/css/bootstrap.min.css";

View file

@ -1,10 +1,7 @@
var selected_node=null;
function getSlideShow(){var c,b,d="",e,a,f,g;if("undefined"!=typeof opener&&(c=opener.editorPrevNode,b=jQuery(c),b.is("img")&&(selected_node=c,d=$(c).width()-4,c=b.attr("gallery_style"),e=b.attr("gallery_align")||"center",a=b.attr("border_color"),f=b.attr("bg_color"),g=b.attr("border_thickness")||1,get_by_id("width").value=d,get_by_id("gallery_style").selectedIndex="list"==c?1:0,get_by_id("gallery_align").selectedIndex="left"==e?1:"right"==e?2:0,get_by_id("border_thickness").value=g,get_by_id("border_color_input").value=
a,manual_select_color("border",get_by_id("border_color_input")),get_by_id("bg_color_input").value=f,manual_select_color("bg",get_by_id("bg_color_input")),d=b.attr("images_list")),b=get_by_id("fo").editor_sequence.value,b=opener.get_by_id("uploaded_file_list_"+b))){c=get_by_id("image_list");for(e=0;e<b.length;e++){a=b.options[e];f=a.value;if(!f)break;f=opener.uploadedFiles[f].download_url.replace(request_uri,"");/(jpg|jpeg|gif|png)$/i.test(f)&&(g=!1,-1!=d.indexOf(f)&&(g=!0),a=new Option(a.text,a.value,
!1,g),c.options.add(a))}}}
function insertSlideShow(){if("undefined"!=typeof opener){for(var c=[],b=get_by_id("image_list"),d=0;d<b.length;d++){var e=b.options[d];e.selected&&(e=opener.uploadedFiles[e.value].download_url.replace(request_uri,""),c[c.length]=e)}if(c.length){for(var b=get_by_id("width").value,e=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,a=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,f=get_by_id("border_thickness").value,g=get_by_id("border_color_input").value,
i=get_by_id("bg_color_input").value,h="",d=0;d<c.length;d++)h+=c[d].trim()+" ";selected_node?(selected_node.setAttribute("width",b),selected_node.setAttribute("gallery_style",e),selected_node.setAttribute("align",a),selected_node.setAttribute("gallery_align",a),selected_node.setAttribute("border_thickness",f),selected_node.setAttribute("border_color",g),selected_node.setAttribute("bg_color",i),selected_node.setAttribute("images_list",h),selected_node.style.width=b+"px"):(c='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+
b+'" gallery_style="'+e+'" align="'+a+'" gallery_align="'+a+'" border_thickness="'+f+'" border_color="'+g+'" bg_color="'+i+'" style="width:'+b+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+h+'" />',opener.editorFocus(opener.editorPrevSrl),d=opener.editorGetIFrame(opener.editorPrevSrl),opener.editorReplaceHTML(d,c));opener.editorFocus(opener.editorPrevSrl)}window.close()}}
function select_color(c,b){get_by_id(c+"_preview_color").style.backgroundColor="#"+b;get_by_id(c+"_color_input").value=b}function manual_select_color(c,b){6==b.value.length&&(code=b.value,get_by_id(c+"_preview_color").style.backgroundColor="#"+code)}
function printColor(c,b){for(var d="22 44 66 88 AA CC EE".split(" "),e="",a=0;8>a;a+=1)e+=printColorBlock(c,a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16),b);for(a=0;a<d.length;a+=3)for(var f=0;f<d.length;f+=2)for(var g=0;g<d.length;g++)e+=printColorBlock(c,d[a]+d[f]+d[g],b);for(a=8;16>a;a+=1)e+=printColorBlock(c,a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16)+a.toString(16),b);document.write(e)}
function printColorBlock(c,b,d){return'<div style="float:left;background-color:#'+b+'"><img src="'+d+'" class="color_icon" onmouseover="this.className=\'color_icon_over\'" onmouseout="this.className=\'color_icon\'" onclick="select_color(\''+c+"','"+b+'\')" alt="color" /></div>'}jQuery(function(){getSlideShow()});
function getSlideShow(){var b,a,d="",c,e,f,g;if("undefined"!=typeof opener&&(b=opener.editorPrevNode,a=jQuery(b),a.is("img")&&(selected_node=b,d=a.width(),b=a.attr("gallery_style"),c=a.attr("gallery_align")||"center",e=a.attr("border_color"),f=a.attr("bg_color"),g=a.attr("border_thickness")||1,get_by_id("width").value=d,get_by_id("gallery_style").selectedIndex="list"==b?1:0,get_by_id("gallery_align").selectedIndex="left"==c?1:"right"==c?2:0,get_by_id("border_thickness").value=g,get_by_id("border_color_input").value=
e,get_by_id("bg_color_input").value=f,d=a.attr("images_list")),a=get_by_id("fo").editor_sequence.value,a=opener.get_by_id("uploaded_file_list_"+a))){b=get_by_id("image_list");for(c=0;c<a.length;c++){e=a.options[c];f=e.value;if(!f)break;f=opener.uploadedFiles[f].download_url.replace(request_uri,"");/(jpg|jpeg|gif|png)$/i.test(f)&&(g=!1,-1!=d.indexOf(f)&&(g=!0),e=new Option(e.text,e.value,!1,g),b.options.add(e))}}}
function insertSlideShow(){if("undefined"!=typeof opener){for(var b=[],a=get_by_id("image_list"),d=0;d<a.length;d++){var c=a.options[d];c.selected&&(c=opener.uploadedFiles[c.value].download_url.replace(request_uri,""),b[b.length]=c)}if(b.length){for(var a=get_by_id("width").value,c=get_by_id("gallery_style").options[get_by_id("gallery_style").selectedIndex].value,e=get_by_id("gallery_align").options[get_by_id("gallery_align").selectedIndex].value,f=get_by_id("border_thickness").value,g=get_by_id("border_color_input").value,
j=get_by_id("bg_color_input").value,h="",d=0;d<b.length;d++)h+=b[d].trim()+" ";selected_node?(selected_node.setAttribute("width",a),selected_node.setAttribute("gallery_style",c),selected_node.setAttribute("align",e),selected_node.setAttribute("gallery_align",e),selected_node.setAttribute("border_thickness",f),selected_node.setAttribute("border_color",g),selected_node.setAttribute("bg_color",j),selected_node.setAttribute("images_list",h),selected_node.style.width=a+"px"):(b='<img src="../../../../common/img/blank.gif" editor_component="image_gallery" width="'+
a+'" gallery_style="'+c+'" align="'+e+'" gallery_align="'+e+'" border_thickness="'+f+'" border_color="'+g+'" bg_color="'+j+'" style="width:'+a+'px;border:2px dotted #4371B9;background:url(./modules/editor/components/image_gallery/tpl/image_gallery_component.gif) no-repeat center;" images_list="'+h+'" />',opener.editorFocus(opener.editorPrevSrl),d=opener.editorGetIFrame(opener.editorPrevSrl),opener.editorReplaceHTML(d,b));opener.editorFocus(opener.editorPrevSrl)}window.close()}}
function select_color(b,a){get_by_id(b+"_preview_color").style.backgroundColor="#"+a;get_by_id(b+"_color_input").value=a}jQuery(function(){getSlideShow()});

View file

@ -8,7 +8,7 @@
<load target="slide_gallery.min.js" />
<load target="slide_gallery.min.css" />
<!--@end-->
<script type="text/javascript">
<script>
(function(){
var gallery = xe.getApp('gallery')[0];
@ -29,7 +29,7 @@ gallery.cast('SET_STYLE', [{$gallery_info->srl}, 'slide']);
<span class="zone_gallery_navigator_status" title="{$lang->cmd_gallery_thumbnail}" id="zone_gallery_navigator_status_{$gallery_info->srl}">1/1</span>
<a href="#" class="__next"><img src="./images/next.gif" alt="{$lang->cmd_gallery_next}" title="{$lang->cmd_gallery_next}" border="0" /></a>
</div>
<div 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 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 class="slide_gallery_thumbnail_image_box" style="display:none"></div>
<div class="slide_gallery_loading_text">Loading images...</div>
<div class="slide_gallery_placeholder"></div>

View file

@ -3,7 +3,7 @@
* @brief Slideshow type image gallery plugin
* @author NHN (developers@xpressengine.com)
**/
(function(k){var m=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={};this._thumbs={};this._current={}},API_SHOW_SLIDE:function(h,f){var b=this,a=f[0],d="@"+a,c,e,j,i,g,l;c=this.cast("GET_IMAGES",[a]);if(c.length){g=0;for(e=c.length;g<e;g++)if(!c[g].loaded){setTimeout(function(){b.cast("SHOW_SLIDE",f)},200);return}e=k("#zone_slide_gallery_"+a);i=e.find(".slide_gallery_placeholder").css("overflow","hidden");e.find(".slide_gallery_loading_text").remove();
j=e.find(".slide_gallery_thumbnail_image_box").show();g=0;for(l=c.length;g<l;g++)c[g].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:0.5}).click({idx:g},function(c){b.cast("SET_SLIDE",[a,c.data.idx])}).appendTo(j);k("#zone_gallery_navigator_status_"+a).click(function(){j.toggle()});e.find(".__prev").click(function(){b.cast("PREV_SLIDE",[a]);return!1}).end().find(".__next").click(function(){b.cast("NEXT_SLIDE",[a]);return!1});this._holders[d]=i;this._thumbs[d]=j;
this._current[d]=0;this.cast("SET_SLIDE",[a,0])}},_showSideSlide:function(h,f){var b,a;b=this.cast("GET_IMAGES",[h]);b.length&&(a=this._current["@"+h],a+=f,0>a?a=b.length-1:a>=b.length&&(a=0),this.cast("SET_SLIDE",[h,a]))},API_NEXT_SLIDE:function(h,f){this._showSideSlide(f[0],1)},API_PREV_SLIDE:function(h,f){this._showSideSlide(f[0],-1)},API_SET_SLIDE:function(h,f){var b=f[0],a=f[1],d,c,e;d=this.cast("GET_IMAGES",[b]);if(d.length&&is_def(c=d[a]))this._current["@"+b]=a,k("#zone_gallery_navigator_status_"+
b).text(a+1+"/"+d.length),this._thumbs["@"+b].find("img").eq(a).animate({opacity:1}).end().not(":eq("+a+")").animate({opacity:0.5}),b=this._holders["@"+b],d=b.parent().innerWidth(),a=c.$obj.prop("width"),e=c.$obj.prop("height"),0==a&&(a=c.$obj.attr("width")),0==e&&(e=c.$obj.attr("height")),a>d-20&&(d-=20,e=Math.floor(e*(d/a)),a=d,c.$obj.css("cursor","pointer"),c.$obj.attr("rel","xe_gallery")),c.$obj.css({width:a,height:e,margin:"0 10px"}),b.empty().append(c.$obj)}}),i=xe.getApp("Gallery")[0];i&&i.registerPlugin(new m)})(jQuery);
(function(l){var n=xe.createPlugin("slideShow",{_holders:{},_thumbs:{},_current:{},init:function(){this._holders={};this._thumbs={};this._current={}},API_SHOW_SLIDE:function(h,f){var b=this,a=f[0],d="@"+a,c,e,k,j,g,m;c=this.cast("GET_IMAGES",[a]);if(c.length){g=0;for(e=c.length;g<e;g++)if(!c[g].loaded){setTimeout(function(){b.cast("SHOW_SLIDE",f)},200);return}e=l("#zone_slide_gallery_"+a);j=e.find(".slide_gallery_placeholder").css("overflow","hidden");e.find(".slide_gallery_loading_text").remove();
k=e.find(".slide_gallery_thumbnail_image_box").show();g=0;for(m=c.length;g<m;g++)c[g].$obj.clone().css({cursor:"pointer",width:"60px",height:"60px",margin:"5px",opacity:0.5}).click({idx:g},function(c){b.cast("SET_SLIDE",[a,c.data.idx])}).appendTo(k);l("#zone_gallery_navigator_status_"+a).click(function(){k.toggle()});e.find(".__prev").click(function(){b.cast("PREV_SLIDE",[a]);return!1}).end().find(".__next").click(function(){b.cast("NEXT_SLIDE",[a]);return!1});this._holders[d]=j;this._thumbs[d]=k;
this._current[d]=0;this.cast("SET_SLIDE",[a,0])}},_showSideSlide:function(h,f){var b,a;b=this.cast("GET_IMAGES",[h]);b.length&&(a=this._current["@"+h],a+=f,0>a?a=b.length-1:a>=b.length&&(a=0),this.cast("SET_SLIDE",[h,a]))},API_NEXT_SLIDE:function(h,f){this._showSideSlide(f[0],1)},API_PREV_SLIDE:function(h,f){this._showSideSlide(f[0],-1)},API_SET_SLIDE:function(h,f){var b=f[0],a=f[1],d,c,e;d=this.cast("GET_IMAGES",[b]);if(d.length&&is_def(c=d[a]))this._current["@"+b]=a,l("#zone_gallery_navigator_status_"+
b).text(a+1+"/"+d.length),this._thumbs["@"+b].find("img").eq(a).animate({opacity:1}).end().not(":eq("+a+")").animate({opacity:0.5}),b=this._holders["@"+b],d=b.parent().innerWidth(),a=c.$obj.prop("width"),e=c.$obj.prop("height"),0==a&&(a=c.$obj.attr("width")),0==e&&(e=c.$obj.attr("height")),a>d-20&&(d-=20,e=Math.floor(e*(d/a)),a=d,c.$obj.css("cursor","pointer"),c.$obj.attr("rel","xe_gallery")),c.$obj.css({width:a,height:e,margin:"0 10px"}),b.empty().append(c.$obj)}}),j=xe.getApp("Gallery")[0];j&&j.registerPlugin(new n)})(jQuery);