[Movecommons-commits] r568 - in trunk: src wp-theme
Mario Gallegos
mgallegos at ourproject.org
Sun Nov 4 18:40:51 CET 2012
Author: mgallegos
Date: 2012-11-04 18:40:51 +0100 (Sun, 04 Nov 2012)
New Revision: 568
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 22:01:26 UTC (rev 567)
+++ trunk/src/mc-dia-form2.js 2012-11-04 17:40:51 UTC (rev 568)
@@ -98,6 +98,18 @@
}
}
+function imageMapInit(){
+ $j( ".map").mapster({
+ fillColor: 'EA8F5F',
+ fillOpacity: 0.8,
+ isSelectable: false,
+ mapKey: 'step',
+ onClick: function (e) {
+ onClickImageMap(e);
+ }
+ });
+}
+
function onClickImageMap(e){
if (e.key=='#first_step'){
$j('#progress_text').html('0% Complete');
@@ -549,7 +561,7 @@
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
@@ -606,7 +618,14 @@
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-->');
+ $j(".map").mapster('unbind');
+ imageMapInit();
+ step_two_reached=true;
+ }
+
//update progress bar
$j('#progress_text').html('20% Complete');
$j('#progress').css('width','68px');
@@ -677,6 +696,14 @@
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-->');
+ $j(".map").mapster('unbind');
+ imageMapInit();
+ step_three_reached=true;
+ }
+
//update progress bar
$j('#progress_text').html('40% Complete');
$j('#progress').css('width','136px');
@@ -752,6 +779,15 @@
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-->');
+ $j(".map").mapster('unbind');
+ imageMapInit();
+ step_four_reached=true;
+ }
+
//update progress bar
$j('#progress_text').html('60% Complete');
$j('#progress').css('width','204px');
@@ -798,6 +834,16 @@
}
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-->');
+ $j(".map").mapster('unbind');
+ imageMapInit();
+ step_five_reached=true;
+ }
//update progress bar
$j('#progress_text').html('80% Complete');
@@ -833,53 +879,31 @@
});
$j('#submit_fifth').click(function(){
-
- 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;
}
+ 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-->');
+ $j(".map").mapster('unbind');
+ imageMapInit();
+ step_six_reached=true;
+ }
+
$j('#progress_text').html('100% Complete');
$j('#progress').css('width','339px');
$j('#fifth_step').slideUp();
$j('#sixth_step').slideDown();
-
-
-/* //update progress bar
- $j('#progress_text').html('50% Complete');
- $j('#progress').css('width','136px');
-
- //slide steps
- $j('#second_step').slideUp();
- $j('#third_step').slideDown();
-*/
});
$j('#p_submit_sixth').click(function(){
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 22:01:26 UTC (rev 567)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 17:40:51 UTC (rev 568)
@@ -415,25 +415,13 @@
<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-->
- <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="#first_step" shape="circle" coords="30,12,12"><!--1-->
</map>
-<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-->
- <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="#first_step" shape="circle" coords="30,12,12"><!--1-->
@@ -492,16 +480,7 @@
$j( "#step5-radio").buttonset();
$j("ul.qtrans_language_chooser > li").css("display", "inline");
$j("ul.qtrans_language_chooser").css("margin-top", "-25px");
- $j( ".map").mapster({
- fillColor: 'EA8F5F',
- fillOpacity: 0.8,
- isSelectable: false,
- mapKey: 'step',
- onClick: function (e) {
- onClickImageMap(e);
- }
- });
-
+ imageMapInit();
});
</script>
\ No newline at end of file
More information about the Movecommons-commits
mailing list