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

Mario Gallegos mgallegos at ourproject.org
Sun Nov 4 23:34:57 CET 2012


Author: mgallegos
Date: 2012-11-04 23:34:56 +0100 (Sun, 04 Nov 2012)
New Revision: 575

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-04 22:11:44 UTC (rev 574)
+++ trunk/src/mc-dia-form2.js	2012-11-04 22:34:56 UTC (rev 575)
@@ -5,10 +5,11 @@
 	var current_step='#first_step';
 	
 	var step_two_reached=step_three_reached=step_four_reached=step_five_reached=step_six_reached=false;
+	
+    var mc_np = "0",mc_rp = "0",mc_rc = "0",mc_gr = "0",mc_category = "",nameIni = "", urlIni = "",keywordsIni = "";
 		
     //original field values
     var field_values = {
-            //id        :  value
             'ininame'  : 'Name of your initiative',
             'url'  : 'Web address',
             'languages' : 'Language(s)',
@@ -16,400 +17,7 @@
             'location'  : 'Location',
             'email'  : 'email address'
     };
-
-
-    //inputfocus
-    $j('input#ininame').inputfocus({ value: field_values['ininame'] });
-    $j('input#url').inputfocus({ value: field_values['url'] });
-    $j('input#languages').inputfocus({ value: field_values['languages'] }); 
-    $j('input#keywords').inputfocus({ value: field_values['keywords'] });
-    $j('input#location').inputfocus({ value: field_values['location'] });
-    //$('input#email').inputfocus({ value: field_values['email'] }); 
-
-    //reset progress bar
-    $j('#progress').css('width','0');
-    $j('#progress_text').html('0% Complete');
-
-    //first_step
-    $j('form').submit(function(){ return false; });
     
-    $j('#submit_first').click(function(){
-        //remove classes
-        $j('#first_step input').removeClass('error').removeClass('valid');
-
-        //ckeck if inputs aren't empty
-        var fields = $j('#first_step input[type=text], #first_step input[type=password]');
-        var error = 0;
-        fields.each(function(){
-            var value = $j.trim($j(this).val());
-            if( value=="" || value==field_values[$j(this).attr('id')] ) {            	
-                $j(this).addClass('error');
-                $j(this).effect("shake", { times:3 }, 50);                
-                error++;
-            } else {
-            	/*if($j(this).attr('id')=='url'){
-            		if(!(/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value))){
-            			$j(this).addClass('error');
-                        $j(this).effect("shake", { times:3 }, 50);                
-                        error++;
-            		}            			
-            	}
-            	else*/
-            		$j(this).addClass('valid');
-            }
-        });        
-        
-        if(!error) {
-        	
-        	current_step='#second_step';
-        	        	
-        	if(!step_two_reached){
-        		$j('#step1_image_map').append('<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->');
-        		imageMapUnBind();
-            	imageMapInit();
-        		step_two_reached=true;        		
-        	}
-        	        	        	
-	        //update progress bar
-	        $j('#progress_text').html('20% Complete');
-	        $j('#progress').css('width','68px');
-	        
-	        //slide steps
-	        $j('#first_step').slideUp();
-	        $j('#second_step').slideDown(); 
-	        
-	        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 return false;
-    });
-    
-    $j('#p_submit_second').click(function(){       
-    	
-    		current_step='#first_step';
-    		
-	        //update progress bar
-    	 	$j('#progress').css('width','0');
-    	 	$j('#progress_text').html('0% Complete');
-	        
-	        //slide steps    	 	
-	        $j('#second_step').slideUp();
-	        $j('#first_step').slideDown();
-    });
-    
-    
-    $j('#submit_second').click(function(){
-    	
-    	var error=false;
-    	
-    	if($j('#np-checkbox').val()=='A'){
-    		$j('#step2question').effect("shake", { times:3 }, 50);
-    		return;
-    	}
-    	
-    	if($j("#registered-non-profit").attr("checked"))
-    	    if($j.trim($j('#non-profit-website').val())==""){
-    	    	$j('#non-profit-website').addClass('error');
-    	    	$j('#non-profit-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#non-profit-website').addClass('valid');
-    	
-    	if($j("#open-accounting").attr("checked"))
-    	    if($j.trim($j('#open-accounting-website').val())==""){
-    	    	$j('#open-accounting-website').addClass('error');
-    	    	$j('#open-accounting-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#open-accounting-website').addClass('valid');
-    	
-    	if($j("#accept-donations").attr("checked"))
-    	    if($j.trim($j('#donation-website').val())==""){
-    	    	$j('#donation-website').addClass('error');
-    	    	$j('#donation-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#accept-donations').addClass('valid');
-    	
-    	if(error)
-    		return;
-    	
-    	current_step='#third_step';
-    	    	
-    	if(!step_three_reached){
-    		$j('#step1_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
-    		$j('#step2_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
-    		imageMapUnBind();
-        	imageMapInit();
-        	step_three_reached=true;        		
-    	}
-    	    	
-    	//update progress bar
-        $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');
-        
-        //slide steps
-        $j('#second_step').slideUp();
-        $j('#third_step').slideDown();
-
-    });
-    
-    $j('#p_submit_third').click(function(){     
-    	
-    	current_step='#second_step';
-    	
-        //update progress bar
-    	$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');
-        
-        //slide steps    	 	
-        $j('#third_step').slideUp();
-        $j('#second_step').slideDown();
-    });
-
-
-    $j('#submit_third').click(function(){
-    	
-    	var error=false;
-    	
-    	if($j('#rp-checkbox').val()=='A'){
-    		$j('#step3question').effect("shake", { times:3 }, 50);
-    		return;
-    	}
-    	
-    	if($j("#terms-of-use").attr("checked"))
-    	    if($j.trim($j('#terms-of-use-website').val())==""){
-    	    	$j('#terms-of-use-website').addClass('error');
-    	    	$j('#terms-of-use-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#terms-of-use-website').addClass('valid');
-    	
-    	if($j("#creative-commons").attr("checked"))
-    	    if($j.trim($j('#creative-commons-website').val())==""){
-    	    	$j('#creative-commons-website').addClass('error');
-    	    	$j('#creative-commons-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#creative-commons-website').addClass('valid');
-    	
-    	if($j("#other-license").attr("checked"))
-    	    if($j.trim($j('#other-license-website').val())==""){
-    	    	$j('#other-license-website').addClass('error');
-    	    	$j('#other-license-website').effect("shake", { times:3 }, 50);
-    	    	error=true;
-    	    }
-    	    else
-    	    	$j('#other-license-website').addClass('valid');
-    	
-    	if(error)
-    		return;
-    	
-    	current_step='#fourth_step';
-    	
-    	if(!step_four_reached){
-    		$j('#step1_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
-    		$j('#step2_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
-    		$j('#step3_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
-    		imageMapUnBind();
-        	imageMapInit();
-        	step_four_reached=true;        		
-    	}
-    	
-        //update progress bar
-        $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');
-        
-        //slide steps
-        $j('#third_step').slideUp();
-        $j('#fourth_step').slideDown();
-    });
-
-    $j('#p_submit_fourth').click(function(){     
-    	
-    	current_step='#third_step';
-    	
-        //update progress bar
-    	$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');
-        
-        //slide steps    	 	
-        $j('#fourth_step').slideUp();
-        $j('#third_step').slideDown();
-    });
-
-    $j('#submit_fourth').click(function(){
-    	    	    	
-    	if($j('#rc-checkbox').val()=='A'){    	
-    		$j('#step4question').effect("shake", { times:3 }, 50);
-    		return;
-    	}
-    	    	
-    	
-    	if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rc60.png' && $j('#rc-checkbox').val()=='S'){
-    		 $j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50);
-    		 return;
-    	}
-    	
-    	current_step='#fifth_step';
-    	    	
-    	if(!step_five_reached){
-    		$j('#step1_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
-    		$j('#step2_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
-    		$j('#step3_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
-    		$j('#step4_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
-    		imageMapUnBind();
-        	imageMapInit();
-        	step_five_reached=true;        		
-    	}
-    		    		
-    	//update progress bar
-        $j('#progress_text').html('80% Complete');
-        $j('#progress').css('width','272px');
-        
-        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');
-        
-        //slide steps
-        $j('#fourth_step').slideUp();
-        $j('#fifth_step').slideDown();
-        
-    });
-    
-    $j('#p_submit_fifth').click(function(){    
-    	
-    	current_step='#fourth_step';
-    	
-    	//update progress bar
-        $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');
-        
-        //slide steps    	 	
-        $j('#fifth_step').slideUp();
-        $j('#fourth_step').slideDown();
-    });
-    
-    $j('#submit_fifth').click(function(){
-    	    	    	    	    	    	    	
-    	if($j('#gr-checkbox').val()=='A'){
-    		$j('#step5question').effect("shake", { times:3 }, 50);
-    		return;
-    	}
-    	
-    	current_step='#sixth_step';
-    	    	
-    	if(!step_six_reached){
-    		$j('#step1_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
-    		$j('#step2_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
-    		$j('#step3_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
-    		$j('#step4_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
-    		$j('#step5_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
-    		imageMapUnBind();
-        	imageMapInit();
-        	step_six_reached=true;        		
-    	}
-    	
-        $j('#progress_text').html('100% Complete');
-        $j('#progress').css('width','339px');
-    	
-    	$j('#fifth_step').slideUp();
-        $j('#sixth_step').slideDown();
-
-    });
-    
-    $j('#p_submit_sixth').click(function(){     
-    	
-    	current_step='#fifth_step';    	    		
-    	
-    	//update progress bar
-    	$j('#progress_text').html('80% Complete');
-        $j('#progress').css('width','272px');
-        
-        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');
-        
-        //slide steps    	 	
-        $j('#sixth_step').slideUp();
-        $j('#fifth_step').slideDown();
-    });
-    
-    $j('#non-profit-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
-    $j('#open-accounting-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
-    $j('#donation-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
-    $j('#terms-of-use-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
-    $j('#creative-commons-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
-    $j('#other-license-website').click(function(){
-        if($j(this).val()==''){ 
-        	$j(this).val($j('#url').val());
-        	$j(this).trigger('keydown');
-        }    	
-    });
-    
     function clickCheckBox(id,answer){
     	if(answer=='yes'){
     		if ($j("#mc-form-" + id).is('.mc-form-descbox-selected')) return;
@@ -804,22 +412,8 @@
 
     function conf_link($id) {
       var nid = "n" + $id;
-      //hover_more_link($id);
-      //hover_more_link(nid);
-      //hover_less_link(nid);
-      //hover_less_link(nid);
-      //hide_initial($id);
-      //hide_initial(nid);
-      //click_more_link($id);
-      //click_more_link(nid);
-      //click_less_link($id);
-      //click_less_link(nid);
       select_cat($id, nid);
       select_cat(nid, $id);
-      //hover_cat($id);
-      //hover_cat(nid);
-      // dclick_toggle($id);
-      // dclick_toggle(nid);
     };
 
     function conf_click_continue() {
@@ -875,36 +469,386 @@
           }
         });
     };
+   
+    
+    $j('#submit_first').click(function(){
+        //remove classes
+        $j('#first_step input').removeClass('error').removeClass('valid');
 
-    var mc_np = "0";
-    var mc_rp = "0";
-    var mc_rc = "0";
-    var mc_gr = "0";
-    var mc_category = "";
-    var nameIni = "";
-    var urlIni = "";
-    var keywordsIni = "";
-    // var click_to_select = $j("#mc-form-gr").attr("title"); // store of title value
+        //ckeck if inputs aren't empty
+        var fields = $j('#first_step input[type=text], #first_step input[type=password]');
+        var error = 0;
+        fields.each(function(){
+            var value = $j.trim($j(this).val());
+            if( value=="" || value==field_values[$j(this).attr('id')] ) {            	
+                $j(this).addClass('error');
+                $j(this).effect("shake", { times:3 }, 50);                
+                error++;
+            } else {
+            	/*if($j(this).attr('id')=='url'){
+            		if(!(/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)){0})(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value))){
+            			$j(this).addClass('error');
+                        $j(this).effect("shake", { times:3 }, 50);                
+                        error++;
+            		}            			
+            	}
+            	else*/
+            		$j(this).addClass('valid');
+            }
+        });        
+        
+        if(!error) {
+        	
+        	current_step='#second_step';
+        	        	
+        	if(!step_two_reached){
+        		$j('#step1_image_map').append('<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->');
+        		imageMapUnBind();
+            	imageMapInit();
+        		step_two_reached=true;        		
+        	}
+        	        	        	
+	        //update progress bar
+	        $j('#progress_text').html('20% Complete');
+	        $j('#progress').css('width','68px');
+	        
+	        //slide steps
+	        $j('#first_step').slideUp();
+	        $j('#second_step').slideDown(); 
+	        
+	        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 return false;
+    });
+    
+    $j('#p_submit_second').click(function(){       
+    	
+    		current_step='#first_step';
+    		
+	        //update progress bar
+    	 	$j('#progress').css('width','0');
+    	 	$j('#progress_text').html('0% Complete');
+	        
+	        //slide steps    	 	
+	        $j('#second_step').slideUp();
+	        $j('#first_step').slideDown();
+    });
+    
+    
+    $j('#submit_second').click(function(){
+    	
+    	var error=false;
+    	
+    	if($j('#np-checkbox').val()=='A'){
+    		$j('#step2question').effect("shake", { times:3 }, 50);
+    		return;
+    	}
+    	
+    	if($j("#registered-non-profit").attr("checked"))
+    	    if($j.trim($j('#non-profit-website').val())==""){
+    	    	$j('#non-profit-website').addClass('error');
+    	    	$j('#non-profit-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#non-profit-website').addClass('valid');
+    	
+    	if($j("#open-accounting").attr("checked"))
+    	    if($j.trim($j('#open-accounting-website').val())==""){
+    	    	$j('#open-accounting-website').addClass('error');
+    	    	$j('#open-accounting-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#open-accounting-website').addClass('valid');
+    	
+    	if($j("#accept-donations").attr("checked"))
+    	    if($j.trim($j('#donation-website').val())==""){
+    	    	$j('#donation-website').addClass('error');
+    	    	$j('#donation-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#accept-donations').addClass('valid');
+    	
+    	if(error)
+    		return;
+    	
+    	current_step='#third_step';
+    	    	
+    	if(!step_three_reached){
+    		$j('#step1_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
+    		$j('#step2_image_map').append('<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->');
+    		imageMapUnBind();
+        	imageMapInit();
+        	step_three_reached=true;        		
+    	}
+    	    	
+    	//update progress bar
+        $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');
+        
+        //slide steps
+        $j('#second_step').slideUp();
+        $j('#third_step').slideDown();
 
-    /*conf_link("np");
-    conf_link("rp");
-    conf_link("rc");*/
-    //conf_link("gr");
-    select_area("ec");
-    select_area("bo");
-    select_area("to");
-    select_area("di");
-    //confInputValidation("#url");
-    //confInputValidation("#ininame");
+    });
+    
+    $j('#p_submit_third').click(function(){     
+    	
+    	current_step='#second_step';
+    	
+        //update progress bar
+    	$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');
+        
+        //slide steps    	 	
+        $j('#third_step').slideUp();
+        $j('#second_step').slideDown();
+    });
 
-    $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
-    //$j("#mc-cat-rc-options").hide(function() {adjustHeights();});
-    $j("#mc-form-icon-result").hide();
-    conf_click_continue();
-    //$j('#label1').labelOver('over-apply');
-    // max_textsize();
-    $j(window).load(function () { doadjustwithsleep(0); });
 
+    $j('#submit_third').click(function(){
+    	
+    	var error=false;
+    	
+    	if($j('#rp-checkbox').val()=='A'){
+    		$j('#step3question').effect("shake", { times:3 }, 50);
+    		return;
+    	}
+    	
+    	if($j("#terms-of-use").attr("checked"))
+    	    if($j.trim($j('#terms-of-use-website').val())==""){
+    	    	$j('#terms-of-use-website').addClass('error');
+    	    	$j('#terms-of-use-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#terms-of-use-website').addClass('valid');
+    	
+    	if($j("#creative-commons").attr("checked"))
+    	    if($j.trim($j('#creative-commons-website').val())==""){
+    	    	$j('#creative-commons-website').addClass('error');
+    	    	$j('#creative-commons-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#creative-commons-website').addClass('valid');
+    	
+    	if($j("#other-license").attr("checked"))
+    	    if($j.trim($j('#other-license-website').val())==""){
+    	    	$j('#other-license-website').addClass('error');
+    	    	$j('#other-license-website').effect("shake", { times:3 }, 50);
+    	    	error=true;
+    	    }
+    	    else
+    	    	$j('#other-license-website').addClass('valid');
+    	
+    	if(error)
+    		return;
+    	
+    	current_step='#fourth_step';
+    	
+    	if(!step_four_reached){
+    		$j('#step1_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+    		$j('#step2_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+    		$j('#step3_image_map').append('<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->');
+    		imageMapUnBind();
+        	imageMapInit();
+        	step_four_reached=true;        		
+    	}
+    	
+        //update progress bar
+        $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');
+        
+        //slide steps
+        $j('#third_step').slideUp();
+        $j('#fourth_step').slideDown();
+    });
+
+    $j('#p_submit_fourth').click(function(){     
+    	
+    	current_step='#third_step';
+    	
+        //update progress bar
+    	$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');
+        
+        //slide steps    	 	
+        $j('#fourth_step').slideUp();
+        $j('#third_step').slideDown();
+    });
+
+    $j('#submit_fourth').click(function(){
+    	    	    	
+    	if($j('#rc-checkbox').val()=='A'){    	
+    		$j('#step4question').effect("shake", { times:3 }, 50);
+    		return;
+    	}
+    	    	
+    	
+    	if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rc60.png' && $j('#rc-checkbox').val()=='S'){
+    		 $j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50);
+    		 return;
+    	}
+    	
+    	current_step='#fifth_step';
+    	    	
+    	if(!step_five_reached){
+    		$j('#step1_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+    		$j('#step2_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+    		$j('#step3_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+    		$j('#step4_image_map').append('<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->');
+    		imageMapUnBind();
+        	imageMapInit();
+        	step_five_reached=true;        		
+    	}
+    		    		
+    	//update progress bar
+        $j('#progress_text').html('80% Complete');
+        $j('#progress').css('width','272px');
+        
+        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');
+        
+        //slide steps
+        $j('#fourth_step').slideUp();
+        $j('#fifth_step').slideDown();
+        
+    });
+    
+    $j('#p_submit_fifth').click(function(){    
+    	
+    	current_step='#fourth_step';
+    	
+    	//update progress bar
+        $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');
+        
+        //slide steps    	 	
+        $j('#fifth_step').slideUp();
+        $j('#fourth_step').slideDown();
+    });
+    
+    $j('#submit_fifth').click(function(){
+    	    	    	    	    	    	    	
+    	if($j('#gr-checkbox').val()=='A'){
+    		$j('#step5question').effect("shake", { times:3 }, 50);
+    		return;
+    	}
+    	
+    	current_step='#sixth_step';
+    	    	
+    	if(!step_six_reached){
+    		$j('#step1_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+    		$j('#step2_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+    		$j('#step3_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+    		$j('#step4_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+    		$j('#step5_image_map').append('<area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->');
+    		imageMapUnBind();
+        	imageMapInit();
+        	step_six_reached=true;        		
+    	}
+    	
+        $j('#progress_text').html('100% Complete');
+        $j('#progress').css('width','339px');
+    	
+    	$j('#fifth_step').slideUp();
+        $j('#sixth_step').slideDown();
+
+    });
+    
+    $j('#p_submit_sixth').click(function(){     
+    	
+    	current_step='#fifth_step';    	    		
+    	
+    	//update progress bar
+    	$j('#progress_text').html('80% Complete');
+        $j('#progress').css('width','272px');
+        
+        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');
+        
+        //slide steps    	 	
+        $j('#sixth_step').slideUp();
+        $j('#fifth_step').slideDown();
+    });
+    
+    $j('#non-profit-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+    $j('#open-accounting-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+    $j('#donation-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+    $j('#terms-of-use-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+    $j('#creative-commons-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+    $j('#other-license-website').click(function(){
+        if($j(this).val()==''){ 
+        	$j(this).val($j('#url').val());
+        	$j(this).trigger('keydown');
+        }    	
+    });
+    
+
     $j("#registered-non-profit").click(function(){		
       if($j("#registered-non-profit").attr("checked")){
         $j('#non-profit-website').show();
@@ -972,6 +916,14 @@
         $j('#infield-other-license-website').hide();
       }  
     });
+      
+    select_area("ec");
+    select_area("bo");
+    select_area("to");
+    select_area("di");
+    conf_click_continue();    
+    imageMapInit();
+    $j(window).load(function () { doadjustwithsleep(0); });
         
 });
 

Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php	2012-11-04 22:11:44 UTC (rev 574)
+++ trunk/wp-theme/mc2-form.php	2012-11-04 22:34:56 UTC (rev 575)
@@ -409,10 +409,6 @@
 	<div id="progress_text">0% Complete</div>
 </div>
 
-<!-- 
-<div class="mc-dia-continue-btn" id="mc-dia-continue-btn"><?php _e("Continue", "mc"); ?></div>
- -->
- 
 
 <map id="step1_image_map" name="step1_image_map">	
                 
@@ -482,7 +478,14 @@
 	$j("ul.qtrans_language_chooser").css("margin-top", "-25px");	
 	$j("ul.qtrans_language_chooser").css("float", "left");
 	$j("ul.qtrans_language_chooser").css("margin-left", "226px");
-	imageMapInit();    
+    $j('input#ininame').inputfocus({ value: field_values['ininame'] });
+    $j('input#url').inputfocus({ value: field_values['url'] });
+    $j('input#languages').inputfocus({ value: field_values['languages'] }); 
+    $j('input#keywords').inputfocus({ value: field_values['keywords'] });
+    $j('input#location').inputfocus({ value: field_values['location'] });
+    //$('input#email').inputfocus({ value: field_values['email'] }); 
+    $j('#progress').css('width','0');
+    $j('#progress_text').html('0% Complete');		    
 });
 	
 </script>
\ No newline at end of file




More information about the Movecommons-commits mailing list