[Movecommons-commits] r567 - in trunk: src wp-theme

Mario Gallegos mgallegos at ourproject.org
Thu Nov 1 23:01:27 CET 2012


Author: mgallegos
Date: 2012-11-01 23:01:26 +0100 (Thu, 01 Nov 2012)
New Revision: 567

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 17:09:33 UTC (rev 566)
+++ trunk/src/mc-dia-form2.js	2012-11-01 22:01:26 UTC (rev 567)
@@ -98,9 +98,7 @@
 	}
 }
 
-function onClickImageMap(e){
-	$j(current_step).slideUp();
-    $j(e.key).slideDown();	                        
+function onClickImageMap(e){		                        
 	if (e.key=='#first_step'){        		
 	 	$j('#progress_text').html('0% Complete');
 	 	$j('#progress').css('width','0');
@@ -108,23 +106,41 @@
 	else if (e.key=='#second_step'){
 		$j('#progress_text').html('20% Complete');
         $j('#progress').css('width','68px');
+        if($j('#np-checkbox').val()=='S')
+        	$j('label[for*="step2-yes"]').addClass('ui-state-active');
+        else if ($j('#np-checkbox').val()=='N')
+        	$j('label[for*="step2-no"]').addClass('ui-state-active');
 	}
 	else if (e.key=='#third_step'){
 		$j('#progress_text').html('40% Complete');
         $j('#progress').css('width','136px');
+        if($j('#rp-checkbox').val()=='S')
+        	$j('label[for*="step3-yes"]').addClass('ui-state-active');
+        else if ($j('#rp-checkbox').val()=='N')
+        	$j('label[for*="step3-no"]').addClass('ui-state-active');        
 	}         	
 	else if (e.key=='#fourth_step'){
 		$j('#progress_text').html('60% Complete');
         $j('#progress').css('width','204px');
+        if($j('#rc-checkbox').val()=='S')
+        	$j('label[for*="step4-yes"]').addClass('ui-state-active');
+        else if ($j('#rc-checkbox').val()=='N')
+        	$j('label[for*="step4-no"]').addClass('ui-state-active');
 	}
 	else if (e.key=='#fifth_step'){
 		$j('#progress_text').html('60% Complete');
         $j('#progress').css('width','204px');
+        if($j('#gr-checkbox').val()=='S')
+        	$j('label[for*="step5-yes"]').addClass('ui-state-active');
+        else if ($j('#gr-checkbox').val()=='N')
+        	$j('label[for*="step5-no"]').addClass('ui-state-active');
 	}
 	else if (e.key=='#sixth_step'){
 		$j('#progress_text').html('100% Complete');
         $j('#progress').css('width','339px');
 	}	
+	$j(current_step).slideUp();
+    $j(e.key).slideDown();
 }
 
 function select_cat($id, $id2) {
@@ -529,6 +545,11 @@
 
 
 $j(function(){
+	
+	var current_step='#first_step';
+	
+	var step_two_reached=step_three_reached=step_four_reached=step_five_reached=step_six_reached=false;
+	
     //original field values
     var field_values = {
             //id        :  value
@@ -815,6 +836,29 @@
     	
     	current_step='#sixth_step';
     	
+    	/*if(!step_six_reached){	    	
+	    	$j('img[usemap*="step1_image_map"]').attr('usemap','step1_image_map_all');
+	    	$j('img[usemap*="step2_image_map"]').attr('usemap','step2_image_map_all');
+	    	$j('img[usemap*="step3_image_map"]').attr('usemap','step3_image_map_all');
+	    	$j('img[usemap*="step4_image_map"]').attr('usemap','step4_image_map_all');
+	    	$j('img[usemap*="step5_image_map"]').attr('usemap','step5_image_map_all');
+	    	$j('img[usemap*="step6_image_map"]').attr('usemap','step6_image_map_all');
+	    	
+	    	$j(".map").mapster('unbind');
+	    	
+	    	$j( ".map").mapster({
+	            fillColor: 'EA8F5F',
+	            fillOpacity: 0.8,
+	            isSelectable: false,
+	            mapKey: 'step',
+	            onClick: function (e) {
+	            	onClickImageMap(e);
+	            }        
+	        });
+	    	
+	    	step_six_reached = true;
+    	}*/
+    	
     	if($j('#gr-checkbox').val()=='A'){
     		$j('#step5question').effect("shake", { times:3 }, 50);
     		return;
@@ -840,31 +884,8 @@
     
     $j('#p_submit_sixth').click(function(){     
     	
-    	current_step='#fifth_step';
+    	current_step='#fifth_step';    	    		
     	
-    	if(!step_six_reached){	    	
-	    	$j('img[usemap*="step1_image_map"]').attr('usemap','step1_image_map_all');
-	    	$j('img[usemap*="step2_image_map"]').attr('usemap','step2_image_map_all');
-	    	$j('img[usemap*="step3_image_map"]').attr('usemap','step3_image_map_all');
-	    	$j('img[usemap*="step4_image_map"]').attr('usemap','step4_image_map_all');
-	    	$j('img[usemap*="step5_image_map"]').attr('usemap','step5_image_map_all');
-	    	$j('img[usemap*="step6_image_map"]').attr('usemap','step6_image_map_all');
-	    	
-	    	$j(".map").mapster('unbind');
-	    	
-	    	$j( ".map").mapster({
-	            fillColor: 'EA8F5F',
-	            fillOpacity: 0.8,
-	            isSelectable: false,
-	            mapKey: 'step',
-	            onClick: function (e) {
-	            	onClickImageMap(e);
-	            }        
-	        });
-	    	
-	    	step_six_reached = true;
-    	}	
-    	
     	//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 17:09:33 UTC (rev 566)
+++ trunk/wp-theme/mc2-form.php	2012-11-01 22:01:26 UTC (rev 567)
@@ -413,7 +413,8 @@
 <div class="mc-dia-continue-btn" id="mc-dia-continue-btn"><?php _e("Continue", "mc"); ?></div>
  -->
  
-<map id="step1_image_map_all" name="step1_image_map_all">	
+
+<map id="step1_image_map" name="step1_image_map">	
     <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-->
@@ -425,8 +426,9 @@
 	<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->		     
 </map>
 
-<map id="step2_image_map_all" name="step2_image_map_all">	
+<map id="step_image_map_all" name="step_image_map_all">	
     <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-->
@@ -438,13 +440,6 @@
     <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="#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="#first_step" shape="circle" coords="30,12,12"><!--1-->
@@ -452,14 +447,6 @@
     <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="#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="#first_step" shape="circle" coords="30,12,12"><!--1-->
     <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
@@ -467,14 +454,6 @@
     <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="#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="#first_step" shape="circle" coords="30,12,12"><!--1-->
     <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
@@ -483,14 +462,6 @@
     <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="#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>
- 
 
 <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
 <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'></script>
@@ -505,8 +476,6 @@
 
 <script type="text/javascript">
 $j(document).ready(function() {
-	var current_step='#first_step';
-	var step_six_reached=false;
 	$j('#languages').tagsInput({defaultText:'Add a language'});
 	$j('#keywords').tagsInput({defaultText:'Add a keyword'});
 	$j('#infield-donation-website').inFieldLabels();




More information about the Movecommons-commits mailing list