[Movecommons-commits] r566 - in trunk: src wp-theme
Mario Gallegos
mgallegos at ourproject.org
Thu Nov 1 18:09:34 CET 2012
Author: mgallegos
Date: 2012-11-01 18:09:33 +0100 (Thu, 01 Nov 2012)
New Revision: 566
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:44:04 UTC (rev 565)
+++ trunk/src/mc-dia-form2.js 2012-11-01 17:09:33 UTC (rev 566)
@@ -98,6 +98,35 @@
}
}
+function onClickImageMap(e){
+ $j(current_step).slideUp();
+ $j(e.key).slideDown();
+ if (e.key=='#first_step'){
+ $j('#progress_text').html('0% Complete');
+ $j('#progress').css('width','0');
+ }
+ else if (e.key=='#second_step'){
+ $j('#progress_text').html('20% Complete');
+ $j('#progress').css('width','68px');
+ }
+ else if (e.key=='#third_step'){
+ $j('#progress_text').html('40% Complete');
+ $j('#progress').css('width','136px');
+ }
+ else if (e.key=='#fourth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ }
+ else if (e.key=='#fifth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ }
+ else if (e.key=='#sixth_step'){
+ $j('#progress_text').html('100% Complete');
+ $j('#progress').css('width','339px');
+ }
+}
+
function select_cat($id, $id2) {
var cat_id = "#mc-form-" + $id;
$j(cat_id + ",#mc-form-icon-" + $id).click(
@@ -498,34 +527,7 @@
}
});
-/*
-$j("#button-close-a").click(function(){
- $j("#mc-form-np").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-np").slideUp();
- $('#mc-form-optional-non-profit').hide();
-});
-$j("#button-close-b").click(function(){
- $j("#mc-form-rp").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-rp").slideUp();
- $('#mc-form-optional-reproducible').hide();
-});
-
-$j("#button-close-c").click(function(){
- $j("#mc-form-rc").removeClass("mc-form-descbox-selected");
- //$j("#mc-cat-selected-rc").slideUp();
- reset_areas();
- $('#mc-form-optional-reinforcing').hide();
-});
-
-$j("#button-close-d").click(function(){
- $j("#mc-form-gr").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-gr").slideUp();
- $('#mc-form-optional-grassroots').hide();
-});
-*/
-
-
$j(function(){
//original field values
var field_values = {
@@ -840,6 +842,29 @@
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 16:44:04 UTC (rev 565)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 17:09:33 UTC (rev 566)
@@ -413,7 +413,7 @@
<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_all" name="step1_image_map_all">
<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,7 +425,7 @@
<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="step2_image_map_all" name="step2_image_map_all">
<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-->
@@ -506,6 +506,7 @@
<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();
@@ -528,23 +529,9 @@
isSelectable: false,
mapKey: 'step',
onClick: function (e) {
- //$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);
+ onClickImageMap(e);
}
});
-
});
More information about the Movecommons-commits
mailing list