Author: mgallegos Date: 2012-11-01 17:37:13 +0100 (Thu, 01 Nov 2012) New Revision: 563 Modified: trunk/src/mc-dia-form2.js trunk/wp-theme/mc2-form.php Log: Modified: trunk/src/mc-dia-form2.js =================================================================== --- trunk/src/mc-dia-form2.js 2012-11-01 16:14:43 UTC (rev 562) +++ trunk/src/mc-dia-form2.js 2012-11-01 16:37:13 UTC (rev 563) @@ -580,7 +580,10 @@ } }); - if(!error) { + if(!error) { + + current-step='#second_step'; + //update progress bar $j('#progress_text').html('20% Complete'); $j('#progress').css('width','68px'); @@ -596,7 +599,10 @@ } else return false; }); - $j('#p_submit_second').click(function(){ + $j('#p_submit_second').click(function(){ + + current-step='#first_step'; + //update progress bar $j('#progress').css('width','0'); $j('#progress_text').html('0% Complete'); @@ -645,6 +651,8 @@ if(error) return; + + current-step='#third_step'; //update progress bar $j('#progress_text').html('40% Complete'); @@ -661,7 +669,10 @@ }); - $j('#p_submit_third').click(function(){ + $j('#p_submit_third').click(function(){ + + current-step='#second_step'; + //update progress bar $j('#progress_text').html('20% Complete'); $j('#progress').css('width','68px'); @@ -716,6 +727,8 @@ if(error) return; + current-step='#fourth_step'; + //update progress bar $j('#progress_text').html('60% Complete'); $j('#progress').css('width','204px'); @@ -730,7 +743,10 @@ $j('#fourth_step').slideDown(); }); - $j('#p_submit_fourth').click(function(){ + $j('#p_submit_fourth').click(function(){ + + current-step='#third_step'; + //update progress bar $j('#progress_text').html('40% Complete'); $j('#progress').css('width','136px'); @@ -757,6 +773,8 @@ $j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50); return; } + + current-step='#fifth_step'; //update progress bar $j('#progress_text').html('80% Complete'); @@ -773,7 +791,10 @@ }); - $j('#p_submit_fifth').click(function(){ + $j('#p_submit_fifth').click(function(){ + + current-step='#fourth_step'; + //update progress bar $j('#progress_text').html('60% Complete'); $j('#progress').css('width','204px'); @@ -790,16 +811,20 @@ $j('#submit_fifth').click(function(){ + current-step='#sixth_step'; + if($j('#gr-checkbox').val()=='A'){ $j('#step5question').effect("shake", { times:3 }, 50); return; } + $j('#progress_text').html('100% Complete'); + $j('#progress').css('width','339px'); + $j('#fifth_step').slideUp(); $j('#sixth_step').slideDown(); - $j('#progress_text').html('100% Complete'); - $j('#progress').css('width','339px'); + /* //update progress bar $j('#progress_text').html('50% Complete'); @@ -811,7 +836,10 @@ */ }); - $j('#p_submit_sixth').click(function(){ + $j('#p_submit_sixth').click(function(){ + + current-step='#fifth_step'; + //update progress bar $j('#progress_text').html('80% Complete'); $j('#progress').css('width','272px'); Modified: trunk/wp-theme/mc2-form.php =================================================================== --- trunk/wp-theme/mc2-form.php 2012-11-01 16:14:43 UTC (rev 562) +++ trunk/wp-theme/mc2-form.php 2012-11-01 16:37:13 UTC (rev 563) @@ -414,81 +414,81 @@ --> <map id="step1_image_map-all" name="step1_image_map-all"> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> - <area href="#" step="6" shape="circle" coords="490,12,12"><!--6--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6--> </map> <map id="step2_image_map" name="step2_image_map"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> </map> <map id="step2_image_map-all" name="step2_image_map-all"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> - <area href="#" step="6" shape="circle" coords="490,12,12"><!--6--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6--> </map> <map id="step3_image_map" name="step3_image_map"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> </map> <map id="step3_image_map_all" name="step3_image_map_all"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> - <area href="#" step="6" shape="circle" coords="490,12,12"><!--6--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6--> </map> <map id="step4_image_map" name="step4_image_map"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> </map> <map id="step4_image_map_all" name="step4_image_map_all"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> - <area href="#" step="6" shape="circle" coords="490,12,12"><!--6--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6--> </map> <map id="step5_image_map" name="step5_image_map"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> </map> <map id="step5_image_map_all" name="step5_image_map_all"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="6" shape="circle" coords="490,12,12"><!--6--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6--> </map> <map id="step6_image_map" name="step6_image_map"> - <area href="#" step="1" shape="circle" coords="30,12,12"><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> </map> <map id="step6_image_map_all" name="step6_image_map_all"> - <area href="#" step="1" shape="circle" coords="30,12,12" ><!--1--> - <area href="#" step="2" shape="circle" coords="122,12,12"><!--2--> - <area href="#" step="3" shape="circle" coords="214,12,12"><!--3--> - <area href="#" step="4" shape="circle" coords="306,12,12"><!--4--> - <area href="#" step="5" shape="circle" coords="398,12,12"><!--5--> + <area href="#" step="#first_step" shape="circle" coords="30,12,12" ><!--1--> + <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2--> + <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3--> + <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4--> + <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5--> </map> @@ -505,6 +505,7 @@ <script type="text/javascript"> $j(document).ready(function() { + var current-step='#first_step'; $j('#languages').tagsInput({defaultText:'Add a language'}); $j('#keywords').tagsInput({defaultText:'Add a keyword'}); $j('#infield-donation-website').inFieldLabels(); @@ -512,7 +513,6 @@ $j('#infield-open-accounting-website').inFieldLabels(); $j('#infield-creative-commons-website').inFieldLabels(); $j('#infield-other-license-website').inFieldLabels(); - //$j('#infield-url').inFieldLabels(); $j('#infield-terms-of-use-website').inFieldLabels(); $j('.buttonp').button({ icons: {primary:'ui-icon-arrowthick-1-w'} }); $j('.buttonn').button({ icons: {secondary:'ui-icon-arrowthick-1-e'} }); @@ -528,20 +528,24 @@ isSelectable: false, mapKey: 'step', onClick: function (e) { - if (e.key=='1') - alert('1'); - else if (e.key=='2') - alert('2'); - else if (e.key=='3') - alert('3'); - else if (e.key=='4') - alert('4'); - else if (e.key=='5') - alert('5'); - else if (e.key=='6') - alert('6'); + //$j(current-step).slideUp(); + //$j(e.key).slideDown(); + if (e.key=='#first_step') + alert(e.key + ' ' + current-step); + else if (e.key=='#second_step') + alert(e.key + ' ' + current-step); + else if (e.key=='#third_step') + alert(e.key + ' ' + current-step); + else if (e.key=='#fourth_step') + alert(e.key + ' ' + current-step); + else if (e.key=='#fifth_step') + alert(e.key + ' ' + current-step); + else if (e.key=='#sixth_step') + alert(e.key + ' ' + current-step); }, }); + + }); </script> \ No newline at end of file