Movecommons-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
November 2012
- 2 participants
- 50 discussions
Author: mgallegos
Date: 2012-11-04 23:44:57 +0100 (Sun, 04 Nov 2012)
New Revision: 577
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 22:40:07 UTC (rev 576)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 22:44:57 UTC (rev 577)
@@ -459,6 +459,7 @@
<script type="text/javascript">
+$j(document).ready(function() {
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
@@ -478,6 +479,6 @@
$j("ul.qtrans_language_chooser").css("float", "left");
$j("ul.qtrans_language_chooser").css("margin-left", "226px");
$j('#progress').css('width','0');
- $j('#progress_text').html('0% Complete');
-
+ $j('#progress_text').html('0% Complete');
+});
</script>
\ No newline at end of file
1
0
Author: mgallegos
Date: 2012-11-04 23:40:07 +0100 (Sun, 04 Nov 2012)
New Revision: 576
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:34:56 UTC (rev 575)
+++ trunk/src/mc-dia-form2.js 2012-11-04 22:40:07 UTC (rev 576)
@@ -6,17 +6,9 @@
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 = {
- 'ininame' : 'Name of your initiative',
- 'url' : 'Web address',
- 'languages' : 'Language(s)',
- 'keywords' : 'Keywords',
- 'location' : 'Location',
- 'email' : 'email address'
- };
+ var field_values = {'ininame' : 'Name of your initiative','url' : 'Web address','languages' : 'Language(s)','keywords' : 'Keywords','location' : 'Location','email' : 'email address' };
+
+ var mc_np = "0",mc_rp = "0",mc_rc = "0",mc_gr = "0",mc_category = "",nameIni = "", urlIni = "",keywordsIni = "";
function clickCheckBox(id,answer){
if(answer=='yes'){
@@ -924,6 +916,12 @@
conf_click_continue();
imageMapInit();
$j(window).load(function () { doadjustwithsleep(0); });
+ $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'] });
});
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 22:34:56 UTC (rev 575)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 22:40:07 UTC (rev 576)
@@ -458,8 +458,7 @@
<link rel="stylesheet" type="text/css" href="/mc/0.1/mc-dia-form2.css"/>
-<script type="text/javascript">
-$j(document).ready(function() {
+<script type="text/javascript">
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
@@ -477,15 +476,8 @@
$j("ul.qtrans_language_chooser > li").css("display", "inline");
$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");
- $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("ul.qtrans_language_chooser").css("margin-left", "226px");
$j('#progress').css('width','0');
$j('#progress_text').html('0% Complete');
-});
</script>
\ No newline at end of file
1
0
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
1
0
Author: mgallegos
Date: 2012-11-04 23:11:44 +0100 (Sun, 04 Nov 2012)
New Revision: 574
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 18:59:14 UTC (rev 573)
+++ trunk/src/mc-dia-form2.js 2012-11-04 22:11:44 UTC (rev 574)
@@ -65,7 +65,7 @@
if(!step_two_reached){
$j('#step1_image_map').append('<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->');
- $j('img[id*="imgStep"]').mapster('unbind');
+ imageMapUnBind();
imageMapInit();
step_two_reached=true;
}
@@ -143,7 +143,7 @@
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('img[id*="imgStep"]').mapster('unbind');
+ imageMapUnBind();
imageMapInit();
step_three_reached=true;
}
@@ -227,7 +227,7 @@
$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('img[id*="imgStep"]').mapster('unbind');
+ imageMapUnBind();
imageMapInit();
step_four_reached=true;
}
@@ -284,7 +284,7 @@
$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('img[id*="imgStep"]').mapster('unbind');
+ imageMapUnBind();
imageMapInit();
step_five_reached=true;
}
@@ -337,7 +337,7 @@
$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('img[id*="imgStep"]').mapster('unbind');
+ imageMapUnBind();
imageMapInit();
step_six_reached=true;
}
@@ -507,7 +507,7 @@
}
function imageMapInit(){
- $j('img[id*="imgStep"]').mapster({
+ $j('.map').mapster({
fillColor: 'EA8F5F',
fillOpacity: 0.8,
isSelectable: false,
@@ -517,6 +517,16 @@
}
});
}
+
+ function imageMapUnBind(){
+ $j('.map').mapster('unbind');
+ $j('#firstStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 19px;margin-top: 0"><div class="marker"></div>');
+ $j('#secondStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 111px;margin-top: 0"><div class="marker"></div>');
+ $j('#thirdStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 203px;margin-top: 0"><div class="marker"></div>');
+ $j('#fourthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 295px;margin-top: 0"><div class="marker"></div>');
+ $j('#fifthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 386px;margin-top: 0"><div class="marker"></div>');
+ $j('#sixthStepProgressLine').html('<img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;"><div class="complete" style="width: 478px;margin-top: 0"><div class="marker"></div>');
+ }
function onClickImageMap(e){
if (e.key=='#first_step'){
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 18:59:14 UTC (rev 573)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 22:11:44 UTC (rev 574)
@@ -33,8 +33,8 @@
<div id="containerSlides">
<div id="first_step" class="mc-form-category-group-a-v2"> <!-- First slide -->
- <div class="progressLine">
- <img id="imgStep1" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;">
+ <div id="firstStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 19px;margin-top: 0">
<div class="marker"></div>
</div>
@@ -65,8 +65,8 @@
<!-- <label id="mc-optional-optional-boxes"><?php _e("Click on those you think corespond to your initiative:", "mc"); ?></label> -->
<div class="mc-cat-group-v2" id="mc-cat-group-a">
<div style="float: left;" class="mc-form-category-group-a-v2">
- <div class="progressLine">
- <img id="imgStep2" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;">
+ <div id="secondStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 111px;">
<div class="marker" style="background-position: -26px 0;"></div>
</div>
@@ -139,8 +139,8 @@
<div id="third_step"><!-- Third slide -->
<div class="mc-cat-group-v2" id="mc-cat-group-b">
<div style="float: left;" class="mc-form-category-group-a-v2">
- <div class="progressLine">
- <img id="imgStep3" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;">
+ <div id="thirdStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 203px;">
<div class="marker" style="background-position: -52px 0;"></div>
</div>
@@ -234,8 +234,8 @@
<div id="fourth_step"><!-- Fourth slide -->
<div class="mc-cat-group-v2" id="mc-cat-group-c">
<div style="float: left;" class="mc-form-category-group-a-v2">
- <div class="progressLine">
- <img id="imgStep4" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;">
+ <div id="fourthStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 295px;">
<div class="marker" style="background-position: -78px 0;"></div>
</div>
@@ -300,8 +300,8 @@
<div id="fifth_step"><!-- Fifth slide -->
<div class="mc-cat-group-v2" id="mc-cat-group-d">
<div style="float: left;" class="mc-form-category-group-a-v2">
- <div class="progressLine">
- <img id="imgStep5" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;">
+ <div id="fifthStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 386px;">
<div class="marker" style="background-position: -104px 0;"></div>
</div>
@@ -371,8 +371,8 @@
</div><!-- End Fifth slide -->
<div id="sixth_step"><!--Sixth slide -->
<div style="float: left;" class="mc-form-category-group-a-v2">
- <div class="progressLine">
- <img id="imgStep6" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="border: 0px;float: left;">
+ <div id="sixthStepProgressLine" class="progressLine">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 478px;">
<div class="marker" style="background-position: -130px 0;"></div>
</div>
1
0
Author: mgallegos
Date: 2012-11-04 19:59:14 +0100 (Sun, 04 Nov 2012)
New Revision: 573
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 18:48:16 UTC (rev 572)
+++ trunk/src/mc-dia-form2.js 2012-11-04 18:59:14 UTC (rev 573)
@@ -65,7 +65,7 @@
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');
+ $j('img[id*="imgStep"]').mapster('unbind');
imageMapInit();
step_two_reached=true;
}
@@ -143,7 +143,7 @@
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');
+ $j('img[id*="imgStep"]').mapster('unbind');
imageMapInit();
step_three_reached=true;
}
@@ -227,7 +227,7 @@
$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');
+ $j('img[id*="imgStep"]').mapster('unbind');
imageMapInit();
step_four_reached=true;
}
@@ -284,7 +284,7 @@
$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');
+ $j('img[id*="imgStep"]').mapster('unbind');
imageMapInit();
step_five_reached=true;
}
@@ -337,7 +337,7 @@
$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');
+ $j('img[id*="imgStep"]').mapster('unbind');
imageMapInit();
step_six_reached=true;
}
@@ -506,8 +506,8 @@
}
}
- function imageMapInit(){
- $j( ".map").mapster({
+ function imageMapInit(){
+ $j('img[id*="imgStep"]').mapster({
fillColor: 'EA8F5F',
fillOpacity: 0.8,
isSelectable: false,
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 18:48:16 UTC (rev 572)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 18:59:14 UTC (rev 573)
@@ -34,7 +34,7 @@
<div id="containerSlides">
<div id="first_step" class="mc-form-category-group-a-v2"> <!-- First slide -->
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep1" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 19px;margin-top: 0">
<div class="marker"></div>
</div>
@@ -66,7 +66,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-a">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep2" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 111px;">
<div class="marker" style="background-position: -26px 0;"></div>
</div>
@@ -140,7 +140,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-b">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep3" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 203px;">
<div class="marker" style="background-position: -52px 0;"></div>
</div>
@@ -235,7 +235,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-c">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep4" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 295px;">
<div class="marker" style="background-position: -78px 0;"></div>
</div>
@@ -301,7 +301,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-d">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep5" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 386px;">
<div class="marker" style="background-position: -104px 0;"></div>
</div>
@@ -372,7 +372,7 @@
<div id="sixth_step"><!--Sixth slide -->
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="border: 0px;float: left;">
+ <img id="imgStep6" src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 478px;">
<div class="marker" style="background-position: -130px 0;"></div>
</div>
1
0
Author: mgallegos
Date: 2012-11-04 19:48:16 +0100 (Sun, 04 Nov 2012)
New Revision: 572
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 18:34:26 UTC (rev 571)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 18:48:16 UTC (rev 572)
@@ -34,7 +34,7 @@
<div id="containerSlides">
<div id="first_step" class="mc-form-category-group-a-v2"> <!-- First slide -->
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step1_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 19px;margin-top: 0">
<div class="marker"></div>
</div>
@@ -66,7 +66,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-a">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 111px;">
<div class="marker" style="background-position: -26px 0;"></div>
</div>
@@ -138,10 +138,9 @@
<div id="third_step"><!-- Third slide -->
<div class="mc-cat-group-v2" id="mc-cat-group-b">
- <div style="float: left;" class="mc-form-category-group-a-v2">
+ <div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="float: left;">
-
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 203px;">
<div class="marker" style="background-position: -52px 0;"></div>
</div>
@@ -236,7 +235,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-c">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step4_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 295px;">
<div class="marker" style="background-position: -78px 0;"></div>
</div>
@@ -302,7 +301,7 @@
<div class="mc-cat-group-v2" id="mc-cat-group-d">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step5_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 386px;">
<div class="marker" style="background-position: -104px 0;"></div>
</div>
@@ -373,7 +372,7 @@
<div id="sixth_step"><!--Sixth slide -->
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step6_image_map" class="map" style="border: 0px;float: left;">
<div class="complete" style="width: 478px;">
<div class="marker" style="background-position: -130px 0;"></div>
</div>
1
0
Author: mgallegos
Date: 2012-11-04 19:34:26 +0100 (Sun, 04 Nov 2012)
New Revision: 571
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 18:09:48 UTC (rev 570)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 18:34:26 UTC (rev 571)
@@ -140,7 +140,8 @@
<div class="mc-cat-group-v2" id="mc-cat-group-b">
<div style="float: left;" class="mc-form-category-group-a-v2">
<div class="progressLine">
- <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step3_image_map" class="map" style="float: left;">
+ <img src="/mc/0.1/images/progressTransparentLine.png" usemap="#step2_image_map" class="map" style="float: left;">
+
<div class="complete" style="width: 203px;">
<div class="marker" style="background-position: -52px 0;"></div>
</div>
@@ -481,7 +482,7 @@
$j("ul.qtrans_language_chooser > li").css("display", "inline");
$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", "225px");
+ $j("ul.qtrans_language_chooser").css("margin-left", "226px");
imageMapInit();
});
1
0
Author: mgallegos
Date: 2012-11-04 19:09:48 +0100 (Sun, 04 Nov 2012)
New Revision: 570
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-04 17:55:33 UTC (rev 569)
+++ trunk/wp-theme/mc2-form.php 2012-11-04 18:09:48 UTC (rev 570)
@@ -480,6 +480,8 @@
$j( "#step5-radio").buttonset();
$j("ul.qtrans_language_chooser > li").css("display", "inline");
$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", "225px");
imageMapInit();
});
1
0
Author: mgallegos
Date: 2012-11-04 18:55:33 +0100 (Sun, 04 Nov 2012)
New Revision: 569
Modified:
trunk/src/mc-dia-form2.js
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-04 17:40:51 UTC (rev 568)
+++ trunk/src/mc-dia-form2.js 2012-11-04 17:55:33 UTC (rev 569)
@@ -1,561 +1,5 @@
var $j = jQuery.noConflict();
-// categories selection
-
-function clickCheckBox(id,answer){
- if(answer=='yes'){
- if ($j("#mc-form-" + id).is('.mc-form-descbox-selected')) return;
- $j('#'+id+'-checkbox').val('S');
- $j("#mc-form-" + id).addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ id).slideDown();
- if(id=='np'){
- $("#registered-non-profit").removeAttr("disabled");
- $("#open-accounting").removeAttr("disabled");
- $("#accept-donations").removeAttr("disabled");
- $j("#mc-form-optional-non-profit").effect("shake", { times:1 }, 200);
- }
- if(id=='rp'){
- $("#terms-of-use").removeAttr("disabled");
- $("#creative-commons").removeAttr("disabled");
- $("#other-license").removeAttr("disabled");
- $("#organization-structure").removeAttr("disabled");
- $("#projects-and-results").removeAttr("disabled");
- $("#methods-procedures").removeAttr("disabled");
- $("#documentation").removeAttr("disabled");
- $j("#mc-form-optional-reproducible").effect("shake", { times:1 }, 200);
- }
- if(id=='gr'){
- $("#decisions-general-assemblies").removeAttr("disabled");
- $("#decisions-consensus").removeAttr("disabled");
- $("#representatives-democratically").removeAttr("disabled");
- $("#meetings-transparent").removeAttr("disabled");
- $("#decisions-voting").removeAttr("disabled");
- $j("#mc-form-optional-grassroots").effect("shake", { times:1 }, 200);
- }
- if(id=='rc')
- $j("#mc-form-optional-reinforcing").effect("shake", { times:1 }, 200);
- }
- else{
- $j('#'+id+'-checkbox').val('N');
- $j("#mc-form-" + id).removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ id).slideUp();
- if(id=='np'){
- $("#registered-non-profit").attr("disabled", "disabled");
- $('#registered-non-profit').attr('checked', false);
- $("#open-accounting").attr("disabled", "disabled");
- $('#open-accounting').attr('checked', false);
- $("#accept-donations").attr("disabled", "disabled");
- $('#accept-donations').attr('checked', false);
- $j('#non-profit-website').hide();
- $j('#infield-non-profit-website').hide();
- $j('#open-accounting-website').hide();
- $j('#infield-open-accounting-website').hide();
- $j('#donation-website').hide();
- $j('#infield-donation-website').hide();
- $j('#submit_second').click();
- }
- if(id=='rp'){
- $("#terms-of-use").attr("disabled", "disabled");
- $('#terms-of-use').attr('checked', false);
- $("#creative-commons").attr("disabled", "disabled");
- $('#creative-commons').attr('checked', false);
- $("#other-license").attr("disabled", "disabled");
- $('#other-license').attr('checked', false);
- $("#organization-structure").attr("disabled", "disabled");
- $('#organization-structure').attr('checked', false);
- $("#projects-and-results").attr("disabled", "disabled");
- $('#projects-and-results').attr('checked', false);
- $("#methods-procedures").attr("disabled", "disabled");
- $('#methods-procedures').attr('checked', false);
- $("#documentation").attr("disabled", "disabled");
- $('#documentation').attr('checked', false);
- $j('#terms-of-use-website').hide();
- $j('#infield-terms-of-use-website').hide();
- $j('#creative-commons-website').hide();
- $j('#infield-creative-commons-website').hide();
- $j('#other-license-website').hide();
- $j('#infield-other-license-website').hide();
- $j('#submit_third').click();
- }
- if(id=='rc'){
- reset_areas();
- $j('#submit_fourth').click();
- }
- if(id=='gr'){
- $("#decisions-general-assemblies").attr("disabled", "disabled");
- $('#decisions-general-assemblies').attr('checked', false);
- $("#decisions-consensus").attr("disabled", "disabled");
- $('#decisions-consensus').attr('checked', false);
- $("#representatives-democratically").attr("disabled", "disabled");
- $('#representatives-democratically').attr('checked', false);
- $("#meetings-transparent").attr("disabled", "disabled");
- $('#meetings-transparent').attr('checked', false);
- $("#decisions-voting").attr("disabled", "disabled");
- $('#decisions-voting').attr('checked', false);
- $j('#submit_fifth').click();
- }
-
- }
-}
-
-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');
- $j('#progress').css('width','0');
- }
- 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) {
- var cat_id = "#mc-form-" + $id;
- $j(cat_id + ",#mc-form-icon-" + $id).click(
- function ()
- {/*
- // if ($id != "rc") {
- $j(cat_id).addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ $id).slideDown();
- //}
- $j("#mc-form-" + $id2).removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-"+ $id2).slideUp();
- // $j("#mc-form-more-link-" + $id2).show('slow');
- $j("#mc-form-less-link-" + $id2).hide();
- // $j("#mc-form-" + $id).removeAttr("title");
- // $j("#mc-form-" + $id2).attr("title", click_to_select);
- $j("#mc-form-more-text-" + $id2).slideUp(function() {adjustHeights();});*/
- if (cat_id == "#mc-form-rc") {
- //$j("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
- mc_rc="0";
- update_logo($id);
- //$j('div.blockMe3').unblock();
- //$('#mc-form-optional-reinforcing').show();
- } else if (cat_id == "#mc-form-nrc") {
- //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
- reset_areas();
- update_logo($id);
- } else if (cat_id == "#mc-form-np") {
- //$j('div.blockMe1').unblock();
- //$('#mc-form-optional-non-profit').show();
- } else if (cat_id == "#mc-form-rp") {
- //$j('div.blockMe2').unblock();
- //$('#mc-form-optional-reproducible').show();
- } else if (cat_id == "#mc-form-gr") {
- //$j('div.blockMe4').unblock();
- //$('#mc-form-optional-grassroots').show();
- } else {
- update_logo($id);
- //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
- }
- });
-};
-
-function hover_cat($id) {
- var cat_id = "#mc-form-" + $id;
- $j(cat_id + ",#mc-form-icon-" + $id).hover(
- function ()
- {
- $j(cat_id).addClass("mc-form-descbox-high");
- //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
- // $j("#mc-form-more-link-"+$id).show();
- }, function () {
- $j(cat_id).removeClass("mc-form-descbox-high");
- //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
- // $j("#mc-form-more-link-"+$id).hide();
- });
-};
-
-// More links
-
-function click_more_link($id) {
- $j("#mc-form-more-link-" + $id).click(
- function (event) {
- event.stopPropagation();
- $j(this).hide();
- /*if ($id == "rc") {
- $j("#mc-cat-rc-options").slideDown();
- }*/
- $j("#mc-form-less-link-" + $id).show('slow');
- $j("#mc-form-more-text-" + $id).show('slow',function() {adjustHeights();});
-
- });
-};
-
-function click_less_link($id) {
- $j("#mc-form-less-link-" + $id).click(
- function (event) {
- event.stopPropagation();
- $j(this).hide();
- /*if ($id == "rc") {
- $j("#mc-cat-rc-options").slideUp();
- }*/
- $j("#mc-form-more-link-" + $id).show('slow');
- $j("#mc-form-more-text-" + $id).slideUp(function() {adjustHeights();});
- //if ($id == "rc") { $j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});}
- });
-};
-
-function hover_more_link($id) {
- $j("#mc-form-more-link-" + $id).hover(
- function () {
- $j(this).addClass("mc-form-link-high");
- }, function () {
- $j(this).removeClass("mc-form-link-high");
- });
-};
-
-function hover_less_link($id) {
- $j("#mc-form-less-link-" + $id).hover(
- function () {
- $j(this).addClass("mc-form-link-high");
- }, function () {
- $j(this).removeClass("mc-form-link-high");
- });
-};
-
-function hide_initial($id) {
- $j("#mc-form-more-link-" + $id).hide();
- //$j("#mc-form-more-text-" + $id).hide();
- $j("#mc-form-less-link-" + $id).hide();
-};
-
-function dclick_toggle($id) {
- $j("#mc-form-" + $id).dblclick(
- function () {
- var id_text = "#mc-form-more-text-" + $id;
- var id_link = "#mc-form-more-link-" + $id;
- if ($j(id_text).is(':visible')) { $j(id_text).slideUp(); $j(id_link).slideDown(); }
- else { $j(id_text).slideDown(); $j(id_link).slideUp(); };
- });};
-
-function reset_areas() {
- mc_rc="0";
- $j("#mc-cat-rc-option-box-ec").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-bo").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-to").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-cat-rc-option-box-di").removeClass("mc-cat-rc-option-box-selected");
- $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc60.png"});
- $j("#mc-cat-selected-rc").slideUp();
-}
-
-function select_area($id) {
- var cat_id = "#mc-cat-rc-option-box-" + $id;
- $j(cat_id + ",#mc-cat-rc-option-icon-" + $id).click(
- function (event) {
- if($j('#rc-checkbox').val()=='N')
- return;
- event.stopPropagation();
- reset_areas();
- $j("#mc-form-rc").addClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-rc").slideDown();
- $j(cat_id).addClass("mc-cat-rc-option-box-selected");
- $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc" + $id + "60.png"});
- update_logo($id);
- });
-};
-
-// Inspired in:
-// http://stackoverflow.com/questions/803688/how-do-i-keep-multiple-divs-the-s…
-
-function adjustPairHeights($id1, $id2) {
- var maxHeight = 0;
- var idcat1 = "#mc-form-category-group-" + $id1;
- var idcat2 = "#mc-form-category-group-" + $id2;
- var ids = idcat1 + "," + idcat2;
- $j(ids).each(function(){
- $j(this).height('auto');
- if (maxHeight < $j(this).height()) {maxHeight = $j(this).height();}
- });
- if($j(idcat1).height() < maxHeight) { $j(idcat1).height(maxHeight); };
- if($j(idcat2).height() < maxHeight) { $j(idcat2).height(maxHeight); };
-}
-
-function adjustHeights() {
- adjustPairHeights("aa", "ab");
- adjustPairHeights("bb", "ba");
-}
-
-function update_logo($cat) {
- if ($cat == "np" ) mc_np="np-";
- if ($cat == "nnp") mc_np="fp-";
- if ($cat == "rp" ) mc_rp="rp-";
- if ($cat == "nrp") mc_rp="ex-";
- if ($cat == "gr" ) mc_gr="gr-";
- if ($cat == "ngr") mc_gr="rs-";
- if ($cat == "ec" || $cat == "bo" ||
- $cat == "to" || $cat == "di") mc_rc="rc." + $cat + "-";
- if ($cat == "nrc") mc_rc="ro-";
-
- mc_category = "";
- var icon_url = "";
-
- if (mc_np != "0" && mc_rp != "0" && mc_rc != "0" && mc_gr != "0") {
- if (mc_np!="") { mc_category += mc_np; }
- if (mc_rp!="") { mc_category += mc_rp; }
- if (mc_rc!="") { mc_category += mc_rc; }
- if (mc_gr!="") { mc_category += mc_gr; }
- // /lang/mc-0-1-np-rp-sc-dc/
- mc_category = mc_category.replace(/-$/, "");
- icon_url = "/mc/0.1/images/" + mc_category + "-120x90-0.1.png";
- }
- if (icon_url != "") {
- $j("#mc-form-icon-result").attr({src : icon_url});
- $j("#mc-form-icon-result").show('fast');
- } else {
- $j("#mc-form-icon-result").hide();
- }
- checkIfFormReady();
-}
-
-function checkIfFormReady() {
- urlIni = $j('#url').val();
- nameIni = $j('#ininame').val();
- keywordsIni = $j('#keywords').val();
- if (mc_category != "" && nameIni.length > 0 && urlIni.length > 0) {
- $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-enabled");
- $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-disabled");
- $j("#mc-dia-continue-btn").effect("highlight", {}, 2000);
- } else {
- $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
- $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-enabled");
- }
-}
-
-function confInputValidation($id) {
- $j($id).bind("change keyup", function(event) {
- checkIfFormReady();
- });
-}
-
-// adapted from:
-// http://stackoverflow.com/questions/1277070/is-there-an-equivalent-javascrip…
-function doadjustwithsleep( part ) {
- if( part == 0 ) {
- setTimeout( function() { doadjustwithsleep( 1 ); }, 1000 );
- } else if( part == 1 ) {
- adjustHeights();
- }
-}
-
-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() {
- $j("#mc-dia-continue-btn").click(
- function (event) {
- event.stopPropagation();
- if (mc_category != "" && urlIni.length > 0 && nameIni.length > 0) {
- var currentUrl = window.location.pathname.split('/');
- var langCode = "";
- if (currentUrl[1] == 'preview') { langCode = 'en'; }
- else { langCode = currentUrl[1]; };
- window.location.href="/" + langCode + "/" + mc_category + "-html/0.1/?ini_name=" + nameIni +
- "&ini_url=" + urlIni + "&ini_keywords=" + keywordsIni;
- }
- });
-};
-
-
-// http://www.richreuter.com/2008/08/01/UsingJQueryToResizeTextBoxesToMaxLengt…
-function max_textsize() {
- $j('input[type=text]').each(function() {
- var max_length = $j(this).attr('maxlength');
- var multiplier = (max_length > 10) ? 7.3 : 8;
- var w = (max_length * multiplier) + "px";
- $j(this).width(w);
-});
-
-}
-
-// http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-an…
-$.fn.labelOver = function(overClass) {
- return this.each(function()
- {
- var label = $j(this);
- var f = label.attr('for');
- if (f) {
- var input = $j('#' + f);
-
- this.hide = function() {
- label.css({ textIndent: -10000 });
- };
-
- this.show = function() {
- if (input.val() == '') label.css({ textIndent: 0 });
- };
-
- // handlers
- input.focus(this.hide);
- input.blur(this.show);
- label.addClass(overClass).click(function(){ input.focus(); });
-
- if (input.val() != '') this.hide();
- }
- });
-};
-
-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
-
-/*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("#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("#registered-non-profit").click(function(){
- if($j("#registered-non-profit").attr("checked")){
- $j('#non-profit-website').show();
- $j('#infield-non-profit-website').show();
- }
- else{
- $j('#non-profit-website').hide();
- $j('#infield-non-profit-website').hide();
- }
-});
-
-
-$j("#open-accounting").click(function(){
- if($j("#open-accounting").attr("checked")){
- $j('#open-accounting-website').show();
- $j('#infield-open-accounting-website').show();
- }
- else{
- $j('#open-accounting-website').hide();
- $j('#infield-open-accounting-website').hide();
- }
-});
-
-$j("#accept-donations").click(function(){
- if($j("#accept-donations").attr("checked")){
- $j('#donation-website').show();
- $j('#infield-donation-website').show();
- }
- else{
- $j('#donation-website').hide();
- $j('#infield-donation-website').hide();
- }
-});
-
-$j("#terms-of-use").click(function(){
- if($j("#terms-of-use").attr("checked")){
- $j('#terms-of-use-website').show();
- $j('#infield-terms-of-use-website').show();
- }
- else{
- $j('#terms-of-use-website').hide();
- $j('#infield-terms-of-use-website').hide();
- }
-});
-
-
-$j("#creative-commons").click(function(){
- if($j("#creative-commons").attr("checked")){
- $j('#creative-commons-website').show();
- $j('#infield-creative-commons-website').show();
- }
- else{
- $j('#creative-commons-website').hide();
- $j('#infield-creative-commons-website').hide();
- }
-});
-
-$j("#other-license").click(function(){
- if($j("#other-license").attr("checked")){
- $j('#other-license-website').show();
- $j('#infield-other-license-website').show();
- }
- else{
- $j('#other-license-website').hide();
- $j('#infield-other-license-website').hide();
- }
-});
-
-
$j(function(){
var current_step='#first_step';
@@ -965,6 +409,559 @@
$j(this).trigger('keydown');
}
});
+
+ function clickCheckBox(id,answer){
+ if(answer=='yes'){
+ if ($j("#mc-form-" + id).is('.mc-form-descbox-selected')) return;
+ $j('#'+id+'-checkbox').val('S');
+ $j("#mc-form-" + id).addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ id).slideDown();
+ if(id=='np'){
+ $("#registered-non-profit").removeAttr("disabled");
+ $("#open-accounting").removeAttr("disabled");
+ $("#accept-donations").removeAttr("disabled");
+ $j("#mc-form-optional-non-profit").effect("shake", { times:1 }, 200);
+ }
+ if(id=='rp'){
+ $("#terms-of-use").removeAttr("disabled");
+ $("#creative-commons").removeAttr("disabled");
+ $("#other-license").removeAttr("disabled");
+ $("#organization-structure").removeAttr("disabled");
+ $("#projects-and-results").removeAttr("disabled");
+ $("#methods-procedures").removeAttr("disabled");
+ $("#documentation").removeAttr("disabled");
+ $j("#mc-form-optional-reproducible").effect("shake", { times:1 }, 200);
+ }
+ if(id=='gr'){
+ $("#decisions-general-assemblies").removeAttr("disabled");
+ $("#decisions-consensus").removeAttr("disabled");
+ $("#representatives-democratically").removeAttr("disabled");
+ $("#meetings-transparent").removeAttr("disabled");
+ $("#decisions-voting").removeAttr("disabled");
+ $j("#mc-form-optional-grassroots").effect("shake", { times:1 }, 200);
+ }
+ if(id=='rc')
+ $j("#mc-form-optional-reinforcing").effect("shake", { times:1 }, 200);
+ }
+ else{
+ $j('#'+id+'-checkbox').val('N');
+ $j("#mc-form-" + id).removeClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ id).slideUp();
+ if(id=='np'){
+ $("#registered-non-profit").attr("disabled", "disabled");
+ $('#registered-non-profit').attr('checked', false);
+ $("#open-accounting").attr("disabled", "disabled");
+ $('#open-accounting').attr('checked', false);
+ $("#accept-donations").attr("disabled", "disabled");
+ $('#accept-donations').attr('checked', false);
+ $j('#non-profit-website').hide();
+ $j('#infield-non-profit-website').hide();
+ $j('#open-accounting-website').hide();
+ $j('#infield-open-accounting-website').hide();
+ $j('#donation-website').hide();
+ $j('#infield-donation-website').hide();
+ $j('#submit_second').click();
+ }
+ if(id=='rp'){
+ $("#terms-of-use").attr("disabled", "disabled");
+ $('#terms-of-use').attr('checked', false);
+ $("#creative-commons").attr("disabled", "disabled");
+ $('#creative-commons').attr('checked', false);
+ $("#other-license").attr("disabled", "disabled");
+ $('#other-license').attr('checked', false);
+ $("#organization-structure").attr("disabled", "disabled");
+ $('#organization-structure').attr('checked', false);
+ $("#projects-and-results").attr("disabled", "disabled");
+ $('#projects-and-results').attr('checked', false);
+ $("#methods-procedures").attr("disabled", "disabled");
+ $('#methods-procedures').attr('checked', false);
+ $("#documentation").attr("disabled", "disabled");
+ $('#documentation').attr('checked', false);
+ $j('#terms-of-use-website').hide();
+ $j('#infield-terms-of-use-website').hide();
+ $j('#creative-commons-website').hide();
+ $j('#infield-creative-commons-website').hide();
+ $j('#other-license-website').hide();
+ $j('#infield-other-license-website').hide();
+ $j('#submit_third').click();
+ }
+ if(id=='rc'){
+ reset_areas();
+ $j('#submit_fourth').click();
+ }
+ if(id=='gr'){
+ $("#decisions-general-assemblies").attr("disabled", "disabled");
+ $('#decisions-general-assemblies').attr('checked', false);
+ $("#decisions-consensus").attr("disabled", "disabled");
+ $('#decisions-consensus').attr('checked', false);
+ $("#representatives-democratically").attr("disabled", "disabled");
+ $('#representatives-democratically').attr('checked', false);
+ $("#meetings-transparent").attr("disabled", "disabled");
+ $('#meetings-transparent').attr('checked', false);
+ $("#decisions-voting").attr("disabled", "disabled");
+ $('#decisions-voting').attr('checked', false);
+ $j('#submit_fifth').click();
+ }
+
+ }
+ }
+
+ 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');
+ $j('#progress').css('width','0');
+ }
+ 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) {
+ var cat_id = "#mc-form-" + $id;
+ $j(cat_id + ",#mc-form-icon-" + $id).click(
+ function ()
+ {/*
+ // if ($id != "rc") {
+ $j(cat_id).addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ $id).slideDown();
+ //}
+ $j("#mc-form-" + $id2).removeClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-"+ $id2).slideUp();
+ // $j("#mc-form-more-link-" + $id2).show('slow');
+ $j("#mc-form-less-link-" + $id2).hide();
+ // $j("#mc-form-" + $id).removeAttr("title");
+ // $j("#mc-form-" + $id2).attr("title", click_to_select);
+ $j("#mc-form-more-text-" + $id2).slideUp(function() {adjustHeights();});*/
+ if (cat_id == "#mc-form-rc") {
+ //$j("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
+ mc_rc="0";
+ update_logo($id);
+ //$j('div.blockMe3').unblock();
+ //$('#mc-form-optional-reinforcing').show();
+ } else if (cat_id == "#mc-form-nrc") {
+ //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+ reset_areas();
+ update_logo($id);
+ } else if (cat_id == "#mc-form-np") {
+ //$j('div.blockMe1').unblock();
+ //$('#mc-form-optional-non-profit').show();
+ } else if (cat_id == "#mc-form-rp") {
+ //$j('div.blockMe2').unblock();
+ //$('#mc-form-optional-reproducible').show();
+ } else if (cat_id == "#mc-form-gr") {
+ //$j('div.blockMe4').unblock();
+ //$('#mc-form-optional-grassroots').show();
+ } else {
+ update_logo($id);
+ //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+ }
+ });
+ };
+
+ function hover_cat($id) {
+ var cat_id = "#mc-form-" + $id;
+ $j(cat_id + ",#mc-form-icon-" + $id).hover(
+ function ()
+ {
+ $j(cat_id).addClass("mc-form-descbox-high");
+ //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
+ // $j("#mc-form-more-link-"+$id).show();
+ }, function () {
+ $j(cat_id).removeClass("mc-form-descbox-high");
+ //if ($j('#mc-form-less-link-'+$id).is(':hidden'))
+ // $j("#mc-form-more-link-"+$id).hide();
+ });
+ };
+
+ // More links
+
+ function click_more_link($id) {
+ $j("#mc-form-more-link-" + $id).click(
+ function (event) {
+ event.stopPropagation();
+ $j(this).hide();
+ /*if ($id == "rc") {
+ $j("#mc-cat-rc-options").slideDown();
+ }*/
+ $j("#mc-form-less-link-" + $id).show('slow');
+ $j("#mc-form-more-text-" + $id).show('slow',function() {adjustHeights();});
+
+ });
+ };
+
+ function click_less_link($id) {
+ $j("#mc-form-less-link-" + $id).click(
+ function (event) {
+ event.stopPropagation();
+ $j(this).hide();
+ /*if ($id == "rc") {
+ $j("#mc-cat-rc-options").slideUp();
+ }*/
+ $j("#mc-form-more-link-" + $id).show('slow');
+ $j("#mc-form-more-text-" + $id).slideUp(function() {adjustHeights();});
+ //if ($id == "rc") { $j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});}
+ });
+ };
+
+ function hover_more_link($id) {
+ $j("#mc-form-more-link-" + $id).hover(
+ function () {
+ $j(this).addClass("mc-form-link-high");
+ }, function () {
+ $j(this).removeClass("mc-form-link-high");
+ });
+ };
+
+ function hover_less_link($id) {
+ $j("#mc-form-less-link-" + $id).hover(
+ function () {
+ $j(this).addClass("mc-form-link-high");
+ }, function () {
+ $j(this).removeClass("mc-form-link-high");
+ });
+ };
+
+ function hide_initial($id) {
+ $j("#mc-form-more-link-" + $id).hide();
+ //$j("#mc-form-more-text-" + $id).hide();
+ $j("#mc-form-less-link-" + $id).hide();
+ };
+
+ function dclick_toggle($id) {
+ $j("#mc-form-" + $id).dblclick(
+ function () {
+ var id_text = "#mc-form-more-text-" + $id;
+ var id_link = "#mc-form-more-link-" + $id;
+ if ($j(id_text).is(':visible')) { $j(id_text).slideUp(); $j(id_link).slideDown(); }
+ else { $j(id_text).slideDown(); $j(id_link).slideUp(); };
+ });};
+
+ function reset_areas() {
+ mc_rc="0";
+ $j("#mc-cat-rc-option-box-ec").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-bo").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-to").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-cat-rc-option-box-di").removeClass("mc-cat-rc-option-box-selected");
+ $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc60.png"});
+ $j("#mc-cat-selected-rc").slideUp();
+ }
+
+ function select_area($id) {
+ var cat_id = "#mc-cat-rc-option-box-" + $id;
+ $j(cat_id + ",#mc-cat-rc-option-icon-" + $id).click(
+ function (event) {
+ if($j('#rc-checkbox').val()=='N')
+ return;
+ event.stopPropagation();
+ reset_areas();
+ $j("#mc-form-rc").addClass("mc-form-descbox-selected");
+ $j("#mc-cat-selected-rc").slideDown();
+ $j(cat_id).addClass("mc-cat-rc-option-box-selected");
+ $j("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc" + $id + "60.png"});
+ update_logo($id);
+ });
+ };
+
+ // Inspired in:
+ // http://stackoverflow.com/questions/803688/how-do-i-keep-multiple-divs-the-s…
+
+ function adjustPairHeights($id1, $id2) {
+ var maxHeight = 0;
+ var idcat1 = "#mc-form-category-group-" + $id1;
+ var idcat2 = "#mc-form-category-group-" + $id2;
+ var ids = idcat1 + "," + idcat2;
+ $j(ids).each(function(){
+ $j(this).height('auto');
+ if (maxHeight < $j(this).height()) {maxHeight = $j(this).height();}
+ });
+ if($j(idcat1).height() < maxHeight) { $j(idcat1).height(maxHeight); };
+ if($j(idcat2).height() < maxHeight) { $j(idcat2).height(maxHeight); };
+ }
+
+ function adjustHeights() {
+ adjustPairHeights("aa", "ab");
+ adjustPairHeights("bb", "ba");
+ }
+
+ function update_logo($cat) {
+ if ($cat == "np" ) mc_np="np-";
+ if ($cat == "nnp") mc_np="fp-";
+ if ($cat == "rp" ) mc_rp="rp-";
+ if ($cat == "nrp") mc_rp="ex-";
+ if ($cat == "gr" ) mc_gr="gr-";
+ if ($cat == "ngr") mc_gr="rs-";
+ if ($cat == "ec" || $cat == "bo" ||
+ $cat == "to" || $cat == "di") mc_rc="rc." + $cat + "-";
+ if ($cat == "nrc") mc_rc="ro-";
+
+ mc_category = "";
+ var icon_url = "";
+
+ if (mc_np != "0" && mc_rp != "0" && mc_rc != "0" && mc_gr != "0") {
+ if (mc_np!="") { mc_category += mc_np; }
+ if (mc_rp!="") { mc_category += mc_rp; }
+ if (mc_rc!="") { mc_category += mc_rc; }
+ if (mc_gr!="") { mc_category += mc_gr; }
+ // /lang/mc-0-1-np-rp-sc-dc/
+ mc_category = mc_category.replace(/-$/, "");
+ icon_url = "/mc/0.1/images/" + mc_category + "-120x90-0.1.png";
+ }
+ if (icon_url != "") {
+ $j("#mc-form-icon-result").attr({src : icon_url});
+ $j("#mc-form-icon-result").show('fast');
+ } else {
+ $j("#mc-form-icon-result").hide();
+ }
+ checkIfFormReady();
+ }
+
+ function checkIfFormReady() {
+ urlIni = $j('#url').val();
+ nameIni = $j('#ininame').val();
+ keywordsIni = $j('#keywords').val();
+ if (mc_category != "" && nameIni.length > 0 && urlIni.length > 0) {
+ $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-enabled");
+ $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-disabled");
+ $j("#mc-dia-continue-btn").effect("highlight", {}, 2000);
+ } else {
+ $j("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
+ $j("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-enabled");
+ }
+ }
+
+ function confInputValidation($id) {
+ $j($id).bind("change keyup", function(event) {
+ checkIfFormReady();
+ });
+ }
+
+ // adapted from:
+ // http://stackoverflow.com/questions/1277070/is-there-an-equivalent-javascrip…
+ function doadjustwithsleep( part ) {
+ if( part == 0 ) {
+ setTimeout( function() { doadjustwithsleep( 1 ); }, 1000 );
+ } else if( part == 1 ) {
+ adjustHeights();
+ }
+ }
+
+ 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() {
+ $j("#mc-dia-continue-btn").click(
+ function (event) {
+ event.stopPropagation();
+ if (mc_category != "" && urlIni.length > 0 && nameIni.length > 0) {
+ var currentUrl = window.location.pathname.split('/');
+ var langCode = "";
+ if (currentUrl[1] == 'preview') { langCode = 'en'; }
+ else { langCode = currentUrl[1]; };
+ window.location.href="/" + langCode + "/" + mc_category + "-html/0.1/?ini_name=" + nameIni +
+ "&ini_url=" + urlIni + "&ini_keywords=" + keywordsIni;
+ }
+ });
+ };
+
+
+ // http://www.richreuter.com/2008/08/01/UsingJQueryToResizeTextBoxesToMaxLengt…
+ function max_textsize() {
+ $j('input[type=text]').each(function() {
+ var max_length = $j(this).attr('maxlength');
+ var multiplier = (max_length > 10) ? 7.3 : 8;
+ var w = (max_length * multiplier) + "px";
+ $j(this).width(w);
+ });
+
+ }
+
+ // http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-an…
+ $.fn.labelOver = function(overClass) {
+ return this.each(function()
+ {
+ var label = $j(this);
+ var f = label.attr('for');
+ if (f) {
+ var input = $j('#' + f);
+
+ this.hide = function() {
+ label.css({ textIndent: -10000 });
+ };
+
+ this.show = function() {
+ if (input.val() == '') label.css({ textIndent: 0 });
+ };
+
+ // handlers
+ input.focus(this.hide);
+ input.blur(this.show);
+ label.addClass(overClass).click(function(){ input.focus(); });
+
+ if (input.val() != '') this.hide();
+ }
+ });
+ };
+
+ 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
+
+ /*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("#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("#registered-non-profit").click(function(){
+ if($j("#registered-non-profit").attr("checked")){
+ $j('#non-profit-website').show();
+ $j('#infield-non-profit-website').show();
+ }
+ else{
+ $j('#non-profit-website').hide();
+ $j('#infield-non-profit-website').hide();
+ }
+ });
+
+
+ $j("#open-accounting").click(function(){
+ if($j("#open-accounting").attr("checked")){
+ $j('#open-accounting-website').show();
+ $j('#infield-open-accounting-website').show();
+ }
+ else{
+ $j('#open-accounting-website').hide();
+ $j('#infield-open-accounting-website').hide();
+ }
+ });
+
+ $j("#accept-donations").click(function(){
+ if($j("#accept-donations").attr("checked")){
+ $j('#donation-website').show();
+ $j('#infield-donation-website').show();
+ }
+ else{
+ $j('#donation-website').hide();
+ $j('#infield-donation-website').hide();
+ }
+ });
+
+ $j("#terms-of-use").click(function(){
+ if($j("#terms-of-use").attr("checked")){
+ $j('#terms-of-use-website').show();
+ $j('#infield-terms-of-use-website').show();
+ }
+ else{
+ $j('#terms-of-use-website').hide();
+ $j('#infield-terms-of-use-website').hide();
+ }
+ });
+
+
+ $j("#creative-commons").click(function(){
+ if($j("#creative-commons").attr("checked")){
+ $j('#creative-commons-website').show();
+ $j('#infield-creative-commons-website').show();
+ }
+ else{
+ $j('#creative-commons-website').hide();
+ $j('#infield-creative-commons-website').hide();
+ }
+ });
+
+ $j("#other-license").click(function(){
+ if($j("#other-license").attr("checked")){
+ $j('#other-license-website').show();
+ $j('#infield-other-license-website').show();
+ }
+ else{
+ $j('#other-license-website').hide();
+ $j('#infield-other-license-website').hide();
+ }
+ });
});
1
0
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
1
0