설문조사 Simple 스킨 재구성 등

- Simple 스킨을 의미에 맞게 `SIMPLE` 하게 만들어 넣음 (default 스킨 기반)
- 사용하지 않게 된 이미지 삭제
- 설문조사 컴포넌트 팝업창 author 정보 정확하게 표현하도록 수정
This commit is contained in:
MinSoo Kim 2016-01-26 18:00:27 +09:00
parent 19b3c09455
commit 189fa00294
20 changed files with 457 additions and 523 deletions

View file

@ -38,7 +38,6 @@ $(function(){
});
})(jQuery);
</script>
</div>
</div>
<div class="x_control-group">
@ -46,7 +45,7 @@ $(function(){
<div class="x_controls">
<select id="skin" name="skin">
<!--@foreach($skin_list as $skin=>$skin_info)-->
<option value="{$skin}">{$skin_info->title} (skin by <!--@foreach($skin_info->author as $author=>$author_info)-->{@ $authorname = array(); $authorname[] = $author_info->name; }<!--@end-->{implode(",",$authorname)})</option>
<option value="{$skin}">{$skin_info->title} (by {@ $authorname = array();}<!--@foreach($skin_info->author as $author=>$author_info)-->{@ $authorname[] = $author_info->name; }<!--@end-->{implode(",",$authorname)})</option>
<!--@end-->
</select>
</div>

View file

@ -1,6 +1,6 @@
.rx_poll_default_wrap{max-width:100%;}
.pollWidget{padding:5px;}
.rx_poll_default{border-radius: 10px;border:1px solid #e0e0e0;overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","돋움",Dotum,"애플 SD 산돌고딕 Neo","Apple SD Gothic Neo",AppleGothic,Helvetica,sans-serif;}
.rx_poll_default_wrap .pollWidget{padding:5px;}
.rx_poll_default{border-radius: 10px;border:1px solid #e0e0e0;overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","애플 SD 산돌고딕 Neo","Apple SD Gothic Neo","돋움",Dotum,AppleGothic,Helvetica,sans-serif;}
.rx_poll_default .rx_poll_header{padding:13px 15px 10px;overflow:auto;background: #000;background: linear-gradient(-180deg, #212121, #424242);color:#e0e0e0;}
.rx_poll_default .rx_poll_h_strong{color:#FFFFFF;font-weight:bold}
.rx_poll_default .rx_poll_content{padding: 15px;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 523 B

View file

@ -50,7 +50,7 @@
</div>
{{/each}}
</script>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'widgets/pollWidget/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'widgets/pollWidget/skins/default/form/' . $poll_srl" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="poll" action="./" method="post" onsubmit="return doRxDefaultPoll(this)">
@ -60,7 +60,7 @@
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="xe_validator_id" value="widgets/pollWidget/skins/default/form/1" />
<input type="hidden" name="xe_validator_id" value="widgets/pollWidget/skins/default/form/{$poll_srl}" />
<section class="rx_poll_default">
<div class="rx_poll_header">
<div style="float:left">
@ -115,7 +115,7 @@
<input type="button" id="btn_load_more_{{poll_item_srl}}" value="{$lang->more}" onclick="showRxDefaultPollMemberNext({{poll_srl}},{{poll_item_srl}});return false;" style="width:100%;" class="btn" />
{{/if}}
</script>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/default/form/' . $poll_srl" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<section class="rx_poll_default">

View file

@ -1,30 +1,30 @@
.simple_poll { table-layout:fixed; padding:0; margin:0; border:none;}
.rx_poll_smpl_wrap{max-width:100%;}
.rx_poll_smpl_wrap .pollWidget{padding:5px;}
.rx_poll_smpl{box-shadow: 0 0 2px rgba(0, 0, 0, 0.25);overflow:auto; background-color:#ffffff; color:#000000; font-size:12px; font-family:"Open Sans","나눔바른고딕",NanumBarunGothic,"맑은 고딕","Malgun Gothic","애플 SD 산돌고딕 Neo","Apple SD Gothic Neo","돋움",Dotum,AppleGothic,Helvetica,sans-serif;}
.rx_poll_smpl .rx_poll_header{padding:13px 15px 10px;overflow:auto;border-bottom:2px solid #bdbdbd;}
.rx_poll_smpl .rx_poll_h_strong{font-weight:bold}
.rx_poll_smpl .rx_poll_content{padding: 15px;}
.rx_poll_smpl .rx_poll_content .title{border-bottom:2px solid #bdbdbd;font-weight:bold;padding:7px;margin-bottom:10px}
.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item,.rx_poll_smpl .rx_poll_content .poll_vote .checkcount,.rx_poll_smpl .rx_poll_content .poll_vote .poll_item label{padding: 10px 5px;}
.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item .item_text strong{display:inline-block; padding-right:10px; margin-right:10px;border-right:2px solid #e0e0e0;}
.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item>div.item_bar{height:22px;position:relative;margin:6px 0px;background-color:#eeeeee;}
.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item>div.item_bar div.item_bar{position:absolute;top:0px;left:0;background-color:#66bb6a;}
.rx_poll_smpl .rx_poll_content .rx_poll_smpl_item div.item_bar .item_bar_text{position:absolute;top:0px;right:3px;}
.rx_poll_smpl div.poll_button{border-top:1px solid #bdbdbd;padding:10px 15px;width:auto;text-align:center}
.rx_poll_smpl .rx_poll_content .poll_vote{margin:5px 0px 10px;}
.rx_poll_smpl .rx_poll_content .poll_vote .poll_item, .rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add{position:relative;border-bottom:1px solid #e0e0e0;}
.rx_poll_smpl .rx_poll_content .poll_vote .poll_item label{display:block;width:auto;}
.rx_poll_smpl .rx_poll_content .poll_vote .poll_item .poll_item_delete{position:absolute;right:0;top:7px;}
.simple_poll td { padding:0; margin:0; }
.simple_poll td.title { text-align:right; }
.simple_poll td .itemDiv { border-top:1px solid #BBBBBB; margin-top:3px; padding:3px 0 3px 0; }
.simple_poll td .title { color:#000000; font-weight:bold; letter-spacing:-1px;}
.simple_poll td .checkcount { color:#AAAAAA; }
.simple_poll td .item { color:#636363; margin:5px 0 5px 0; }
.simple_poll td .item input { margin:0; padding:0; }
.simple_poll td .item label { letter-spacing:-1px; }
.simple_poll td .resultItem { color:#636363; margin:6px 0 0 10px; letter-spacing:-1px;}
.simple_poll td .barBox { margin-left:10px; }
.simple_poll td .barBox .bar { margin:3px 0;}
.simple_poll td .barBox .status {color:#AAAAAA; }
.simple_poll td.stopDate { color:#AAAAAA; border-top:1px solid #BBBBBB; padding-top:3px;}
.simple_poll td.stopDate a { color:#AAAAAA; text-decoration:none; }
.simple_poll td.poll_button { text-align:left; padding-top:3px;}
.simple_poll td.poll_button .poll_button { border:1px solid #EEEEEE; background-color:#AAAAAA; color:#FFFFFF; font-weight:bold; padding:1px 3px 1px 3px; height:20px; }
.simple_poll td.b { background-color:#F6F6F5; height:7px; }
.simple_poll td.b img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
.simple_poll td.bb { height:7px; }
.simple_poll td.bb img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
.rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add input[type="text"]{
width:100%;
box-sizing: border-box;
line-height: 25px;
font-size: 14px;
margin: 0;
padding: 8px 50px 8px 5px;
outline: none;
border: none;
border-bottom:1px solid #e0e0e0;
}
.rx_poll_smpl .rx_poll_content .poll_vote .poll_item_add input[type="button"]{position:absolute;right:0;top:7px;}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 328 B

View file

@ -1,404 +1,334 @@
function initTemplete(type)
function initRxSmplTemplete(type, poll_srl)
{
switch(type)
{
case 'poll':
if(typeof window.template == 'undefined')
{
var source = jQuery("#entry-template").html();
window.template = Handlebars.compile(source);
}
break;
case 'result':
if(typeof window.template_result == 'undefined')
{
var source = jQuery("#entry-template-result").html();
window.template_result = Handlebars.compile(source);
}
break;
case 'members':
if(typeof window.template_member == 'undefined')
{
var source = jQuery("#entry-template-members").html();
window.template_member = Handlebars.compile(source);
}
break;
}
switch(type)
{
case 'poll':
if (typeof window.poll_smpl_template == 'undefined')
{
var source = jQuery("#smpl-template-" + poll_srl).html();
window.poll_smpl_template = Handlebars.compile(source);
}
break;
case 'result':
if (typeof window.poll_smpl_template_result == 'undefined')
{
var source = jQuery("#smpl-template-result-" + poll_srl).html();
window.poll_smpl_template_result = Handlebars.compile(source);
}
break;
case 'members':
if (typeof window.poll_smpl_template_member == 'undefined')
{
var source = jQuery("#smpl-template-members-" + poll_srl).html();
window.poll_smpl_template_member = Handlebars.compile(source);
}
break;
}
}
/* 설문 참여 함수 */
function doPoll(fo_obj) {
function doRxSmplPoll(fo_obj) {
var checkcount = new Array();
var item = new Array();
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;
}
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();
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;
}
}
}
} 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;
}
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;
poll_srl_indexes += items.join(',')+',';
}
fo_obj.poll_srl_indexes.value = poll_srl_indexes;
jQuery.exec_json("poll.procPoll", {"poll_srl":poll_srl,"poll_srl_indexes":poll_srl_indexes}, function(data){
if (data.error != 0) {
alert(data.message);
}
else {
loadRxSmplPollResult(poll_srl);
jQuery("#poll_" + poll_srl + "_gotoresult_button").css({
display: "none"
});
jQuery.exec_json("poll.procPoll", {"poll_srl":poll_srl,"poll_srl_indexes":poll_srl_indexes}, function(data){
if(data.error!=0) alert(data.message);
else
{
loadPollResult(poll_srl);
jQuery("#poll_" + poll_srl + "_gotoresult_button").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "block"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "table-row"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
}
});
return false;
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
}
});
return false;
}
/* 항목 추가 함수 */
function addItem(poll_srl,poll_srl_indexes) {
jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){
if(data.error!=0) alert(data.message);
else
{
jQuery("#poll_" + poll_srl + "_result_button").css({
display: "none"
});
function addRxSmplItem(poll_srl, poll_srl_indexes) {
jQuery.exec_json("poll.procPollInsertItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "title":jQuery("#new_item_" + poll_srl_indexes).val()}, function(data){
if (data.error!=0) {
alert(data.message);
}
else {
jQuery("#poll_" + poll_srl + "_result_button").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "table-row"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "block"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
loadPoll(poll_srl);
}
});
return false;
loadRxSmplPoll(poll_srl);
}
});
return false;
}
/* 항목 삭제 함수 */
function deleteItem(poll_srl,poll_srl_indexes,poll_item_srl) {
jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl,"index_srl":poll_srl_indexes,"item_srl":poll_item_srl}, function(data){
if(data.error!=0) alert(data.message);
else
{
jQuery("#poll_" + poll_srl + "_result_button").css({
display: "none"
});
function deleteRxSmplItem(poll_srl, poll_srl_indexes, poll_item_srl) {
jQuery.exec_json("poll.procPollDeleteItem", {"srl":poll_srl, "index_srl":poll_srl_indexes, "item_srl":poll_item_srl}, function(data){
if (data.error!=0) {
alert(data.message);
}
else {
jQuery("#poll_" + poll_srl + "_result_button").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "table-row"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "block"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "none"
});
loadPoll(poll_srl);
}
});
return false;
loadRxSmplPoll(poll_srl);
}
});
return false;
}
function loadPoll(poll_srl,data)
function loadRxSmplPoll(poll_srl, data)
{
if(typeof data == 'undefined')
{
jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){
loadPoll(parseInt(data.poll.poll_srl),data);
});
}
else
{
jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date);
if (typeof data == 'undefined') {
jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){
loadRxSmplPoll(parseInt(data.poll.poll_srl), data);
});
}
else {
jQuery("#stop_date_"+poll_srl).html(data.poll.stop_date);
initTemplete('poll');
var template = window.template;
var context = Object;
var additem = data.caniadditem;
context.questions = {};
for (var i in data.poll.poll) {
var poll = data.poll.poll[i];
context.questions[i] = {};
context.questions[i].poll_index_srl = poll.poll_index_srl;
context.questions[i].checkcount = poll.checkcount;
context.questions[i].title = poll.title;
context.questions[i].items = poll.item;
context.questions[i].poll_srl = poll_srl;
context.questions[i].isMultipleChoice = (poll.checkcount>1);
context.questions[i].additem = additem;
}
var html = template(context);
initRxSmplTemplete('poll', poll_srl);
var template = window.poll_smpl_template;
var context = Object;
var additem = data.caniadditem;
context.questions = {};
for (var i in data.poll.poll) {
var poll = data.poll.poll[i];
context.questions[i] = {};
context.questions[i].poll_index_srl = poll.poll_index_srl;
context.questions[i].checkcount = poll.checkcount;
context.questions[i].title = poll.title;
context.questions[i].items = poll.item;
context.questions[i].poll_srl = poll_srl;
context.questions[i].isMultipleChoice = (poll.checkcount > 1);
context.questions[i].additem = additem;
}
var html = template(context);
jQuery("#poll_content_" + poll_srl).html(html);
jQuery("#poll_content_" + poll_srl).html(html);
jQuery("#poll_" + poll_srl).css({
display: "block"
});
jQuery("#poll_" + poll_srl + '_result').css({
display: "none"
});
}
jQuery("#poll_" + poll_srl).css({
display: "block"
});
jQuery("#poll_" + poll_srl + '_result').css({
display: "none"
});
}
}
function showPollMemberNext(poll_srl,poll_item_srl)
function showRxSmplPollMemberNext(poll_srl, poll_item_srl)
{
if(typeof window.cur_page == 'undefined')
{
window.cur_page = 1;
}
if (typeof window.cur_page == 'undefined') {
window.cur_page = 1;
}
window.cur_page++;
window.cur_page++;
jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){
initTemplete('members');
var template = window.template_member;
var context = Object;
jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){
initRxSmplTemplete('members', poll_srl);
var template = window.poll_smpl_template_member;
var context = Object;
context.poll_srl = poll_srl;
context.poll_item_srl = poll_item_srl;
context.page = window.cur_page;
context.isPage = ((data.page.total_count>5) && (window.cur_page<data.page.total_page));
context.poll_srl = poll_srl;
context.poll_item_srl = poll_item_srl;
context.page = window.cur_page;
context.isPage = ((data.page.total_count > 5) && (window.cur_page < data.page.total_page));
context.members = {};
context.members = {};
for (var i in data.item.member) {
var member = data.item.member[i];
for (var i in data.item.member) {
var member = data.item.member[i];
context.members[i] = {};
context.members[i].profile_image = member.profile_image;
context.members[i].member_srl = member.member_srl;
context.members[i].nick_name = member.nick_name;
context.members[i].isImage = (member.profile_image != '');
context.members[i].dummy_profile = data.dummy_profile;
}
var html = template(context);
context.members[i] = {};
context.members[i].profile_image = member.profile_image;
context.members[i].member_srl = member.member_srl;
context.members[i].nick_name = member.nick_name;
context.members[i].isImage = (member.profile_image != '');
context.members[i].dummy_profile = data.dummy_profile;
}
var html = template(context);
jQuery("#btn_load_more_" + poll_item_srl).replaceWith(html);
});
return false;
}
function showPollMember(poll_srl,poll_item_srl)
{
window.cur_page = 1;
jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl,"poll_item":poll_item_srl,"page":window.cur_page}, function(data){
initTemplete('members');
var template = window.template_member;
var context = Object;
var title = poll_member_lang;
title = title.replace("%s",data.item.title);
var html = '<div class="itemDiv"><div class="title">' + title + '</div><ul>';
context.poll_srl = poll_srl;
context.poll_item_srl = poll_item_srl;
context.page = window.cur_page;
context.isPage = ((data.page.total_count>5) && (window.cur_page<data.page.total_count));
context.members = {};
for (var i in data.item.member) {
var member = data.item.member[i];
context.members[i] = {};
context.members[i].profile_image = member.profile_image;
context.members[i].member_srl = member.member_srl;
context.members[i].nick_name = member.nick_name;
context.members[i].isImage = (member.profile_image != '');
context.members[i].dummy_profile = data.dummy_profile;
}
html = html + template(context) + '</ul></div>';
jQuery("#poll_content_" + poll_srl + "_result").html(html);
jQuery("#poll_" + poll_srl + "_gotoresult_button").css({
display: "table-row"
});
jQuery("#poll_" + poll_srl + "_result_nobutton").css({
display: "none"
});
jQuery("#poll_" + poll_srl + "_result_yesbutton").css({
display: "table-row"
});
});
return false;
}
function loadPollResult(poll_srl,data)
{
if(typeof data == 'undefined')
{
jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){
loadPollResult(parseInt(data.poll.poll_srl),data);
});
}
else
{
jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date);
jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count);
initTemplete('result');
var template = window.template_result;
var context = Object;
var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3);
context.questions = {};
for (var i in data.poll.poll) {
var poll = data.poll.poll[i];
context.questions[i] = {};
context.questions[i].poll_index_srl = poll.poll_index_srl;
context.questions[i].checkcount = poll.checkcount;
context.questions[i].title = poll.title;
context.questions[i].poll_count = poll.poll_count;
context.questions[i].showMembers = showMembers;
context.questions[i].items = poll.item;
var count = 0;
for (var j in poll.item) {
var item = poll.item[j];
count++;
if(poll.poll_count>0)
{
context.questions[i].items[j].per = Math.round((item.poll_count / poll.poll_count)*100);
context.questions[i].items[j].isVote = true;
}
else
{
context.questions[i].items[j].per = 0;
context.questions[i].items[j].isVote = false;
}
context.questions[i].items[j].number = count;
}
context.questions[i].items = poll.item;
context.questions[i].poll_srl = poll_srl;
context.questions[i].isMultipleChoice = (poll.checkcount>1);
}
var html = template(context);
jQuery("#poll_content_" + poll_srl + "_result").html(html);
jQuery("#poll_" + poll_srl).css({
display: "none"
});
jQuery("#poll_" + poll_srl + '_result').css({
display: "block"
});
}
}
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];
}catch(e){ };
if(!srl) return false;
jQuery("#poll_" + srl + "_result_button").css({
display: "table-row"
});
jQuery("#poll_" + srl + "_result_nobutton").css({
display: "none"
});
jQuery("#poll_" + srl + "_result_yesbutton").css({
display: "table-row"
});
loadPollResult(srl);
return false;
jQuery("#btn_load_more_" + poll_item_srl).replaceWith(html);
});
/* goto poll result */
$('._gotoresult_screen').click(function(){
var cls = $(this).attr('class'), srl, skin;
return false;
}
try{
srl = cls.match(/\b_srl_(\d+)\b/)[1];
}catch(e){ };
function showRxSmplPollMember(poll_srl, poll_item_srl)
{
window.cur_page = 1;
if(!srl) return false;
jQuery.exec_json("poll.getPollitemInfo", {"poll_srl":poll_srl, "poll_item":poll_item_srl, "page":window.cur_page}, function(data){
initRxSmplTemplete('members', poll_srl);
var template = window.poll_smpl_template_member;
var context = Object;
var title = poll_member_lang;
title = title.replace("%s", data.item.title);
var html = '<div class="title">' + title + '</div><ul>';
context.poll_srl = poll_srl;
context.poll_item_srl = poll_item_srl;
context.page = window.cur_page;
context.isPage = ((data.page.total_count > 5) && (window.cur_page < data.page.total_count));
jQuery("#poll_" + srl + "_gotoresult_button").css({
display: "none"
});
context.members = {};
jQuery("#poll_" + srl + "_result_nobutton").css({
display: "table-row"
});
for (var i in data.item.member) {
var member = data.item.member[i];
jQuery("#poll_" + srl + "_result_yesbutton").css({
display: "none"
});
context.members[i] = {};
context.members[i].profile_image = member.profile_image;
context.members[i].member_srl = member.member_srl;
context.members[i].nick_name = member.nick_name;
context.members[i].isImage = (member.profile_image != '');
context.members[i].dummy_profile = data.dummy_profile;
}
html = html + template(context) + '</ul>';
loadPollResult(srl);
jQuery("#poll_content_" + poll_srl + "_result").html(html);
return false;
});
jQuery("#poll_" + poll_srl + '_result_button').css({
display: "none"
});
jQuery("#poll_" + poll_srl + '_gotoresult_button').css({
display: "block"
});
});
/* View poll screen */
$('._poll_screen').click(function(){
var cls = $(this).attr('class'), srl, skin;
return false;
}
try{
srl = cls.match(/\b_srl_(\d+)\b/)[1];
}catch(e){ };
function loadRxSmplPollResult(poll_srl, data)
{
if (typeof data == 'undefined') {
jQuery.exec_json("poll.getPollinfo", {"poll_srl":poll_srl}, function(data){
loadRxSmplPollResult(parseInt(data.poll.poll_srl), data);
});
}
else {
jQuery("#stop_date_result_" + poll_srl).html(data.poll.stop_date);
jQuery("#poll_count_result_" + poll_srl).html(data.poll.poll_count);
if(!srl) return false;
initRxSmplTemplete('result', poll_srl);
var template = window.poll_smpl_template_result;
var context = Object;
var showMembers = (data.poll.poll_type==1 || data.poll.poll_type==3);
context.questions = {};
for (var i in data.poll.poll) {
var poll = data.poll.poll[i];
context.questions[i] = {};
context.questions[i].poll_index_srl = poll.poll_index_srl;
context.questions[i].checkcount = poll.checkcount;
context.questions[i].title = poll.title;
context.questions[i].poll_count = poll.poll_count;
context.questions[i].showMembers = showMembers;
context.questions[i].items = poll.item;
var count = 0;
for (var j in poll.item) {
var item = poll.item[j];
count++;
if (poll.poll_count > 0) {
context.questions[i].items[j].per = Math.round((item.poll_count / poll.poll_count)*100);
context.questions[i].items[j].isVote = true;
}
else {
context.questions[i].items[j].per = 0;
context.questions[i].items[j].isVote = false;
}
context.questions[i].items[j].number = count;
}
context.questions[i].items = poll.item;
context.questions[i].poll_srl = poll_srl;
context.questions[i].isMultipleChoice = (poll.checkcount > 1);
}
var html = template(context);
jQuery("#poll_" + srl + "_result_button").css({
display: "none"
});
jQuery("#poll_content_" + poll_srl + "_result").html(html);
jQuery("#poll_" + poll_srl).css({
display: "none"
});
jQuery("#poll_" + poll_srl + '_result').css({
display: "block"
});
jQuery("#poll_" + srl + "_result_nobutton").css({
display: "table-row"
});
// do not display back to result button, because, this is that page.
jQuery("#poll_" + poll_srl + '_gotoresult_button').css({
display: "none"
});
jQuery("#poll_" + srl + "_result_yesbutton").css({
display: "none"
});
loadPoll(srl);
return false;
});
});
// Check if the user have voted or not. If xe (he or she) have done, do not display back to the poll button
if (data.poll.is_polled == 0) {
jQuery("#poll_" + poll_srl + '_result_button').css({
display: "block"
});
}
else {
jQuery("#poll_" + poll_srl + '_result_button').css({
display: "none"
});
}
}
}

View file

@ -3,113 +3,107 @@
var poll_alert_lang = "{$lang->msg_check_poll_item}";
var poll_checkcount_lang = "{$lang->poll_checkcount}";
var poll_member_lang = "{$lang->poll_item_members}";
jQuery(document).ready(function(){
var data = {json_encode($poll_data)};
if(data.poll.is_polled==0) loadPoll({$poll_srl},data);
else
{
loadPollResult({$poll_srl},data);
jQuery("#poll_{$poll_srl}_result_button").css({
display: "none"
});
jQuery("#poll_{$poll_srl}_result_nobutton").css({
display: "table-row"
});
jQuery("#poll_{$poll_srl}_result_yesbutton").css({
display: "none"
});
}
jQuery(document).ready(function() {
var data = {json_encode($poll_data)};
if (data.poll.is_polled == 0) {
loadRxSmplPoll({$poll_srl},data);
}
else {
loadRxSmplPollResult({$poll_srl},data);
}
});
</script>
<div style="{$style}" class="rx_poll_simple_wrap">
<div style="{$style}" class="rx_poll_smpl_wrap">
<div id="poll_{$poll_srl}" class="pollWidget" style="display:none;">
<script id="entry-template" type="text/x-handlebars-template">
<script id="smpl-template-{$poll_srl}" type="text/x-handlebars-template">
{{#each questions as |question questionid|}}
<div class="itemDiv">
<input type="hidden" name="checkcount_{{question.poll_index_srl}}" value="{{question.checkcount}}" />
<div class="title">{{question.title}}</div>
<div class="poll_vote">
<input type="hidden" name="checkcount_{{question.poll_index_srl}}" value="{{question.checkcount}}" />
<div class="title">Q : {{question.title}}</div>
{{#if question.isMultipleChoice}}
<div class="checkcount">
{$lang->poll_checkcount} : {{question.checkcount}}
</div>
{{/if}}
{{#if question.isMultipleChoice}}
<div class="checkcount">
{$lang->poll_checkcount} : {{question.checkcount}}
</div>
{{/if}}
{{#each question.items as |item itemid|}}
<div class="item">
{{#if question.isMultipleChoice}}
<input type="checkbox" name="item_{{question.poll_srl}}_{{question.poll_index_srl}}" value="{{item.poll_item_srl}}" id="item_{{item.poll_item_srl}}" />
{{else}}
<input type="radio" name="item_{{question.poll_srl}}_{{question.poll_index_srl}}" value="{{item.poll_item_srl}}" id="item_{{item.poll_item_srl}}" />
{{/if}}
<label for="item_{{item.poll_item_srl}}">{{item.title}}</label>
{{#if item.my_item}}
<input type="button" value="x" onclick="deleteItem({{question.poll_srl}},{{question.poll_index_srl}},{{item.poll_item_srl}})" style="float: right;" class="btn poll_button _poll_delete_item" />
{{/if}}
</div>
{{/each}}
{{#if question.additem}}
<div class="item add">
<input type="text" name="new_item" id="new_item_{{question.poll_index_srl}}" value="" /> <input type="button" value="+" onclick="addItem({{question.poll_srl}},{{question.poll_index_srl}})" style="float: right;" class="btn poll_button _poll_add_item" />
</div>
{{/if}}
</div>
{{#each question.items as |item itemid|}}
<div class="poll_item">
<label for="item_{{item.poll_item_srl}}">
{{#if question.isMultipleChoice}}
<input type="checkbox" name="item_{{question.poll_srl}}_{{question.poll_index_srl}}" value="{{item.poll_item_srl}}" id="item_{{item.poll_item_srl}}" />
{{else}}
<input type="radio" name="item_{{question.poll_srl}}_{{question.poll_index_srl}}" value="{{item.poll_item_srl}}" id="item_{{item.poll_item_srl}}" />
{{/if}}
{{item.title}}
</label>
{{#if item.my_item}}
<input type="button" value="x" title="{$lang->delete_poll_item}" onclick="deleteRxSmplItem({{question.poll_srl}},{{question.poll_index_srl}},{{item.poll_item_srl}}); return false;" class="btn poll_item_delete" />
{{/if}}
</div>
{{/each}}
{{#if question.additem}}
<div class="poll_item_add">
<input type="text" name="new_item" id="new_item_{{question.poll_index_srl}}" class="poll_item_add" placeholder="{$lang->msg_can_add_item}" /> <input type="button" value="+" title="{$lang->add_poll_item}" onclick="addRxSmplItem({{question.poll_srl}},{{question.poll_index_srl}}); return false;" style="float: right;" class="btn poll_item_add" />
</div>
{{/if}}
</div>
{{/each}}
</script>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'widgets/pollWidget/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'widgets/pollWidget/skins/simple/form/' . $poll_srl" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="poll" action="./" method="post" onsubmit="return doPoll(this)">
<form ruleset="poll" action="./" method="post" onsubmit="return doRxSmplPoll(this)">
<input type="hidden" name="module" value="poll" />
<input type="hidden" name="act" value="procPoll" />
<input type="hidden" name="poll_srl" value="{$poll_srl}" />
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="xe_validator_id" value="widgets/pollWidget/skins/default/form/1" />
<table cellspacing="0" class="simple_poll">
<tr>
<td id="poll_content_{$poll_srl}" class="poll_content">
</td>
</tr>
<tr>
<td class="stopDate">
~<strong id="stop_date_{$poll_srl}"></strong> (<a href="#" class="_poll_result _srl_{$poll_srl}">{$lang->cmd_view_result}</a>)
</td>
</tr>
<tr>
<td class="poll_button">
<input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" />
</td>
</tr>
</table>
<input type="hidden" name="xe_validator_id" value="widgets/pollWidget/skins/simple/form/{$poll_srl}" />
<section class="rx_poll_smpl">
<div class="rx_poll_header">
<div style="float:left">
{$lang->poll_stop_date}: <time class="rx_poll_h_strong" id="stop_date_{$poll_srl}"></time>
</div>
</div>
<div id="poll_content_{$poll_srl}" class="rx_poll_content">
</div>
<div class="poll_button">
<input type="button" value="{$lang->cmd_view_result}" class="btn" onclick="loadRxSmplPollResult({$poll_srl}); return false;" />
<input type="submit" value="{$lang->cmd_apply_poll}" class="btn" />
</div>
</section>
</form>
</div>
<div id="poll_{$poll_srl}_result" class="pollWidget poll_box" style="display:none;">
<script id="entry-template-result" type="text/x-handlebars-template">
<div class="itemDiv">
<script id="smpl-template-result-{$poll_srl}" type="text/x-handlebars-template">
{{#each questions as |question questionid|}}
<div class="title">{{question.title}} ({{question.poll_count}})</div>
{{#each question.items as |item itemid|}}
<div class="resultItem">
{{#if question.showMembers}}
<a href="#" onclick="showPollMember({{question.poll_srl}},{{item.poll_item_srl}});return false;">{{item.title}}</a>
{{else}}
{{item.title}}
{{/if}}
</div>
<div class="rx_poll_smpl_item">
<div class="item_text">
{{#if question.showMembers}}
<strong>{{item.number}}</strong> <a href="#" onclick="showRxSmplPollMember({{question.poll_srl}},{{item.poll_item_srl}});return false;">{{item.title}}</a>
{{else}}
<strong>{{item.number}}</strong> {{item.title}}
{{/if}}
</div>
<div class="barBox">
<div class="bar"><img src="./images/color_bar.png" style="width:{{item.per}}%;height:6px;" alt="bar" /></div>
<div class="status">{{item.poll_count}} ({{item.per}}%)</div>
<div class="item_bar">
{{#if item.isVote}}
<div class="item_bar" title="{{item.per}}%" style="width:{{item.per}}%;height:22px;">&nbsp;</div>
{{else}}
<div class="item_bar" style="width:1px;height:22px;">&nbsp;</div>
{{/if}}
<div class="item_bar_text">{{item.poll_count}}</strong> ({{item.per}}%)</div>
</div>
</div>
{{/each}}
{{/each}}
</div>
</script>
<script id="entry-template-members" type="text/x-handlebars-template">
<script id="smpl-template-members-{$poll_srl}" type="text/x-handlebars-template">
{{#each members as |member memberid|}}
{{#if member.isImage}}
<li><img src="{{member.profile_image}}" width="16" height="16" /> <a href="#popup_menu_area" class="member_{{member.member_srl}}" onclick="return false">{{member.nick_name}}</a></li>
@ -118,32 +112,33 @@
{{/if}}
{{/each}}
{{#if isPage}}
<input type="button" id="btn_load_more_{{poll_item_srl}}" value="More..." onclick="showPollMemberNext({{poll_srl}},{{poll_item_srl}});return false;" style="width:100%;" class="btn poll_button" />
<input type="button" id="btn_load_more_{{poll_item_srl}}" value="{$lang->more}" onclick="showRxSmplPollMemberNext({{poll_srl}},{{poll_item_srl}});return false;" style="width:100%;" class="btn" />
{{/if}}
</script>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/simple/form/1' . $poll_srl" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<table cellspacing="0" class="simple_poll">
<tr>
<td id="poll_content_{$poll_srl}_result" class="poll_content">
</td>
</tr>
<tr id="poll_{$poll_srl}_result_button" style="width:100%;display: none;">
<td colspan="3" class="poll_button">
<div>
<input type="button" value="{$lang->btn_poll_gotovote}" class="btn poll_button _poll_screen _srl_{$poll_srl}" />
</div>
</td>
</tr>
<tr id="poll_{$poll_srl}_gotoresult_button" style="width:100%;display: none;">
<td colspan="3" class="poll_button">
<div>
<input type="button" value="{$lang->btn_poll_gotoresult}" class="btn poll_button _gotoresult_screen _srl_{$poll_srl}" />
</div>
</td>
</tr>
</table>
<section class="rx_poll_smpl">
<div class="rx_poll_header">
<div style="float:left">
{$lang->poll_stop_date}: <time class="rx_poll_h_strong" id="stop_date_result_{$poll_srl}"></time>
</div>
<div style="float:right">
{$lang->poll_join_count}: <span class="rx_poll_h_strong" id="poll_count_result_{$poll_srl}"></span>
</div>
</div>
<div id="poll_content_{$poll_srl}_result" class="rx_poll_content">
</div>
<div id="poll_{$poll_srl}_result_button" class="rx_poll_footer" style="width:100%;display: none;">
<div class="poll_button">
<input type="button" value="{$lang->btn_poll_gotovote}" class="btn" onclick="loadRxSmplPoll({$poll_srl}); return false;" />
</div>
</div>
<div id="poll_{$poll_srl}_gotoresult_button" class="rx_poll_footer" style="width:100%;display: none;">
<div class="poll_button">
<input type="button" value="{$lang->cmd_view_result}" class="btn" onclick="loadRxSmplPollResult({$poll_srl}); return false;" />
</div>
</div>
</section>
</div>
</div>

View file

@ -1,38 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<skin version="0.2">
<title xml:lang="ko">설문조사 간단한 스킨</title>
<title xml:lang="vi">Skin thăm dò đơn giản</title>
<title xml:lang="jp">アンケート調査の簡単スキン</title>
<title xml:lang="zh-CN">投票系统简易皮肤</title>
<title xml:lang="zh-TW">投票系統簡單面板</title>
<title xml:lang="tr">Oylama Sistem Dış Görünümü</title>
<description xml:lang="ko">설문조사 간단한 스킨</description>
<description xml:lang="vi">Skin hiển thị thăm dò đơn giản.</description>
<description xml:lang="jp">アンケート調査の簡単スキン</description>
<description xml:lang="zh-CN">投票系统简易皮肤。</description>
<description xml:lang="zh-TW">投票系統簡單面板。</description>
<description xml:lang="tr">Oylama Sistemi Dış Görünümü</description>
<version>2.0</version>
<date>2015-06-09</date>
<title xml:lang="ko">설문조사 간단한 스킨</title>
<title xml:lang="vi">Skin thăm dò đơn giản</title>
<title xml:lang="jp">アンケート調査の簡単スキン</title>
<title xml:lang="zh-CN">投票系统简易皮肤</title>
<title xml:lang="zh-TW">投票系統簡單面板</title>
<title xml:lang="tr">Oylama Sistem Dış Görünümü</title>
<description xml:lang="ko">설문 조사 기본스킨보다 선이 강조된 스킨입니다.</description>
<description xml:lang="vi">Skin hiển thị thăm dò đơn giản.</description>
<description xml:lang="jp">アンケート調査の簡単スキン</description>
<description xml:lang="zh-CN">投票系统简易皮肤。</description>
<description xml:lang="zh-TW">投票系統簡單面板。</description>
<description xml:lang="tr">Oylama Sistemi Dış Görünümü</description>
<version>2.0.1</version>
<date>2016-01-26</date>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="vi">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="tr">NAVER</name>
</author>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">misol</name>
<name xml:lang="en">misol</name>
<name xml:lang="vi">misol</name>
<name xml:lang="jp">misol</name>
<name xml:lang="zh-CN">misol</name>
<name xml:lang="zh-TW">misol</name>
<name xml:lang="tr">misol</name>
</author>
<author email_address="developers@xpressengine.com" link="http://xpressengine.com/">
<name xml:lang="ko">NAVER</name>
<name xml:lang="en">NAVER</name>
<name xml:lang="vi">NAVER</name>
<name xml:lang="jp">NAVER</name>
<name xml:lang="zh-CN">NAVER</name>
<name xml:lang="zh-TW">NAVER</name>
<name xml:lang="tr">NAVER</name>
</author>
<colorset>
<color name="normal">
<title xml:lang="ko">기본</title>
<title xml:lang="vi">Mặc định</title>
<title xml:lang="zh-CN">默认</title>
<title xml:lang="jp">デフォルト</title>
<title xml:lang="en">Default</title>
<title xml:lang="zh-TW">預設</title>
<title xml:lang="tr">Varsayılan</title>
</color>
</colorset>
</skin>
<colorset>
<color name="normal">
<title xml:lang="ko">기본</title>
<title xml:lang="vi">Mặc định</title>
<title xml:lang="zh-CN">默认</title>
<title xml:lang="jp">デフォルト</title>
<title xml:lang="en">Default</title>
<title xml:lang="zh-TW">預設</title>
<title xml:lang="tr">Varsayılan</title>
</color>
</colorset>
</skin>