mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-29 08:09:58 +09:00
issue 44 : Remove x-functions from the poll module
git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@8495 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
657061e16a
commit
db7403c469
12 changed files with 63 additions and 92 deletions
75
modules/poll/tpl/js/poll.js
Normal file
75
modules/poll/tpl/js/poll.js
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
/* 설문 참여 함수 */
|
||||
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;
|
||||
}
|
||||
|
||||
jQuery(function($){
|
||||
/* View poll result */
|
||||
$('._poll_result').click(function(){
|
||||
var cls = $(this).attr('class'), srl, skin;
|
||||
|
||||
try{
|
||||
srl = cls.match(/\b_srl_(\d+)\b/)[1];
|
||||
skin = cls.match(/\b_skin_(.+?)\b/)[1];
|
||||
}catch(e){ };
|
||||
|
||||
if(!srl) return false;
|
||||
if(!skin) skin = 'default';
|
||||
|
||||
function on_complete(ret) {
|
||||
var $poll = $('#poll_'+srl), width;
|
||||
|
||||
width = $poll.width();
|
||||
$poll.html(ret['tpl']);
|
||||
$poll.width(width);
|
||||
}
|
||||
|
||||
exec_xml(
|
||||
'poll', // module
|
||||
'procPollViewResult', // act
|
||||
{poll_srl:srl, skin:skin}, // parameters
|
||||
on_complete,
|
||||
['error','message','tpl']
|
||||
);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue