mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 20:29:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@730 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c812b59861
commit
a754922e08
3 changed files with 74 additions and 7 deletions
|
|
@ -25,7 +25,7 @@ function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) {
|
|||
}
|
||||
|
||||
/* 플러그인 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */
|
||||
function doDisplaySkinColorset(sel) {
|
||||
function doDisplaySkinColorset(sel, colorset) {
|
||||
var skin = sel.options[sel.selectedIndex].value;
|
||||
if(!skin) {
|
||||
xGetElementById("colorset_area").style.display = "none";
|
||||
|
|
@ -36,25 +36,87 @@ function doDisplaySkinColorset(sel) {
|
|||
var params = new Array();
|
||||
params["selected_plugin"] = xGetElementById("fo_plugin").selected_plugin.value;
|
||||
params["skin"] = skin;
|
||||
params["colorset"] = colorset;
|
||||
|
||||
var response_tags = new Array("error","message","colorset_list");
|
||||
|
||||
exec_xml("plugin", "procGetColorsetList", params, completeGetSkinColorset, response_tags);
|
||||
exec_xml("plugin", "procGetColorsetList", params, completeGetSkinColorset, response_tags, params);
|
||||
}
|
||||
|
||||
// 서버에서 받아온 컬러셋을 표시
|
||||
function completeGetSkinColorset(ret_obj) {
|
||||
var sel = xGetElementById("fo_plugin").colorset;
|
||||
/* 서버에서 받아온 컬러셋을 표시 */
|
||||
function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) {
|
||||
var sel = xGetElementById("fo_plugin").plugin_colorset;
|
||||
var length = sel.options.length;
|
||||
var selected_colorset = params["colorset"];
|
||||
for(var i=0;i<length;i++) sel.remove(0);
|
||||
|
||||
var colorset_list = ret_obj["colorset_list"].split("\n");
|
||||
var selected_index = 0;
|
||||
for(var i=0;i<colorset_list.length;i++) {
|
||||
var tmp = colorset_list[i].split("|@|");
|
||||
if(selected_colorset && selected_colorset==tmp[0]) selected_index = i;
|
||||
var opt = new Option(tmp[1], tmp[0], false, false);
|
||||
sel.options.add(opt);
|
||||
}
|
||||
|
||||
sel.selectedIndex = selected_index;
|
||||
|
||||
xGetElementById("colorset_area").style.display = "block";
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
/* 페이지 모듈에서 내용의 플러그인을 더블클릭하여 수정하려고 할 경우 */
|
||||
var selected_node = null;
|
||||
function doFillPluginVars() {
|
||||
if(!opener || !opener.editorPrevNode || !opener.editorPrevNode.getAttribute("plugin")) return;
|
||||
|
||||
selected_node = opener.editorPrevNode;
|
||||
|
||||
// 스킨과 컬러셋은 기본
|
||||
var skin = selected_node.getAttribute("skin");
|
||||
var colorset = selected_node.getAttribute("colorset");
|
||||
|
||||
var fo_obj = xGetElementById("fo_plugin");
|
||||
|
||||
for(var name in fo_obj) {
|
||||
var node = fo_obj[name];
|
||||
if(!node || typeof(node)=="undefined") continue;
|
||||
|
||||
var length = node.length;
|
||||
var type = node.type;
|
||||
if((typeof(type)=='undefined'||!type) && typeof(length)!='undefined' && typeof(node[0])!='undefined' && length>0) type = node[0].type;
|
||||
else length = 0;
|
||||
|
||||
switch(type) {
|
||||
case "text" :
|
||||
case "textarea" :
|
||||
var val = selected_node.getAttribute(name);
|
||||
node.value = val;
|
||||
break;
|
||||
case "checkbox" :
|
||||
var val = selected_node.getAttribute(name);
|
||||
for(var i=0;i<fo_obj[name].length;i++) {
|
||||
var v = fo_obj[name][i].value;
|
||||
if(val.indexOf(v)!=-1) fo_obj[name][i].checked="true";
|
||||
}
|
||||
break;
|
||||
case "select" :
|
||||
case "select-one" :
|
||||
var val = selected_node.getAttribute(name);
|
||||
var sel = fo_obj[name];
|
||||
if(!val) break;
|
||||
for(var i=0;i<sel.options.length;i++) {
|
||||
if(sel.options[i].value == val) sel.options[i].selected = true;
|
||||
else sel.options[i].selected = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 컬러셋 설정
|
||||
if(skin && xGetElementById("plugin_colorset").options.length<1 && colorset) {
|
||||
doDisplaySkinColorset(xGetElementById("plugin_skin"), colorset);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="plugin_header">{$lang->skin}</div>
|
||||
<div class="plugin_body">
|
||||
<select name="skin" onchange="doDisplaySkinColorset(this);return false;">
|
||||
<select name="skin" onchange="doDisplaySkinColorset(this,'');return false;" id="plugin_skin">
|
||||
<option value=""> </option>
|
||||
<!--@foreach($skin_list as $key => $val)-->
|
||||
<option value="{$key}">{$val->title} ({$key})</option>
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
<div id="colorset_area" style="display:none">
|
||||
<div class="plugin_header">{$lang->colorset}</div>
|
||||
<div class="plugin_body">
|
||||
<select name="colorset">
|
||||
<select name="colorset" id="plugin_colorset">
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -70,3 +70,7 @@
|
|||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
xAddEventListener(window, "load", doFillPluginVars);
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue