mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9226 201d5d3c-b55e-5fd7-737f-ddc643e51545
10 lines
3.6 KiB
JavaScript
10 lines
3.6 KiB
JavaScript
var selected_node=null;
|
|
function getSlideShow(){var c,b,d="",e,a,f,g;if(typeof opener!="undefined"){c=opener.editorPrevNode;b=jQuery(c);if(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=c=="list"?1:0,get_by_id("gallery_align").selectedIndex=e=="left"?1:e=="right"?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;if(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,d.indexOf(f)!=-1&&(g=!0),a=new Option(a.text,a.value,
|
|
!1,g),c.options.add(a))}}}}
|
|
function insertSlideShow(){if(typeof opener!="undefined"){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){if(b.value.length==6)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"],e="",a=0;a<8;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;a<16;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()});
|