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
- 632 discussions
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
Author: mgallegos
Date: 2012-11-01 23:01:26 +0100 (Thu, 01 Nov 2012)
New Revision: 567
Modified:
trunk/src/mc-dia-form2.js
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-01 17:09:33 UTC (rev 566)
+++ trunk/src/mc-dia-form2.js 2012-11-01 22:01:26 UTC (rev 567)
@@ -98,9 +98,7 @@
}
}
-function onClickImageMap(e){
- $j(current_step).slideUp();
- $j(e.key).slideDown();
+function onClickImageMap(e){
if (e.key=='#first_step'){
$j('#progress_text').html('0% Complete');
$j('#progress').css('width','0');
@@ -108,23 +106,41 @@
else if (e.key=='#second_step'){
$j('#progress_text').html('20% Complete');
$j('#progress').css('width','68px');
+ if($j('#np-checkbox').val()=='S')
+ $j('label[for*="step2-yes"]').addClass('ui-state-active');
+ else if ($j('#np-checkbox').val()=='N')
+ $j('label[for*="step2-no"]').addClass('ui-state-active');
}
else if (e.key=='#third_step'){
$j('#progress_text').html('40% Complete');
$j('#progress').css('width','136px');
+ if($j('#rp-checkbox').val()=='S')
+ $j('label[for*="step3-yes"]').addClass('ui-state-active');
+ else if ($j('#rp-checkbox').val()=='N')
+ $j('label[for*="step3-no"]').addClass('ui-state-active');
}
else if (e.key=='#fourth_step'){
$j('#progress_text').html('60% Complete');
$j('#progress').css('width','204px');
+ if($j('#rc-checkbox').val()=='S')
+ $j('label[for*="step4-yes"]').addClass('ui-state-active');
+ else if ($j('#rc-checkbox').val()=='N')
+ $j('label[for*="step4-no"]').addClass('ui-state-active');
}
else if (e.key=='#fifth_step'){
$j('#progress_text').html('60% Complete');
$j('#progress').css('width','204px');
+ if($j('#gr-checkbox').val()=='S')
+ $j('label[for*="step5-yes"]').addClass('ui-state-active');
+ else if ($j('#gr-checkbox').val()=='N')
+ $j('label[for*="step5-no"]').addClass('ui-state-active');
}
else if (e.key=='#sixth_step'){
$j('#progress_text').html('100% Complete');
$j('#progress').css('width','339px');
}
+ $j(current_step).slideUp();
+ $j(e.key).slideDown();
}
function select_cat($id, $id2) {
@@ -529,6 +545,11 @@
$j(function(){
+
+ var current_step='#first_step';
+
+ var step_two_reached=step_three_reached=step_four_reached=step_five_reached=step_six_reached=false;
+
//original field values
var field_values = {
//id : value
@@ -815,6 +836,29 @@
current_step='#sixth_step';
+ /*if(!step_six_reached){
+ $j('img[usemap*="step1_image_map"]').attr('usemap','step1_image_map_all');
+ $j('img[usemap*="step2_image_map"]').attr('usemap','step2_image_map_all');
+ $j('img[usemap*="step3_image_map"]').attr('usemap','step3_image_map_all');
+ $j('img[usemap*="step4_image_map"]').attr('usemap','step4_image_map_all');
+ $j('img[usemap*="step5_image_map"]').attr('usemap','step5_image_map_all');
+ $j('img[usemap*="step6_image_map"]').attr('usemap','step6_image_map_all');
+
+ $j(".map").mapster('unbind');
+
+ $j( ".map").mapster({
+ fillColor: 'EA8F5F',
+ fillOpacity: 0.8,
+ isSelectable: false,
+ mapKey: 'step',
+ onClick: function (e) {
+ onClickImageMap(e);
+ }
+ });
+
+ step_six_reached = true;
+ }*/
+
if($j('#gr-checkbox').val()=='A'){
$j('#step5question').effect("shake", { times:3 }, 50);
return;
@@ -840,31 +884,8 @@
$j('#p_submit_sixth').click(function(){
- current_step='#fifth_step';
+ current_step='#fifth_step';
- if(!step_six_reached){
- $j('img[usemap*="step1_image_map"]').attr('usemap','step1_image_map_all');
- $j('img[usemap*="step2_image_map"]').attr('usemap','step2_image_map_all');
- $j('img[usemap*="step3_image_map"]').attr('usemap','step3_image_map_all');
- $j('img[usemap*="step4_image_map"]').attr('usemap','step4_image_map_all');
- $j('img[usemap*="step5_image_map"]').attr('usemap','step5_image_map_all');
- $j('img[usemap*="step6_image_map"]').attr('usemap','step6_image_map_all');
-
- $j(".map").mapster('unbind');
-
- $j( ".map").mapster({
- fillColor: 'EA8F5F',
- fillOpacity: 0.8,
- isSelectable: false,
- mapKey: 'step',
- onClick: function (e) {
- onClickImageMap(e);
- }
- });
-
- step_six_reached = true;
- }
-
//update progress bar
$j('#progress_text').html('80% Complete');
$j('#progress').css('width','272px');
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 17:09:33 UTC (rev 566)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 22:01:26 UTC (rev 567)
@@ -413,7 +413,8 @@
<div class="mc-dia-continue-btn" id="mc-dia-continue-btn"><?php _e("Continue", "mc"); ?></div>
-->
-<map id="step1_image_map_all" name="step1_image_map_all">
+
+<map id="step1_image_map" name="step1_image_map">
<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
@@ -425,8 +426,9 @@
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
</map>
-<map id="step2_image_map_all" name="step2_image_map_all">
+<map id="step_image_map_all" name="step_image_map_all">
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
@@ -438,13 +440,6 @@
<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
</map>
-<map id="step3_image_map_all" name="step3_image_map_all">
- <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
-</map>
<map id="step4_image_map" name="step4_image_map">
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
@@ -452,14 +447,6 @@
<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
</map>
-<map id="step4_image_map_all" name="step4_image_map_all">
- <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
-</map>
-
<map id="step5_image_map" name="step5_image_map">
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
@@ -467,14 +454,6 @@
<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
</map>
-<map id="step5_image_map_all" name="step5_image_map_all">
- <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
-</map>
-
<map id="step6_image_map" name="step6_image_map">
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
@@ -483,14 +462,6 @@
<area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
</map>
-<map id="step6_image_map_all" name="step6_image_map_all">
- <area href="#" step="#first_step" shape="circle" coords="30,12,12" ><!--1-->
- <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
-</map>
-
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'></script>
@@ -505,8 +476,6 @@
<script type="text/javascript">
$j(document).ready(function() {
- var current_step='#first_step';
- var step_six_reached=false;
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
1
0
Author: mgallegos
Date: 2012-11-01 18:09:33 +0100 (Thu, 01 Nov 2012)
New Revision: 566
Modified:
trunk/src/mc-dia-form2.js
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-01 16:44:04 UTC (rev 565)
+++ trunk/src/mc-dia-form2.js 2012-11-01 17:09:33 UTC (rev 566)
@@ -98,6 +98,35 @@
}
}
+function onClickImageMap(e){
+ $j(current_step).slideUp();
+ $j(e.key).slideDown();
+ if (e.key=='#first_step'){
+ $j('#progress_text').html('0% Complete');
+ $j('#progress').css('width','0');
+ }
+ else if (e.key=='#second_step'){
+ $j('#progress_text').html('20% Complete');
+ $j('#progress').css('width','68px');
+ }
+ else if (e.key=='#third_step'){
+ $j('#progress_text').html('40% Complete');
+ $j('#progress').css('width','136px');
+ }
+ else if (e.key=='#fourth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ }
+ else if (e.key=='#fifth_step'){
+ $j('#progress_text').html('60% Complete');
+ $j('#progress').css('width','204px');
+ }
+ else if (e.key=='#sixth_step'){
+ $j('#progress_text').html('100% Complete');
+ $j('#progress').css('width','339px');
+ }
+}
+
function select_cat($id, $id2) {
var cat_id = "#mc-form-" + $id;
$j(cat_id + ",#mc-form-icon-" + $id).click(
@@ -498,34 +527,7 @@
}
});
-/*
-$j("#button-close-a").click(function(){
- $j("#mc-form-np").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-np").slideUp();
- $('#mc-form-optional-non-profit').hide();
-});
-$j("#button-close-b").click(function(){
- $j("#mc-form-rp").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-rp").slideUp();
- $('#mc-form-optional-reproducible').hide();
-});
-
-$j("#button-close-c").click(function(){
- $j("#mc-form-rc").removeClass("mc-form-descbox-selected");
- //$j("#mc-cat-selected-rc").slideUp();
- reset_areas();
- $('#mc-form-optional-reinforcing').hide();
-});
-
-$j("#button-close-d").click(function(){
- $j("#mc-form-gr").removeClass("mc-form-descbox-selected");
- $j("#mc-cat-selected-gr").slideUp();
- $('#mc-form-optional-grassroots').hide();
-});
-*/
-
-
$j(function(){
//original field values
var field_values = {
@@ -840,6 +842,29 @@
current_step='#fifth_step';
+ if(!step_six_reached){
+ $j('img[usemap*="step1_image_map"]').attr('usemap','step1_image_map_all');
+ $j('img[usemap*="step2_image_map"]').attr('usemap','step2_image_map_all');
+ $j('img[usemap*="step3_image_map"]').attr('usemap','step3_image_map_all');
+ $j('img[usemap*="step4_image_map"]').attr('usemap','step4_image_map_all');
+ $j('img[usemap*="step5_image_map"]').attr('usemap','step5_image_map_all');
+ $j('img[usemap*="step6_image_map"]').attr('usemap','step6_image_map_all');
+
+ $j(".map").mapster('unbind');
+
+ $j( ".map").mapster({
+ fillColor: 'EA8F5F',
+ fillOpacity: 0.8,
+ isSelectable: false,
+ mapKey: 'step',
+ onClick: function (e) {
+ onClickImageMap(e);
+ }
+ });
+
+ step_six_reached = true;
+ }
+
//update progress bar
$j('#progress_text').html('80% Complete');
$j('#progress').css('width','272px');
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 16:44:04 UTC (rev 565)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 17:09:33 UTC (rev 566)
@@ -413,7 +413,7 @@
<div class="mc-dia-continue-btn" id="mc-dia-continue-btn"><?php _e("Continue", "mc"); ?></div>
-->
-<map id="step1_image_map-all" name="step1_image_map-all">
+<map id="step1_image_map_all" name="step1_image_map_all">
<area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
@@ -425,7 +425,7 @@
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
</map>
-<map id="step2_image_map-all" name="step2_image_map-all">
+<map id="step2_image_map_all" name="step2_image_map_all">
<area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
<area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
<area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
@@ -506,6 +506,7 @@
<script type="text/javascript">
$j(document).ready(function() {
var current_step='#first_step';
+ var step_six_reached=false;
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
@@ -528,23 +529,9 @@
isSelectable: false,
mapKey: 'step',
onClick: function (e) {
- //$j(current_step).slideUp();
- //$j(e.key).slideDown();
- if (e.key=='#first_step')
- alert(e.key + ' ' + current_step);
- else if (e.key=='#second_step')
- alert(e.key + ' ' + current_step);
- else if (e.key=='#third_step')
- alert(e.key + ' ' + current_step);
- else if (e.key=='#fourth_step')
- alert(e.key + ' ' + current_step);
- else if (e.key=='#fifth_step')
- alert(e.key + ' ' + current_step);
- else if (e.key=='#sixth_step')
- alert(e.key + ' ' + current_step);
+ onClickImageMap(e);
}
});
-
});
1
0
Author: mgallegos
Date: 2012-11-01 17:44:04 +0100 (Thu, 01 Nov 2012)
New Revision: 565
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 16:42:07 UTC (rev 564)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 16:44:04 UTC (rev 565)
@@ -531,17 +531,17 @@
//$j(current_step).slideUp();
//$j(e.key).slideDown();
if (e.key=='#first_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
else if (e.key=='#second_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
else if (e.key=='#third_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
else if (e.key=='#fourth_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
else if (e.key=='#fifth_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
else if (e.key=='#sixth_step')
- alert(e.key + ' ' + current-step);
+ alert(e.key + ' ' + current_step);
}
});
1
0
Author: mgallegos
Date: 2012-11-01 17:42:07 +0100 (Thu, 01 Nov 2012)
New Revision: 564
Modified:
trunk/src/mc-dia-form2.js
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-01 16:37:13 UTC (rev 563)
+++ trunk/src/mc-dia-form2.js 2012-11-01 16:42:07 UTC (rev 564)
@@ -582,7 +582,7 @@
if(!error) {
- current-step='#second_step';
+ current_step='#second_step';
//update progress bar
$j('#progress_text').html('20% Complete');
@@ -601,7 +601,7 @@
$j('#p_submit_second').click(function(){
- current-step='#first_step';
+ current_step='#first_step';
//update progress bar
$j('#progress').css('width','0');
@@ -652,7 +652,7 @@
if(error)
return;
- current-step='#third_step';
+ current_step='#third_step';
//update progress bar
$j('#progress_text').html('40% Complete');
@@ -671,7 +671,7 @@
$j('#p_submit_third').click(function(){
- current-step='#second_step';
+ current_step='#second_step';
//update progress bar
$j('#progress_text').html('20% Complete');
@@ -727,7 +727,7 @@
if(error)
return;
- current-step='#fourth_step';
+ current_step='#fourth_step';
//update progress bar
$j('#progress_text').html('60% Complete');
@@ -745,7 +745,7 @@
$j('#p_submit_fourth').click(function(){
- current-step='#third_step';
+ current_step='#third_step';
//update progress bar
$j('#progress_text').html('40% Complete');
@@ -774,7 +774,7 @@
return;
}
- current-step='#fifth_step';
+ current_step='#fifth_step';
//update progress bar
$j('#progress_text').html('80% Complete');
@@ -793,7 +793,7 @@
$j('#p_submit_fifth').click(function(){
- current-step='#fourth_step';
+ current_step='#fourth_step';
//update progress bar
$j('#progress_text').html('60% Complete');
@@ -811,7 +811,7 @@
$j('#submit_fifth').click(function(){
- current-step='#sixth_step';
+ current_step='#sixth_step';
if($j('#gr-checkbox').val()=='A'){
$j('#step5question').effect("shake", { times:3 }, 50);
@@ -838,7 +838,7 @@
$j('#p_submit_sixth').click(function(){
- current-step='#fifth_step';
+ current_step='#fifth_step';
//update progress bar
$j('#progress_text').html('80% Complete');
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 16:37:13 UTC (rev 563)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 16:42:07 UTC (rev 564)
@@ -505,7 +505,7 @@
<script type="text/javascript">
$j(document).ready(function() {
- var current-step='#first_step';
+ var current_step='#first_step';
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
@@ -528,7 +528,7 @@
isSelectable: false,
mapKey: 'step',
onClick: function (e) {
- //$j(current-step).slideUp();
+ //$j(current_step).slideUp();
//$j(e.key).slideDown();
if (e.key=='#first_step')
alert(e.key + ' ' + current-step);
@@ -542,7 +542,7 @@
alert(e.key + ' ' + current-step);
else if (e.key=='#sixth_step')
alert(e.key + ' ' + current-step);
- },
+ }
});
1
0
Author: mgallegos
Date: 2012-11-01 17:37:13 +0100 (Thu, 01 Nov 2012)
New Revision: 563
Modified:
trunk/src/mc-dia-form2.js
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js 2012-11-01 16:14:43 UTC (rev 562)
+++ trunk/src/mc-dia-form2.js 2012-11-01 16:37:13 UTC (rev 563)
@@ -580,7 +580,10 @@
}
});
- if(!error) {
+ if(!error) {
+
+ current-step='#second_step';
+
//update progress bar
$j('#progress_text').html('20% Complete');
$j('#progress').css('width','68px');
@@ -596,7 +599,10 @@
} else return false;
});
- $j('#p_submit_second').click(function(){
+ $j('#p_submit_second').click(function(){
+
+ current-step='#first_step';
+
//update progress bar
$j('#progress').css('width','0');
$j('#progress_text').html('0% Complete');
@@ -645,6 +651,8 @@
if(error)
return;
+
+ current-step='#third_step';
//update progress bar
$j('#progress_text').html('40% Complete');
@@ -661,7 +669,10 @@
});
- $j('#p_submit_third').click(function(){
+ $j('#p_submit_third').click(function(){
+
+ current-step='#second_step';
+
//update progress bar
$j('#progress_text').html('20% Complete');
$j('#progress').css('width','68px');
@@ -716,6 +727,8 @@
if(error)
return;
+ current-step='#fourth_step';
+
//update progress bar
$j('#progress_text').html('60% Complete');
$j('#progress').css('width','204px');
@@ -730,7 +743,10 @@
$j('#fourth_step').slideDown();
});
- $j('#p_submit_fourth').click(function(){
+ $j('#p_submit_fourth').click(function(){
+
+ current-step='#third_step';
+
//update progress bar
$j('#progress_text').html('40% Complete');
$j('#progress').css('width','136px');
@@ -757,6 +773,8 @@
$j('#mc-form-optional-reinforcing').effect("shake", { times:3 }, 50);
return;
}
+
+ current-step='#fifth_step';
//update progress bar
$j('#progress_text').html('80% Complete');
@@ -773,7 +791,10 @@
});
- $j('#p_submit_fifth').click(function(){
+ $j('#p_submit_fifth').click(function(){
+
+ current-step='#fourth_step';
+
//update progress bar
$j('#progress_text').html('60% Complete');
$j('#progress').css('width','204px');
@@ -790,16 +811,20 @@
$j('#submit_fifth').click(function(){
+ current-step='#sixth_step';
+
if($j('#gr-checkbox').val()=='A'){
$j('#step5question').effect("shake", { times:3 }, 50);
return;
}
+ $j('#progress_text').html('100% Complete');
+ $j('#progress').css('width','339px');
+
$j('#fifth_step').slideUp();
$j('#sixth_step').slideDown();
- $j('#progress_text').html('100% Complete');
- $j('#progress').css('width','339px');
+
/* //update progress bar
$j('#progress_text').html('50% Complete');
@@ -811,7 +836,10 @@
*/
});
- $j('#p_submit_sixth').click(function(){
+ $j('#p_submit_sixth').click(function(){
+
+ current-step='#fifth_step';
+
//update progress bar
$j('#progress_text').html('80% Complete');
$j('#progress').css('width','272px');
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 16:14:43 UTC (rev 562)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 16:37:13 UTC (rev 563)
@@ -414,81 +414,81 @@
-->
<map id="step1_image_map-all" name="step1_image_map-all">
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
+ <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="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
</map>
<map id="step2_image_map-all" name="step2_image_map-all">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
+ <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="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
</map>
<map id="step3_image_map_all" name="step3_image_map_all">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step4_image_map" name="step4_image_map">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <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-->
</map>
<map id="step4_image_map_all" name="step4_image_map_all">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
- <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step5_image_map" name="step5_image_map">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <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-->
</map>
<map id="step5_image_map_all" name="step5_image_map_all">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="#sixth_step" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step6_image_map" name="step6_image_map">
- <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
</map>
<map id="step6_image_map_all" name="step6_image_map_all">
- <area href="#" step="1" shape="circle" coords="30,12,12" ><!--1-->
- <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
- <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
- <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
- <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="#first_step" shape="circle" coords="30,12,12" ><!--1-->
+ <area href="#" step="#second_step" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="#third_step" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="#fourth_step" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="#fifth_step" shape="circle" coords="398,12,12"><!--5-->
</map>
@@ -505,6 +505,7 @@
<script type="text/javascript">
$j(document).ready(function() {
+ var current-step='#first_step';
$j('#languages').tagsInput({defaultText:'Add a language'});
$j('#keywords').tagsInput({defaultText:'Add a keyword'});
$j('#infield-donation-website').inFieldLabels();
@@ -512,7 +513,6 @@
$j('#infield-open-accounting-website').inFieldLabels();
$j('#infield-creative-commons-website').inFieldLabels();
$j('#infield-other-license-website').inFieldLabels();
- //$j('#infield-url').inFieldLabels();
$j('#infield-terms-of-use-website').inFieldLabels();
$j('.buttonp').button({ icons: {primary:'ui-icon-arrowthick-1-w'} });
$j('.buttonn').button({ icons: {secondary:'ui-icon-arrowthick-1-e'} });
@@ -528,20 +528,24 @@
isSelectable: false,
mapKey: 'step',
onClick: function (e) {
- if (e.key=='1')
- alert('1');
- else if (e.key=='2')
- alert('2');
- else if (e.key=='3')
- alert('3');
- else if (e.key=='4')
- alert('4');
- else if (e.key=='5')
- alert('5');
- else if (e.key=='6')
- alert('6');
+ //$j(current-step).slideUp();
+ //$j(e.key).slideDown();
+ if (e.key=='#first_step')
+ alert(e.key + ' ' + current-step);
+ else if (e.key=='#second_step')
+ alert(e.key + ' ' + current-step);
+ else if (e.key=='#third_step')
+ alert(e.key + ' ' + current-step);
+ else if (e.key=='#fourth_step')
+ alert(e.key + ' ' + current-step);
+ else if (e.key=='#fifth_step')
+ alert(e.key + ' ' + current-step);
+ else if (e.key=='#sixth_step')
+ alert(e.key + ' ' + current-step);
},
});
+
+
});
</script>
\ No newline at end of file
1
0
Author: mgallegos
Date: 2012-11-01 17:14:43 +0100 (Thu, 01 Nov 2012)
New Revision: 562
Modified:
trunk/wp-theme/mc2-form.php
Log:
Modified: trunk/wp-theme/mc2-form.php
===================================================================
--- trunk/wp-theme/mc2-form.php 2012-11-01 16:09:52 UTC (rev 561)
+++ trunk/wp-theme/mc2-form.php 2012-11-01 16:14:43 UTC (rev 562)
@@ -414,11 +414,11 @@
-->
<map id="step1_image_map-all" name="step1_image_map-all">
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
- <area step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step2_image_map" name="step2_image_map">
@@ -426,11 +426,11 @@
</map>
<map id="step2_image_map-all" name="step2_image_map-all">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
- <area step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step3_image_map" name="step3_image_map">
@@ -439,56 +439,56 @@
</map>
<map id="step3_image_map_all" name="step3_image_map_all">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
- <area step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step4_image_map" name="step4_image_map">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
</map>
<map id="step4_image_map_all" name="step4_image_map_all">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
- <area step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step5_image_map" name="step5_image_map">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
</map>
<map id="step5_image_map_all" name="step5_image_map_all">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="6" shape="circle" coords="490,12,12"><!--6-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="6" shape="circle" coords="490,12,12"><!--6-->
</map>
<map id="step6_image_map" name="step6_image_map">
- <area step="1" shape="circle" coords="30,12,12"><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="1" shape="circle" coords="30,12,12"><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
</map>
<map id="step6_image_map_all" name="step6_image_map_all">
- <area step="1" shape="circle" coords="30,12,12" ><!--1-->
- <area step="2" shape="circle" coords="122,12,12"><!--2-->
- <area step="3" shape="circle" coords="214,12,12"><!--3-->
- <area step="4" shape="circle" coords="306,12,12"><!--4-->
- <area step="5" shape="circle" coords="398,12,12"><!--5-->
+ <area href="#" step="1" shape="circle" coords="30,12,12" ><!--1-->
+ <area href="#" step="2" shape="circle" coords="122,12,12"><!--2-->
+ <area href="#" step="3" shape="circle" coords="214,12,12"><!--3-->
+ <area href="#" step="4" shape="circle" coords="306,12,12"><!--4-->
+ <area href="#" step="5" shape="circle" coords="398,12,12"><!--5-->
</map>
1
0