Skip to content

Commit

Permalink
Port answers.js which should have been committed with the last commit…
Browse files Browse the repository at this point in the history
… fixing answer submission. This revision fixes a number of bugs that came from the CodeIgnitor branch.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_yii@11765 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Aaron Schmitz committed Dec 26, 2011
1 parent 317ceb2 commit 5748d9d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/admin/answers.js
Expand Up @@ -112,11 +112,11 @@ function addinput()
}
sNextCode=getNextCode($(this).parent().parent().find('.code').val());
if (x==0) {
inserthtml='<tr class="row_'+newposition+'" style="display:none;"><td><img class="handle" src="' + ci_path + '"/handle.png" /></td><td><input class="code" onkeypress="return goodchars(event,\'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_\')" type="text" maxlength="5" size="5" value="'+htmlspecialchars(sNextCode)+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="1"/></td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(newansweroption_text)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
inserthtml='<tr class="row_'+newposition+'" style="display:none;"><td><img class="handle" src="' + ci_path + '/handle.png" /></td><td><input class="code" onkeypress="return goodchars(event,\'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_\')" type="text" maxlength="5" size="5" value="'+htmlspecialchars(sNextCode)+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="1"/></td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(newansweroption_text)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'
}
else
{
inserthtml='<tr class="row_'+newposition+'" style="display:none;"><td>&nbsp;</td><td>'+htmlspecialchars(sNextCode)+'</td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(newansweroption_text)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
inserthtml='<tr class="row_'+newposition+'" style="display:none;"><td>&nbsp;</td><td>'+htmlspecialchars(sNextCode)+'</td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(newansweroption_text)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'
}
tablerow.after(inserthtml);
tablerow.next().find('.btnaddanswer').click(addinput);
Expand Down Expand Up @@ -486,11 +486,11 @@ function transferlabels()
for (k in lsrows)
{
if (x==0) {
tablerows=tablerows+'<tr class="row_'+k+'" ><td><img class="handle" src="' + ci_path + '"/handle.png" /></td><td><input class="code" onkeypress="return goodchars(event,\'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_\')" type="text" maxlength="5" size="5" value="'+htmlspecialchars(lsrows[k].code)+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="'+htmlspecialchars(lsrows[k].assessment_value)+'"/></td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(lsrows[k].title)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
tablerows=tablerows+'<tr class="row_'+k+'" ><td><img class="handle" src="' + ci_path + '/handle.png" /></td><td><input class="code" onkeypress="return goodchars(event,\'1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWZYZ_\')" type="text" maxlength="5" size="5" value="'+htmlspecialchars(lsrows[k].code)+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="'+htmlspecialchars(lsrows[k].assessment_value)+'"/></td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(lsrows[k].title)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'
}
else
{
tablerows=tablerows+'<tr class="row_'+k+'" ><td>&nbsp;</td><td>'+htmlspecialchars(lsrows[k].code)+'</td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(lsrows[k].title)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
tablerows=tablerows+'<tr class="row_'+k+'" ><td>&nbsp;</td><td>'+htmlspecialchars(lsrows[k].code)+'</td><td><input type="text" size="100" class="answer" value="'+htmlspecialchars(lsrows[k].title)+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'
}
}
}
Expand Down Expand Up @@ -588,11 +588,11 @@ function quickaddlabels()
thisrow[parseInt(x)+1]=thisrow[1];
}
if (x==0) {
tablerows=tablerows+'<tr class="row_'+k+'" ><td><img class="handle" src="' + ci_path + '"/handle.png" /></td><td><input class="code" type="text" maxlength="5" size="5" value="'+thisrow[0]+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="1"/></td><td><input type="text" size="100" class="answer" value="'+thisrow[parseInt(x)+1]+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
tablerows=tablerows+'<tr class="row_'+k+'" ><td><img class="handle" src="' + ci_path + '/handle.png" /></td><td><input class="code" type="text" maxlength="5" size="5" value="'+thisrow[0]+'" /></td><td '+assessment_style+'><input class="assessment" type="'+assessment_type+'" maxlength="5" size="5" value="1"/></td><td><input type="text" size="100" class="answer" value="'+thisrow[parseInt(x)+1]+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'
}
else
{
tablerows=tablerows+'<tr class="row_'+k+'" ><td>&nbsp;</td><td>&nbsp;</td><td><input type="text" size="100" class="answer" value="'+thisrow[parseInt(x)+1]+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '"/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '"/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '"/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '"/deleteanswer.png" class="btndelanswer" /></td></tr>'
tablerows=tablerows+'<tr class="row_'+k+'" ><td>&nbsp;</td><td>&nbsp;</td><td><input type="text" size="100" class="answer" value="'+thisrow[parseInt(x)+1]+'"></input><a class="editorLink"><img class="btneditanswerena" src="' + ci_path + '/edithtmlpopup.png" width="16" height="16" border="0" /><img class="btneditanswerdis" alt="Give focus to the HTML editor popup window" src="' + ci_path + '/edithtmlpopup_disabled.png" style="display: none;" width="16" height="16" align="top" border="0" /></a></td><td><img src="' + ci_path + '/addanswer.png" class="btnaddanswer" /><img src="' + ci_path + '/deleteanswer.png" class="btndelanswer" /></td></tr>'

}
}
Expand Down

0 comments on commit 5748d9d

Please sign in to comment.