From d6cfcd4381f7ffaf01b91f82e1299f5f6cc62800 Mon Sep 17 00:00:00 2001 From: Kaleb Murphy Date: Thu, 8 May 2008 14:21:03 +0000 Subject: [PATCH] Added IE7 compat in administersurvey.js for class changes. --- www/extras/wobject/Survey/administersurvey.js | 22 ++++++++----------- .../wobject/Survey/editsurvey/section.js | 4 ++-- www/extras/wobject/Survey/survey.css | 6 +++++ 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/www/extras/wobject/Survey/administersurvey.js b/www/extras/wobject/Survey/administersurvey.js index 44970bb72..94934afbb 100644 --- a/www/extras/wobject/Survey/administersurvey.js +++ b/www/extras/wobject/Survey/administersurvey.js @@ -25,7 +25,6 @@ Survey.Form = new function() { this.displayQuestions = function(params){ - toValidate = new Array();//clear array var qs = params.questions; var s = params.section; @@ -188,8 +187,8 @@ Survey.Form = new function() { for(var z in toValidate[i]['answers']){ total += Math.round(document.getElementById(z).value); } -console.log(total+" and "+ toValidate[i]['total']); if(total == toValidate[i]['total']){answered = 1;} + else{alert("Please enter amounts that sum to 100% to proceed.");} }else{ for(var z in toValidate[i]['answers']){ var v = document.getElementById(z).value; @@ -197,9 +196,6 @@ console.log(total+" and "+ toValidate[i]['total']); answered = 1; break; } - else{ - console.log(z+' was not answered'); - } } } if(answered == 0){ @@ -365,33 +361,33 @@ console.log(total+" and "+ toValidate[i]['total']); var aid = objs[5]; max = parseInt(max); if(maxA == 1){ - if(b.getAttribute('class') == 'mcbutton-selected'){ + if(b.className == 'mcbutton-selected'){ document.getElementById(b.hid).value = 0; - b.setAttribute('class','mcbutton'); + b.className='mcbutton'; }else{ document.getElementById(b.hid).value = 1; - b.setAttribute('class','mcbutton-selected'); + b.className='mcbutton-selected'; } for(var i in butts){ if(butts[i] != b){ - butts[i].setAttribute('class','mcbutton'); + butts[i].className='mcbutton'; document.getElementById(butts[i].hid).value = ''; } } } - else if(b.getAttribute('class') == 'mcbutton'){ + else if(b.className == 'mcbutton'){ var max = parseInt(document.getElementById(qid+'max').innerHTML); if(max == 0){ - b.setAttribute('class','mcbutton'); + b.className='mcbutton'; //warn that options used up } else{ - b.setAttribute('class','mcbutton-selected'); + b.className='mcbutton-selected'; document.getElementById(qid+'max').innerHTML = parseInt(max-1); document.getElementById(b.hid).value = 1; } }else{ - b.setAttribute('class','mcbutton'); + b.className='mcbutton'; var max = parseInt(document.getElementById(qid+'max').innerHTML); document.getElementById(qid+'max').innerHTML = parseInt(max+1); document.getElementById(b.hid).value = ''; diff --git a/www/extras/wobject/Survey/editsurvey/section.js b/www/extras/wobject/Survey/editsurvey/section.js index e2dee5a8e..837758b02 100644 --- a/www/extras/wobject/Survey/editsurvey/section.js +++ b/www/extras/wobject/Survey/editsurvey/section.js @@ -54,7 +54,7 @@ Survey.SectionTemplate = new function(){ } html = html + "\
\ -

Section Text:

\ +

Section Text:

\ "; html = html + "

Title on every page: " + this.makeRadio('everyPageTitle',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageTitle); html = html + "

Text on every page: " + this.makeRadio('everyPageText',[{text:'Yes',value:1},{text:'No',value:0}],params.everyPageText); @@ -68,7 +68,7 @@ Survey.SectionTemplate = new function(){ } var form = new YAHOO.widget.Dialog("section", - { width : "400px", + { width : "500px", fixedcenter : true, visible : false, constraintoviewport : true, diff --git a/www/extras/wobject/Survey/survey.css b/www/extras/wobject/Survey/survey.css index 24f4927a1..beaa6f0d7 100644 --- a/www/extras/wobject/Survey/survey.css +++ b/www/extras/wobject/Survey/survey.css @@ -55,9 +55,15 @@ input.mcbutton:hover{ } input.mcbutton-selected{ background-color: #172D9D; + background-repeat: repeat-x; color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; + margin: 0.5em; + padding: .8em; + width: 60px; + text-align: center; + display: block; font-weight: bold; background-image: url(/extras/wobject/Survey/gradient-glossy.png); background-position: 0px 0px;