From 5a6a25dd503c2cf829927c9b8ec6040e7175cf0b Mon Sep 17 00:00:00 2001 From: flyskyko Date: Thu, 31 Jan 2013 02:33:06 +0000 Subject: [PATCH] issue 2877, fixed a bug. does not edit image gallery. git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@12629 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../components/image_gallery/tpl/list_gallery.min.js | 4 ++-- modules/editor/components/image_gallery/tpl/popup.js | 2 +- modules/editor/components/image_gallery/tpl/popup.min.css | 3 +-- modules/editor/components/image_gallery/tpl/popup.min.js | 6 +++--- .../components/image_gallery/tpl/slide_gallery.min.js | 8 ++++---- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/modules/editor/components/image_gallery/tpl/list_gallery.min.js b/modules/editor/components/image_gallery/tpl/list_gallery.min.js index b2c3f13ad..3d9a37584 100644 --- a/modules/editor/components/image_gallery/tpl/list_gallery.min.js +++ b/modules/editor/components/image_gallery/tpl/list_gallery.min.js @@ -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;fwidth-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;fwidth-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); diff --git a/modules/editor/components/image_gallery/tpl/popup.js b/modules/editor/components/image_gallery/tpl/popup.js index 415bef437..eadf833ff 100644 --- a/modules/editor/components/image_gallery/tpl/popup.js +++ b/modules/editor/components/image_gallery/tpl/popup.js @@ -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'); diff --git a/modules/editor/components/image_gallery/tpl/popup.min.css b/modules/editor/components/image_gallery/tpl/popup.min.css index 8831050ae..2dd837b13 100644 --- a/modules/editor/components/image_gallery/tpl/popup.min.css +++ b/modules/editor/components/image_gallery/tpl/popup.min.css @@ -3,5 +3,4 @@ * @brief Slideshow type image gallery plugin * @author NHN (developers@xpressengine.com) **/ -@charset "utf-8"; -@import url(../../../../../modules/admin/tpl/css/admin.css);@import url(../../../../../common/css/bootstrap.min.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";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} \ No newline at end of file diff --git a/modules/editor/components/image_gallery/tpl/popup.min.js b/modules/editor/components/image_gallery/tpl/popup.min.js index 23908af22..86696fe26 100644 --- a/modules/editor/components/image_gallery/tpl/popup.min.js +++ b/modules/editor/components/image_gallery/tpl/popup.min.js @@ -1,10 +1,10 @@ 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= +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=b.width(),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',opener.editorFocus(opener.editorPrevSrl),d=opener.editorGetIFrame(opener.editorPrevSrl),opener.editorReplaceHTML(d,c));opener.editorFocus(opener.editorPrevSrl)}window.close()}} +j=get_by_id("bg_color_input").value,h="",d=0;d',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;aa;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'
color
'}jQuery(function(){getSlideShow()}); diff --git a/modules/editor/components/image_gallery/tpl/slide_gallery.min.js b/modules/editor/components/image_gallery/tpl/slide_gallery.min.js index f32a8e730..ccf3489c3 100644 --- a/modules/editor/components/image_gallery/tpl/slide_gallery.min.js +++ b/modules/editor/components/image_gallery/tpl/slide_gallery.min.js @@ -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;ga?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;ga?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);