[Movecommons-commits] r630 - trunk/src

Mario Gallegos mgallegos at ourproject.org
Fri Jun 28 22:23:37 CEST 2013


Author: mgallegos
Date: 2013-06-28 22:23:37 +0200 (Fri, 28 Jun 2013)
New Revision: 630

Modified:
   trunk/src/mc-dia-form2.js
Log:
FEEDBACK - Enhancement #460: Generate icons and semantic code

Modified: trunk/src/mc-dia-form2.js
===================================================================
--- trunk/src/mc-dia-form2.js	2013-06-28 18:01:51 UTC (rev 629)
+++ trunk/src/mc-dia-form2.js	2013-06-28 20:23:37 UTC (rev 630)
@@ -578,8 +578,94 @@
 		$j('#fifth_step').slideUp();
 	    $j('#sixth_step').slideDown();
 	}
+	
+	function generate_sematic_code(){
 		
+		var code='<div id="move-commons-badge"><div xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:mc="http://movecommons.org/ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" about="http://comunes.org" typeof="mc:Collective"></div>';
+		var pText='Move Commons',comma='';
+		code+='<div property="foaf:name" content="'+$j("#ininame").val()+'"></div>';//name
+		code+='<div rel="foaf:homepage" href="'+$j("#url").val()+'"></div>';//web address
+		code+=commasToLanguages($j("#languages").val());
+		code+='<div rel="mc:locationActivity" resource="'+$j("#location").val()+'"></div>';
+		
+		nonProfitcode=''; 
+		if($j('#np-checkbox').val()=='S'){
+			pText+=comma+' Non-Profit';
+			comma=',';
+			code+='<div rel="mc:moveCommonsType" resource="[mc:NonProfit]"></div>';
+			if($j("#registered-non-profit").attr("checked"))
+				nonProfitCode='<div rel="mc:officiallyRegisteredPage" href="'+$j("#non-profit-website").val()+'"></div>';
+			if($j("#open-accounting").attr("checked"))
+				nonProfitCode='<div rel="mc:openAccountingPage" href="'+$j("#open-accounting-website").val()+'"></div>';
+			if($j("#accept-donations").attr("checked"))
+				nonProfitCode='<div rel="mc:donationPage" href="'+$j("#donation-website").val()+'"></div>';
+			if($j("#how-to-help").attr("checked"))
+				nonProfitCode='<div rel="mc:howToHelpPage" href="'+$j("#how-to-help-website").val()+'"></div>';
+		}
+		
+		reproduciblecode='';
+		if($j('#rp-checkbox').val()=='S'){			
+			pText+=comma+' Reproducible';
+			comma=',';
+			code+='<div rel="mc:moveCommonsType" resource="[mc:Reproducible]"></div>';
+			if($j("#terms-of-use").attr("checked"))
+				reproducibleCode+='<div rel="mc:tosPage" href="'+$j("#terms-of-use-website").val()+'"></div>'; 
+			if($j("#creative-commons").attr("checked")) 
+				reproducibleCode+='<div rel="license" href="'+$j("#creative-commons-website").val()+'"></div>';
+			if($j("#other-license").attr("checked"))
+				reproducibleCode+='<div rel="license" href="'+$j("#other-license-website").val()+'"></div>';	
+			if($j("#organization-structure").attr("checked"))
+				reproducibleCode+='<div rel="mc:sharesInternalOrganization" href="'+$j("#organization-structure-website").val()+'"></div>';	
+			if($j("#internal-procedures").attr("checked"))
+				reproducibleCode+='<div rel="mc:sharesInternalProcedures" href="'+$j("#internal-procedures-website").val()+'"></div>';	
+			if($j("#list-members").attr("checked"))
+				reproducibleCode+='<div rel="mc:sharesMemberList" href="'+$j("#list-members-website").val()+'"></div>';
+			if($j("#funding-sources").attr("checked"))
+				reproducibleCode+='<div rel="mc:sharesFundingSource" href="'+$j("#funding-sources-website").val()+'"></div>';			
+		}
+		
+		grassrootsCode='';
+		if($j('#gr-checkbox').val()=='S'){
+			pText+=comma+' Representative';
+			comma=',';
+			code+='<div rel="mc:moveCommonsType" resource="[mc:Representative]"></div>';
+			if($j("#decisions-general-assemblies").attr("checked"))
+				grassrootsCode+='<div rel="mc:hasFormOrg" resource="[mc:Consensus]"></div>';
+			if($j("#representatives-democratically").attr("checked"))
+				grassrootsCode+='<div rel="mc:hasFormOrg" resource="[mc:Assembly]"></div>';			
+			if($j("#decisions-voting").attr("checked"))
+				grassrootsCode+='<div rel="mc:focusesIn" resource="[mc:Digital]"></div>';	
+		}
+		
+		reinforcingCode='';
+		if($j('#rc-checkbox').val()=='S'){	
+			code+='<div rel="mc:moveCommonsType" resource="[mc:ReinforcesCommons]"></div>';
+			if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcec60.png'){
+				reinforcingCode+='<div rel="mc:focusesIn" resource="[mc:Ecology]"></div>';//nature commons
+				pText+=comma+' Reinforcing the Ecology Commons';
+			}else if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcbo60.png'){
+				reinforcingCode+='<div rel="mc:focusesIn" resource="[mc:Body]"></div>';//BODY/HEALTH COMMONS
+				pText+=comma+' Reinforcing the Ecology Commons';
+			}else if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcto60.png'){
+				reinforcingCode+='<div rel="mc:focusesIn" resource="[mc:Town]"></div>';//TOWN/COMMUNITY/SOCIETY COMMONS
+				pText+=comma+' Reinforcing the Ecology Commons';
+			}else{
+				reinforcingCode+='<div rel="mc:focusesIn" resource="[mc:Digital]"></div>';//DIGITAL COMMONS
+				pText+=comma+' Reinforcing the Ecology Commons';
+			}	
+		}
+		
+		code=code+nonProfitcode+reproduciblecode+grassrootsCode+reinforcingCode;
+		code+=commasToKeywords($j("#keywords").val());
+		code+='<a href="http://movecommons.org/en/np-rp-rc.ec-rs/0.1<img src="http://movecommons.org/mc/0.1/images/" alt="'+pText+'" /></a><p>'+pText+'</p>'
+		
+		$j('#semantic_code').val(code);
+	}
+		
 	function createInitiativeXml(step6ImageClick){
+		
+		//<div rel="mc:howToHelpPage" href="http://comunes.org/join"></div>
+		
 		if($j('#np-checkbox').val()=='S'){
 			nonProfitXml="<INITIATIVE_NON_PROFIT>YES</INITIATIVE_NON_PROFIT>";
 			if($j("#registered-non-profit").attr("checked"))
@@ -594,6 +680,11 @@
 			nonProfitXml="<INITIATIVE_NON_PROFIT>NO</INITIATIVE_NON_PROFIT>";
 		}
 		
+		//<div rel="mc:sharesFundingSource" href="http://comunes.org/XXXXXXX"></div>
+		//<div rel="mc:sharesInternalOrganization" href="http://comunes.org/XXXXXXX"></div>
+		//<div rel="mc:sharesMemberList" href="http://comunes.org/about"></div>
+		//<div rel="mc:sharesInternalProcedures" href="http://comunes.org/XXXXXXX"></div>
+		
 		if($j('#rp-checkbox').val()=='S'){
 			reproducibleXml="<INITIATIVE_REPRODUCIBLE>YES</INITIATIVE_REPRODUCIBLE>";
 			if($j("#terms-of-use").attr("checked"))
@@ -677,105 +768,17 @@
 				$('#loader').show();					 		 				
 	 		},  	
 			data: $j.createXML(xmlDoc),			
-			success: function(xmlData) {				
-				$('#loader').hide();
+			success: function(xmlData) {
+				generate_sematic_code();		
 				if(!step6ImageClick)
 					submit_fifth();
+				$('#loader').hide();
 				alert("Dev msg: Your data has been successfully saved!!");				
 			}
 		});
 		
 	}
-	
-	function generate_sematic_code(){
 		
-		var code='<div id="move-commons-badge"><div xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:mc="http://movecommons.org/ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" about="http://comunes.org" typeof="mc:Collective"></div>';
-		var pText='Move Commons',comma='';
-		code+='<div property="foaf:name" content="'+$j("#ininame").val()+'"></div>';//name
-		code+='<div rel="foaf:homepage" href="'+$j("#url").val()+'"></div>';//web address
-		code+=commasToLanguages($j("#languages").val());
-		code+='<div rel="mc:locationActivity" resource="'+$j("#location").val()+'"></div>';
-		
-		nonProfitcode=''; 
-		if($j('#np-checkbox').val()=='S'){
-			pText+=comma+' Non-Profit';
-			comma=',';
-			code+='<div rel="mc:moveCommonsType" resource="[mc:NonProfit]"></div>';
-			if($j("#registered-non-profit").attr("checked"))
-				nonProfitCode='<div rel="mc:officiallyRegisteredPage" href="'+$j("#non-profit-website").val()+'"></div>';
-			if($j("#open-accounting").attr("checked"))
-				nonProfitCode='<div rel="mc:openAccountingPage" href="'+$j("#open-accounting-website").val()+'"></div>';
-			if($j("#accept-donations").attr("checked"))
-				nonProfitCode='<div rel="mc:donationPage" href="'+$j("#donation-website").val()+'"></div>';
-			if($j("#how-to-help").attr("checked"))
-				nonProfitCode='<div rel="mc:howToHelpPage" href="'+$j("#how-to-help-website").val()+'"></div>';
-		}
-		
-		//<div rel="mc:howToHelpPage" href="http://comunes.org/join"></div>
-		
-		reproduciblecode='';
-		if($j('#rp-checkbox').val()=='S'){			
-			pText+=comma+' Reproducible';
-			comma=',';
-			code+='<div rel="mc:moveCommonsType" resource="[mc:Reproducible]"></div>';
-			if($j("#terms-of-use").attr("checked"))
-				reproducibleCode+='<div rel="mc:tosPage" href="'+$j("#terms-of-use-website").val()+'"></div>'; 
-			if($j("#creative-commons").attr("checked")) 
-				reproducibleCode+='<div rel="license" href="'+$j("#creative-commons-website").val()+'"></div>';
-			if($j("#other-license").attr("checked"))
-				reproducibleCode+='<div rel="license" href="'+$j("#other-license-website").val()+'"></div>';	
-			
-			//<div rel="mc:sharesFundingSource" href="http://comunes.org/XXXXXXX"></div>
-			//<div rel="mc:sharesInternalOrganization" href="http://comunes.org/XXXXXXX"></div>
-			//<div rel="mc:sharesMemberList" href="http://comunes.org/about"></div>
-			//<div rel="mc:sharesInternalProcedures" href="http://comunes.org/XXXXXXX"></div>
-			
-			if($j("#organization-structure").attr("checked"))
-				reproducibleCode+="<OUR_ORGANIZATION>YES</OUR_ORGANIZATION>";	
-			if($j("#internal-procedures").attr("checked"))
-				reproducibleCode+="<OUR_INTERNAL_PROCEDURES>YES</OUR_INTERNAL_PROCEDURES>";	
-			if($j("#list-members").attr("checked"))
-				reproducibleCode+="<OUR_LIST_OF_MEMBERS>YES</OUR_LIST_OF_MEMBERS>";
-			if($j("#funding-sources").attr("checked"))
-				reproducibleCode+="<OUR_FUNDING_SOURCES>YES</OUR_FUNDING_SOURCES>";			
-		}
-		
-		grassrootsCode='';
-		if($j('#gr-checkbox').val()=='S'){
-			pText+=comma+' Representative';
-			comma=',';
-			code+='<div rel="mc:moveCommonsType" resource="[mc:Representative]"></div>';
-			if($j("#decisions-general-assemblies").attr("checked"))
-				grassrootsCode+='<div rel="mc:hasFormOrg" resource="[mc:Consensus]"></div>';
-			if($j("#representatives-democratically").attr("checked"))
-				grassrootsCode+='<div rel="mc:hasFormOrg" resource="[mc:Assembly]"></div>';			
-			if($j("#decisions-voting").attr("checked"))
-				grassrootsCode+='<div rel="mc:focusesIn" resource="[mc:Digital]"></div>';	
-		}
-		
-		if($j('#rc-checkbox').val()=='S'){			
-			if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcec60.png'){
-				code+='<div rel="mc:moveCommonsType" resource="[mc:ReinforcesCommons]"></div>';//nature commons
-				pText+=comma+' Reinforcing the Ecology Commons';
-			}else if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcbo60.png'){
-				code+='<div rel="mc:moveCommonsType" resource="[mc:ReinforcesCommons]"></div>';//BODY/HEALTH COMMONS
-				pText+=comma+' Reinforcing the Ecology Commons';
-			}else if($j('#mc-form-icon-rc').attr('src')=='/mc/0.1/images/rcto60.png'){
-				code+='<div rel="mc:moveCommonsType" resource="[mc:ReinforcesCommons]"></div>';//TOWN/COMMUNITY/SOCIETY COMMONS
-				pText+=comma+' Reinforcing the Ecology Commons';
-			}else{
-				code+='<div rel="mc:moveCommonsType" resource="[mc:ReinforcesCommons]"></div>';//DIGITAL COMMONS
-				pText+=comma+' Reinforcing the Ecology Commons';
-			}	
-		}
-		
-		code=code+nonProfitcode+reproduciblecode+grassrootsCode;
-		code+=commasToKeywords($j("#keywords").val());
-		code+='<a href="http://movecommons.org/en/np-rp-rc.ec-rs/0.1<img src="http://movecommons.org/mc/0.1/images/" alt="'+pText+'" /></a><p>'+pText+'</p>'
-		
-		$j('#semantic_code').val(code);
-	}
-	
 	    
     $j('#submit_first').click(function(){
     	




More information about the Movecommons-commits mailing list