[Movecommons-commits] r409 - trunk/src

Mario Gallegos mgallegos at ourproject.org
Sun May 20 03:30:12 CEST 2012


Author: mgallegos
Date: 2012-05-20 03:30:12 +0200 (Sun, 20 May 2012)
New Revision: 409

Modified:
   trunk/src/mc-dia-form2.js
Log:


Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js	2012-05-20 01:25:54 UTC (rev 408)
+++ trunk/src/mc-dia-form2.js	2012-05-20 01:30:12 UTC (rev 409)
@@ -1,251 +1,251 @@
-var $j = jQuery.noConflict();
+var $jj = jQuery.noConflict();
 
 // categories selection
 
 function clickCheckBox(id){
-	if($j('#'+id+'-checkbox').val()=='N'){
-		$('#'+id+'-checkbox').val('S');
-		$j("#mc-form-" + id).addClass("mc-form-descbox-selected");
-		$j("#mc-cat-selected-"+ id).slideDown();		
+	if($jj('#'+id+'-checkbox').val()=='N'){
+		$j('#'+id+'-checkbox').val('S');
+		$jj("#mc-form-" + id).addClass("mc-form-descbox-selected");
+		$jj("#mc-cat-selected-"+ id).slideDown();		
 		if(id=='np'){
-			$("#registered-non-profit").removeAttr("disabled");
-			$("#open-accounting").removeAttr("disabled");
-			$("#accept-donations").removeAttr("disabled");			
+			$j("#registered-non-profit").removeAttr("disabled");
+			$j("#open-accounting").removeAttr("disabled");
+			$j("#accept-donations").removeAttr("disabled");			
 		}
 		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("#terms-of-use").removeAttr("disabled");
+			$j("#creative-commons").removeAttr("disabled");
+			$j("#other-license").removeAttr("disabled");						
+			$j("#organization-structure").removeAttr("disabled");
+			$j("#projects-and-results").removeAttr("disabled");
+			$j("#methods-procedures").removeAttr("disabled");
+			$j("#documentation").removeAttr("disabled");
 		}
 		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("#decisions-general-assemblies").removeAttr("disabled");
+			$j("#decisions-consensus").removeAttr("disabled");
+			$j("#representatives-democratically").removeAttr("disabled");						
+			$j("#meetings-transparent").removeAttr("disabled");
+			$j("#decisions-voting").removeAttr("disabled");			
 		}
 	} 		 
 	else{
-		$('#'+id+'-checkbox').val('N');
-		$j("#mc-form-" + id).removeClass("mc-form-descbox-selected");
-		$j("#mc-cat-selected-"+ id).slideUp();
+		$j('#'+id+'-checkbox').val('N');
+		$jj("#mc-form-" + id).removeClass("mc-form-descbox-selected");
+		$jj("#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("#registered-non-profit").attr("disabled", "disabled");
+			$j('#registered-non-profit').attr('checked', false);
+			$j("#open-accounting").attr("disabled", "disabled");
+			$j('#open-accounting').attr('checked', false);
+			$j("#accept-donations").attr("disabled", "disabled");
+			$j('#accept-donations').attr('checked', false);			
+			$jj('#non-profit-website').hide();
+			$jj('#infield-non-profit-website').hide();
+			$jj('#open-accounting-website').hide();
+			$jj('#infield-open-accounting-website').hide();
+			$jj('#donation-website').hide();
+			$jj('#infield-donation-website').hide();
 		}
 		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("#terms-of-use").attr("disabled", "disabled");
+			$j('#terms-of-use').attr('checked', false);
+			$j("#creative-commons").attr("disabled", "disabled");
+			$j('#creative-commons').attr('checked', false);
+			$j("#other-license").attr("disabled", "disabled");
+			$j('#other-license').attr('checked', false);			
+			$j("#organization-structure").attr("disabled", "disabled");
+			$j('#organization-structure').attr('checked', false);
+			$j("#projects-and-results").attr("disabled", "disabled");
+			$j('#projects-and-results').attr('checked', false);
+			$j("#methods-procedures").attr("disabled", "disabled");
+			$j('#methods-procedures').attr('checked', false);
+			$j("#documentation").attr("disabled", "disabled");
+			$j('#documentation').attr('checked', false);
+			$jj('#terms-of-use-website').hide();
+			$jj('#infield-terms-of-use-website').hide();
+			$jj('#creative-commons-website').hide();
+			$jj('#infield-creative-commons-website').hide();
+			$jj('#other-license-website').hide();
+			$jj('#infield-other-license-website').hide();
 		}
 		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("#decisions-general-assemblies").attr("disabled", "disabled");
+			$j('#decisions-general-assemblies').attr('checked', false);
+			$j("#decisions-consensus").attr("disabled", "disabled");
+			$j('#decisions-consensus').attr('checked', false);
+			$j("#representatives-democratically").attr("disabled", "disabled");
+			$j('#representatives-democratically').attr('checked', false);			
+			$j("#meetings-transparent").attr("disabled", "disabled");
+			$j('#meetings-transparent').attr('checked', false);
+			$j("#decisions-voting").attr("disabled", "disabled");
+			$j('#decisions-voting').attr('checked', false);
 		}
 		if(id=='rc')
 			reset_areas();
 	}
 }
 
-function select_cat($id, $id2) {
-  var cat_id = "#mc-form-" + $id;
-  $j(cat_id + ",#mc-form-icon-" + $id).click(
+function select_cat($jid, $jid2) {
+  var cat_id = "#mc-form-" + $jid;
+  $jj(cat_id + ",#mc-form-icon-" + $jid).click(
     function ()
     {/*
-    //  if ($id != "rc") {
-	$j(cat_id).addClass("mc-form-descbox-selected");
-	$j("#mc-cat-selected-"+ $id).slideDown();
+    //  if ($jid != "rc") {
+	$jj(cat_id).addClass("mc-form-descbox-selected");
+	$jj("#mc-cat-selected-"+ $jid).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();});*/
+      $jj("#mc-form-" + $jid2).removeClass("mc-form-descbox-selected");
+      $jj("#mc-cat-selected-"+ $jid2).slideUp();
+      // $jj("#mc-form-more-link-" + $jid2).show('slow');
+      $jj("#mc-form-less-link-" + $jid2).hide();
+      //      $jj("#mc-form-" + $jid).removeAttr("title");
+      //      $jj("#mc-form-" + $jid2).attr("title", click_to_select);
+      $jj("#mc-form-more-text-" + $jid2).slideUp(function() {adjustHeights();});*/
       if (cat_id == "#mc-form-rc") {
-    	  //$j("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
+    	  //$jj("#mc-cat-rc-options").slideDown(function() {adjustHeights();});
     	  mc_rc="0";
-    	  update_logo($id);
-    	  //$j('div.blockMe3').unblock();
-    	  //$('#mc-form-optional-reinforcing').show();
+    	  update_logo($jid);
+    	  //$jj('div.blockMe3').unblock();
+    	  //$j('#mc-form-optional-reinforcing').show();
       } else if (cat_id == "#mc-form-nrc") {
-    	  //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+    	  //$jj("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
     	  reset_areas();
-    	  update_logo($id);
+    	  update_logo($jid);
       } else if (cat_id == "#mc-form-np") {
-    	  //$j('div.blockMe1').unblock();
-    	  //$('#mc-form-optional-non-profit').show();
+    	  //$jj('div.blockMe1').unblock();
+    	  //$j('#mc-form-optional-non-profit').show();
       } else if (cat_id == "#mc-form-rp") {
-    	  //$j('div.blockMe2').unblock();    	  
-    	  //$('#mc-form-optional-reproducible').show();
+    	  //$jj('div.blockMe2').unblock();    	  
+    	  //$j('#mc-form-optional-reproducible').show();
       } else if (cat_id == "#mc-form-gr") {
-    	  //$j('div.blockMe4').unblock();	  
-    	  //$('#mc-form-optional-grassroots').show();
+    	  //$jj('div.blockMe4').unblock();	  
+    	  //$j('#mc-form-optional-grassroots').show();
       } else {
-    	  update_logo($id);
-    	  //$j("#mc-cat-rc-options").slideUp(function() {adjustHeights();});
+    	  update_logo($jid);
+    	  //$jj("#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 hover_cat($jid) {
+  var cat_id = "#mc-form-" + $jid;
+  $jj(cat_id + ",#mc-form-icon-" + $jid).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();
+      $jj(cat_id).addClass("mc-form-descbox-high");
+      //if ($jj('#mc-form-less-link-'+$jid).is(':hidden'))
+    	//  $jj("#mc-form-more-link-"+$jid).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();
+      $jj(cat_id).removeClass("mc-form-descbox-high");
+      //if ($jj('#mc-form-less-link-'+$jid).is(':hidden'))
+    	 // $jj("#mc-form-more-link-"+$jid).hide();
     });
 };
 
 // More links
 
-function click_more_link($id) {
-  $j("#mc-form-more-link-" + $id).click(
+function click_more_link($jid) {
+  $jj("#mc-form-more-link-" + $jid).click(
     function (event) {
       event.stopPropagation();
-      $j(this).hide();
-      /*if ($id == "rc") {
-    	  $j("#mc-cat-rc-options").slideDown();
+      $jj(this).hide();
+      /*if ($jid == "rc") {
+    	  $jj("#mc-cat-rc-options").slideDown();
       }*/
-      $j("#mc-form-less-link-" + $id).show('slow');
-      $j("#mc-form-more-text-" + $id).show('slow',function() {adjustHeights();});
+      $jj("#mc-form-less-link-" + $jid).show('slow');
+      $jj("#mc-form-more-text-" + $jid).show('slow',function() {adjustHeights();});
 
     });
 };
 
-function click_less_link($id) {
-  $j("#mc-form-less-link-" + $id).click(
+function click_less_link($jid) {
+  $jj("#mc-form-less-link-" + $jid).click(
     function (event) {
       event.stopPropagation();
-      $j(this).hide();
-      /*if ($id == "rc") {
-    	  $j("#mc-cat-rc-options").slideUp();
+      $jj(this).hide();
+      /*if ($jid == "rc") {
+    	  $jj("#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();});}
+      $jj("#mc-form-more-link-" + $jid).show('slow');
+      $jj("#mc-form-more-text-" + $jid).slideUp(function() {adjustHeights();});
+      //if ($jid == "rc") { $jj("#mc-cat-rc-options").slideUp(function() {adjustHeights();});}
     });
 };
 
-function hover_more_link($id) {
-  $j("#mc-form-more-link-" + $id).hover(
+function hover_more_link($jid) {
+  $jj("#mc-form-more-link-" + $jid).hover(
     function () {
-      $j(this).addClass("mc-form-link-high");
+      $jj(this).addClass("mc-form-link-high");
     }, function () {
-      $j(this).removeClass("mc-form-link-high");
+      $jj(this).removeClass("mc-form-link-high");
     });
 };
 
-function hover_less_link($id) {
-  $j("#mc-form-less-link-" + $id).hover(
+function hover_less_link($jid) {
+  $jj("#mc-form-less-link-" + $jid).hover(
     function () {
-      $j(this).addClass("mc-form-link-high");
+      $jj(this).addClass("mc-form-link-high");
     }, function () {
-      $j(this).removeClass("mc-form-link-high");
+      $jj(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 hide_initial($jid) {
+  $jj("#mc-form-more-link-" + $jid).hide();
+  //$jj("#mc-form-more-text-" + $jid).hide();
+  $jj("#mc-form-less-link-" + $jid).hide();
 };
 
-function dclick_toggle($id) {
-  $j("#mc-form-" + $id).dblclick(
+function dclick_toggle($jid) {
+  $jj("#mc-form-" + $jid).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(); };
+      var id_text = "#mc-form-more-text-" + $jid;
+      var id_link = "#mc-form-more-link-" + $jid;
+      if ($jj(id_text).is(':visible')) { $jj(id_text).slideUp(); $jj(id_link).slideDown(); }
+      else { $jj(id_text).slideDown(); $jj(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();
+  $jj("#mc-cat-rc-option-box-ec").removeClass("mc-cat-rc-option-box-selected");
+  $jj("#mc-cat-rc-option-box-bo").removeClass("mc-cat-rc-option-box-selected");
+  $jj("#mc-cat-rc-option-box-to").removeClass("mc-cat-rc-option-box-selected");
+  $jj("#mc-cat-rc-option-box-di").removeClass("mc-cat-rc-option-box-selected");
+  $jj("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc60.png"});
+  $jj("#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 select_area($jid) {
+  var cat_id = "#mc-cat-rc-option-box-" + $jid;
+  $jj(cat_id + ",#mc-cat-rc-option-icon-" + $jid).click(
     function (event) {
-      if($j('#rc-checkbox').val()=='N')
+      if($jj('#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);
+      $jj("#mc-form-rc").addClass("mc-form-descbox-selected");
+      $jj("#mc-cat-selected-rc").slideDown();
+      $jj(cat_id).addClass("mc-cat-rc-option-box-selected");
+      $jj("#mc-form-icon-rc").attr({src : "/mc/0.1/images/rc" + $jid + "60.png"});
+      update_logo($jid);
     });
 };
 
 // Inspired in:
 // http://stackoverflow.com/questions/803688/how-do-i-keep-multiple-divs-the-same-height-using-jquery
 
-function adjustPairHeights($id1, $id2) {
+function adjustPairHeights($jid1, $jid2) {
   var maxHeight = 0;
-  var idcat1 = "#mc-form-category-group-" + $id1;
-  var idcat2 = "#mc-form-category-group-" + $id2;
+  var idcat1 = "#mc-form-category-group-" + $jid1;
+  var idcat2 = "#mc-form-category-group-" + $jid2;
   var ids = idcat1 + "," + idcat2;
-  $j(ids).each(function(){
-		 $j(this).height('auto');
-		 if (maxHeight < $j(this).height()) {maxHeight = $j(this).height();}
+  $jj(ids).each(function(){
+		 $jj(this).height('auto');
+		 if (maxHeight < $jj(this).height()) {maxHeight = $jj(this).height();}
                });
-  if($j(idcat1).height() < maxHeight) { $j(idcat1).height(maxHeight); };
-  if($j(idcat2).height() < maxHeight) { $j(idcat2).height(maxHeight); };
+  if($jj(idcat1).height() < maxHeight) { $jj(idcat1).height(maxHeight); };
+  if($jj(idcat2).height() < maxHeight) { $jj(idcat2).height(maxHeight); };
 }
 
 function adjustHeights() {
@@ -253,16 +253,16 @@
   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-";
+function update_logo($jcat) {
+  if ($jcat == "np" ) mc_np="np-";
+  if ($jcat == "nnp") mc_np="fp-";
+  if ($jcat == "rp" ) mc_rp="rp-";
+  if ($jcat == "nrp") mc_rp="ex-";
+  if ($jcat == "gr" ) mc_gr="gr-";
+  if ($jcat == "ngr") mc_gr="rs-";
+  if ($jcat == "ec" || $jcat == "bo" ||
+      $jcat == "to" || $jcat == "di") mc_rc="rc." + $jcat + "-";
+  if ($jcat == "nrc") mc_rc="ro-";
 
   mc_category = "";
   var icon_url = "";
@@ -273,34 +273,34 @@
     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(/-$/, "");
+    mc_category = mc_category.replace(/-$j/, "");
     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');
+    $jj("#mc-form-icon-result").attr({src : icon_url});
+    $jj("#mc-form-icon-result").show('fast');
   } else {
-    $j("#mc-form-icon-result").hide();
+    $jj("#mc-form-icon-result").hide();
   }
   checkIfFormReady();
 }
 
 function checkIfFormReady()  {
-  urlIni = $j('#url').val();
-  nameIni = $j('#ininame').val();
-  keywordsIni = $j('#keywords').val();
+  urlIni = $jj('#url').val();
+  nameIni = $jj('#ininame').val();
+  keywordsIni = $jj('#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);
+    $jj("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-enabled");
+    $jj("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-disabled");
+    $jj("#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");
+    $jj("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
+    $jj("#mc-dia-continue-btn").removeClass("mc-dia-continue-btn-enabled");
   }
 }
 
-function confInputValidation($id) {
-  $j($id).bind("change keyup", function(event) {
+function confInputValidation($jid) {
+  $jj($jid).bind("change keyup", function(event) {
     checkIfFormReady();
   });
 }
@@ -315,28 +315,28 @@
     }
 }
 
-function conf_link($id) {
-  var nid = "n" + $id;
-  //hover_more_link($id);
+function conf_link($jid) {
+  var nid = "n" + $jid;
+  //hover_more_link($jid);
   //hover_more_link(nid);
   //hover_less_link(nid);
   //hover_less_link(nid);
-  //hide_initial($id);
+  //hide_initial($jid);
   //hide_initial(nid);
-  //click_more_link($id);
+  //click_more_link($jid);
   //click_more_link(nid);
-  //click_less_link($id);
+  //click_less_link($jid);
   //click_less_link(nid);
-  select_cat($id, nid);
-  select_cat(nid, $id);
-  //hover_cat($id);
+  select_cat($jid, nid);
+  select_cat(nid, $jid);
+  //hover_cat($jid);
   //hover_cat(nid);
-  // dclick_toggle($id);
+  // dclick_toggle($jid);
   // dclick_toggle(nid);
 };
 
 function conf_click_continue() {
-  $j("#mc-dia-continue-btn").click(
+  $jj("#mc-dia-continue-btn").click(
     function (event) {
       event.stopPropagation();
       if (mc_category != "" && urlIni.length > 0 && nameIni.length > 0) {
@@ -353,23 +353,23 @@
 
 // http://www.richreuter.com/2008/08/01/UsingJQueryToResizeTextBoxesToMaxLength.aspx
 function max_textsize() {
-  $j('input[type=text]').each(function() {
-    var max_length = $j(this).attr('maxlength');
+  $jj('input[type=text]').each(function() {
+    var max_length = $jj(this).attr('maxlength');
     var multiplier = (max_length > 10) ? 7.3 : 8;
     var w = (max_length * multiplier) + "px";
-    $j(this).width(w);
+    $jj(this).width(w);
 });
 
 }
 
 // http://remysharp.com/2007/03/19/a-few-more-jquery-plugins-crop-labelover-and-pluck/#labelOver
-$.fn.labelOver = function(overClass) {
+$j.fn.labelOver = function(overClass) {
   return this.each(function()
     {
-      var label = $j(this);
+      var label = $jj(this);
       var f = label.attr('for');
       if (f) {
-	var input = $j('#' + f);
+	var input = $jj('#' + f);
 
 	this.hide = function() {
 	  label.css({ textIndent: -10000 });
@@ -397,7 +397,7 @@
 var nameIni = "";
 var urlIni = "";
 var keywordsIni = "";
-// var click_to_select = $j("#mc-form-gr").attr("title"); // store of title value
+// var click_to_select = $jj("#mc-form-gr").attr("title"); // store of title value
 
 /*conf_link("np");
 conf_link("rp");
@@ -410,240 +410,240 @@
 //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();
+$jj("#mc-dia-continue-btn").addClass("mc-dia-continue-btn-disabled");
+//$jj("#mc-cat-rc-options").hide(function() {adjustHeights();});
+$jj("#mc-form-icon-result").hide();
 conf_click_continue();
-//$j('#label1').labelOver('over-apply');
+//$jj('#label1').labelOver('over-apply');
 // max_textsize();
-$j(window).load(function () { doadjustwithsleep(0); });
+$jj(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();
+$jj("#registered-non-profit").click(function(){		
+  if($jj("#registered-non-profit").attr("checked")){
+    $jj('#non-profit-website').show();
+    $jj('#infield-non-profit-website').show();
   }  	
   else{
-    $j('#non-profit-website').hide();
-    $j('#infield-non-profit-website').hide();
+    $jj('#non-profit-website').hide();
+    $jj('#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();
+$jj("#open-accounting").click(function(){		
+  if($jj("#open-accounting").attr("checked")){
+    $jj('#open-accounting-website').show();
+    $jj('#infield-open-accounting-website').show();
   }  	
   else{
-    $j('#open-accounting-website').hide();
-    $j('#infield-open-accounting-website').hide();
+    $jj('#open-accounting-website').hide();
+    $jj('#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();
+$jj("#accept-donations").click(function(){		
+  if($jj("#accept-donations").attr("checked")){
+    $jj('#donation-website').show();
+    $jj('#infield-donation-website').show();
   }  	
   else{
-    $j('#donation-website').hide();
-    $j('#infield-donation-website').hide();
+    $jj('#donation-website').hide();
+    $jj('#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();    
+$jj("#terms-of-use").click(function(){		
+  if($jj("#terms-of-use").attr("checked")){
+    $jj('#terms-of-use-website').show();
+    $jj('#infield-terms-of-use-website').show();    
   }  	
   else{
-    $j('#terms-of-use-website').hide();
-    $j('#infield-terms-of-use-website').hide();
+    $jj('#terms-of-use-website').hide();
+    $jj('#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();
+$jj("#creative-commons").click(function(){		
+  if($jj("#creative-commons").attr("checked")){
+    $jj('#creative-commons-website').show();
+    $jj('#infield-creative-commons-website').show();
   }  	
   else{
-    $j('#creative-commons-website').hide();
-    $j('#infield-creative-commons-website').hide();
+    $jj('#creative-commons-website').hide();
+    $jj('#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();
+$jj("#other-license").click(function(){		
+  if($jj("#other-license").attr("checked")){
+    $jj('#other-license-website').show();
+    $jj('#infield-other-license-website').show();
   }  	
   else{
-    $j('#other-license-website').hide();
-    $j('#infield-other-license-website').hide();
+    $jj('#other-license-website').hide();
+    $jj('#infield-other-license-website').hide();
   }  
 });
 
 /*
-$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();
+$jj("#button-close-a").click(function(){
+	$jj("#mc-form-np").removeClass("mc-form-descbox-selected");
+	$jj("#mc-cat-selected-np").slideUp();
+	$j('#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();
+$jj("#button-close-b").click(function(){
+	$jj("#mc-form-rp").removeClass("mc-form-descbox-selected");
+	$jj("#mc-cat-selected-rp").slideUp();
+	$j('#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();
+$jj("#button-close-c").click(function(){
+	$jj("#mc-form-rc").removeClass("mc-form-descbox-selected");
+	//$jj("#mc-cat-selected-rc").slideUp();
 	reset_areas();
-	$('#mc-form-optional-reinforcing').hide();
+	$j('#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();
+$jj("#button-close-d").click(function(){
+	$jj("#mc-form-gr").removeClass("mc-form-descbox-selected");
+	$jj("#mc-cat-selected-gr").slideUp();
+	$j('#mc-form-optional-grassroots').hide();
 });
 */
 
 
-$(function(){
+$j(function(){
     //original field values
     var field_values = {
             //id        :  value
-            'username'  : 'username',
-            'password'  : 'password',
-            'cpassword' : 'password',
-            'firstname'  : 'first name',
-            'lastname'  : 'last name',
+            'ininame'  : 'username',
+            'url'  : 'password',
+            'languages' : 'Language(s)',
+            'keywords'  : 'Keywords',
+            'location'  : 'Location',
             'email'  : 'email address'
     };
 
 
     //inputfocus
-    $('input#ininame').inputfocus({ value: field_values['Name of your initiative'] });
-    $('input#url').inputfocus({ value: field_values['Web address'] });
-    $('input#languages').inputfocus({ value: field_values['Language(s)'] }); 
-    $('input#keywords').inputfocus({ value: field_values['Keywords'] });
-    $('input#location').inputfocus({ value: field_values['Location'] });
-    //$('input#email').inputfocus({ value: field_values['email'] }); 
+    $j('input#ininame').inputfocus({ value: field_values['Name of your initiative'] });
+    $j('input#url').inputfocus({ value: field_values['Web address'] });
+    $j('input#languages').inputfocus({ value: field_values['Language(s)'] }); 
+    $j('input#keywords').inputfocus({ value: field_values['Keywords'] });
+    $j('input#location').inputfocus({ value: field_values['Location'] });
+    //$j('input#email').inputfocus({ value: field_values['email'] }); 
 
 
 
 
     //reset progress bar
-    $('#progress').css('width','0');
-    $('#progress_text').html('0% Complete');
+    $j('#progress').css('width','0');
+    $j('#progress_text').html('0% Complete');
 
     //first_step
-    $('form').submit(function(){ return false; });
-    $('#submit_first').click(function(){
+    $j('form').submit(function(){ return false; });
+    $j('#submit_first').click(function(){
         //remove classes
-        $('#first_step input').removeClass('error').removeClass('valid');
+        $j('#first_step input').removeClass('error').removeClass('valid');
 
         //ckeck if inputs aren't empty
-        var fields = $('#first_step input[type=text], #first_step input[type=password]');
+        var fields = $j('#first_step input[type=text], #first_step input[type=password]');
         var error = 0;
         fields.each(function(){
-            var value = $(this).val();
-            if( value.length<4 || value==field_values[$(this).attr('id')] ) {
-                $(this).addClass('error');
-                $(this).effect("shake", { times:3 }, 50);
+            var value = $j(this).val();
+            if( value.length<4 || value==field_values[$j(this).attr('id')] ) {
+                $j(this).addClass('error');
+                $j(this).effect("shake", { times:3 }, 50);
                 
                 error++;
             } else {
-                $(this).addClass('valid');
+                $j(this).addClass('valid');
             }
         });        
         
         if(!error) {
-            if( $('#password').val() != $('#cpassword').val() ) {
-                    $('#first_step input[type=password]').each(function(){
-                        $(this).removeClass('valid').addClass('error');
-                        $(this).effect("shake", { times:3 }, 50);
+            if( $j('#password').val() != $j('#cpassword').val() ) {
+                    $j('#first_step input[type=password]').each(function(){
+                        $j(this).removeClass('valid').addClass('error');
+                        $j(this).effect("shake", { times:3 }, 50);
                     });
                     
                     return false;
             } else {   
                 //update progress bar
-                $('#progress_text').html('33% Complete');
-                $('#progress').css('width','113px');
+                $j('#progress_text').html('33% Complete');
+                $j('#progress').css('width','113px');
                 
                 //slide steps
-                $('#first_step').slideUp();
-                $('#second_step').slideDown();     
+                $j('#first_step').slideUp();
+                $j('#second_step').slideDown();     
             }               
         } else return false;
     });
 
 
-    $('#submit_second').click(function(){
+    $j('#submit_second').click(function(){
         //remove classes
-        $('#second_step input').removeClass('error').removeClass('valid');
+        $j('#second_step input').removeClass('error').removeClass('valid');
 
-        var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;  
-        var fields = $('#second_step input[type=text]');
+        var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$j/;  
+        var fields = $j('#second_step input[type=text]');
         var error = 0;
         fields.each(function(){
-            var value = $(this).val();
-            if( value.length<1 || value==field_values[$(this).attr('id')] || ( $(this).attr('id')=='email' && !emailPattern.test(value) ) ) {
-                $(this).addClass('error');
-                $(this).effect("shake", { times:3 }, 50);
+            var value = $j(this).val();
+            if( value.length<1 || value==field_values[$j(this).attr('id')] || ( $j(this).attr('id')=='email' && !emailPattern.test(value) ) ) {
+                $j(this).addClass('error');
+                $j(this).effect("shake", { times:3 }, 50);
                 
                 error++;
             } else {
-                $(this).addClass('valid');
+                $j(this).addClass('valid');
             }
         });
 
         if(!error) {
                 //update progress bar
-                $('#progress_text').html('66% Complete');
-                $('#progress').css('width','226px');
+                $j('#progress_text').html('66% Complete');
+                $j('#progress').css('width','226px');
                 
                 //slide steps
-                $('#second_step').slideUp();
-                $('#third_step').slideDown();     
+                $j('#second_step').slideUp();
+                $j('#third_step').slideDown();     
         } else return false;
 
     });
 
 
-    $('#submit_third').click(function(){
+    $j('#submit_third').click(function(){
         //update progress bar
-        $('#progress_text').html('100% Complete');
-        $('#progress').css('width','339px');
+        $j('#progress_text').html('100% Complete');
+        $j('#progress').css('width','339px');
 
         //prepare the fourth step
         var fields = new Array(
-            $('#username').val(),
-            $('#password').val(),
-            $('#email').val(),
-            $('#firstname').val() + ' ' + $('#lastname').val(),
-            $('#age').val(),
-            $('#gender').val(),
-            $('#country').val()                       
+            $j('#username').val(),
+            $j('#password').val(),
+            $j('#email').val(),
+            $j('#firstname').val() + ' ' + $j('#lastname').val(),
+            $j('#age').val(),
+            $j('#gender').val(),
+            $j('#country').val()                       
         );
-        var tr = $('#fourth_step tr');
+        var tr = $j('#fourth_step tr');
         tr.each(function(){
-            //alert( fields[$(this).index()] )
-            $(this).children('td:nth-child(2)').html(fields[$(this).index()]);
+            //alert( fields[$j(this).index()] )
+            $j(this).children('td:nth-child(2)').html(fields[$j(this).index()]);
         });
                 
         //slide steps
-        $('#third_step').slideUp();
-        $('#fourth_step').slideDown();            
+        $j('#third_step').slideUp();
+        $j('#fourth_step').slideDown();            
     });
 
 
-    $('#submit_fourth').click(function(){
+    $j('#submit_fourth').click(function(){
         //send information to server
         alert('Data sent');
     });




More information about the Movecommons-commits mailing list