mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-31 09:09:59 +09:00
#452 설문조사 에디터 컴포넌트로 설문조사 추가시 스킨을 선택할 수 있도록 변경. simple설문조사 스킨 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4111 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f4cde76683
commit
9650a4a22b
16 changed files with 303 additions and 79 deletions
64
modules/poll/skins/simple/js/poll.js
Normal file
64
modules/poll/skins/simple/js/poll.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* 설문 참여 함수 */
|
||||
function doPoll(fo_obj) {
|
||||
|
||||
var checkcount = new Array();
|
||||
var item = new Array();
|
||||
|
||||
for(var i=0;i<fo_obj.length;i++) {
|
||||
var obj = fo_obj[i];
|
||||
if(obj.nodeName != 'INPUT') continue;
|
||||
|
||||
var name = obj.name;
|
||||
if(name.indexOf('checkcount')>-1) {
|
||||
var t = name.split('_');
|
||||
var poll_srl_index = parseInt(t[1],10);
|
||||
checkcount[poll_srl_index] = obj.value;
|
||||
item[poll_srl_index] = new Array();
|
||||
|
||||
} else if(name.indexOf('item_')>-1) {
|
||||
var t = name.split('_');
|
||||
var poll_srl = parseInt(t[1],10);
|
||||
var poll_srl_index = parseInt(t[2],10);
|
||||
if(obj.checked == true) item[poll_srl_index][item[poll_srl_index].length] = obj.value;
|
||||
}
|
||||
}
|
||||
|
||||
var poll_srl_indexes = "";
|
||||
for(var poll_srl_index in checkcount) {
|
||||
if(!checkcount.hasOwnProperty(poll_srl_index)) continue;
|
||||
var count = checkcount[poll_srl_index];
|
||||
var items = item[poll_srl_index];
|
||||
if(items.length < 1 || count < items.length) {
|
||||
alert(poll_alert_lang);
|
||||
return false;
|
||||
}
|
||||
|
||||
poll_srl_indexes += items.join(',')+',';
|
||||
}
|
||||
fo_obj.poll_srl_indexes.value = poll_srl_indexes;
|
||||
|
||||
procFilter(fo_obj, poll);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* 설문 조사후 내용을 바꿀 함수 */
|
||||
function completePoll(ret_obj) {
|
||||
var poll_srl = ret_obj['poll_srl'];
|
||||
var tpl = ret_obj['tpl'];
|
||||
var width = xWidth("poll_"+poll_srl);
|
||||
xInnerHtml("poll_"+poll_srl, tpl);
|
||||
xWidth("poll_"+poll_srl, width);
|
||||
}
|
||||
|
||||
/* 설문 미리 보기 */
|
||||
function doPollViewResult(poll_srl, skin) {
|
||||
var params = new Array();
|
||||
params['poll_srl'] = poll_srl;
|
||||
|
||||
if(typeof(skin)=='undefined') skin = 'default';
|
||||
params['skin'] = skin;
|
||||
|
||||
var response_tags = new Array('error','message','poll_srl', 'tpl');
|
||||
|
||||
exec_xml('poll','procPollViewResult', params, completePoll, response_tags);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue