[kune-commits] r1405 - donate/src/cc/kune/sandbox/donate/client

Esteban Carreras Genis ecarrerasg at ourproject.org
Tue Jun 14 20:51:42 CEST 2011


Author: ecarrerasg
Date: 2011-06-14 20:51:42 +0200 (Tue, 14 Jun 2011)
New Revision: 1405

Modified:
   donate/src/cc/kune/sandbox/donate/client/Donate.java
Log:
Changes to GWT

Modified: donate/src/cc/kune/sandbox/donate/client/Donate.java
===================================================================
--- donate/src/cc/kune/sandbox/donate/client/Donate.java	2011-06-14 11:20:43 UTC (rev 1404)
+++ donate/src/cc/kune/sandbox/donate/client/Donate.java	2011-06-14 18:51:42 UTC (rev 1405)
@@ -1,72 +1,142 @@
 package cc.kune.sandbox.donate.client;
 
 import com.google.gwt.core.client.EntryPoint;
-import com.google.gwt.user.client.ui.FormPanel;
+import com.google.gwt.user.client.ui.Anchor;
 import com.google.gwt.user.client.ui.Hidden;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.HTMLPanel;
+import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.TextBox;
 import com.google.gwt.user.client.ui.TextBoxBase;
-import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.FormPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.event.dom.client.BlurHandler;
+import com.google.gwt.event.dom.client.BlurEvent;
 import com.google.gwt.event.dom.client.FocusHandler;
 import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.BlurEvent;
 
 /**
+ * Entry point classes define <code>onModuimport com.google.gwt.user.client.ui.VerticalPanel;
+
+/**
  * Entry point classes define <code>onModuleLoad()</code>.
  */
 public class Donate implements EntryPoint {
-	//Definicion de variables
-	private TextBox txtbxOtherValue = new TextBox(); //TextBox otro valor EUROS
-	private TextBox txtbxOtherValueDolar = new TextBox(); 
-	private String sDefaultValue = "other value"; //Valor por defecto
+	//Cons
+	private final String sDefaultValue = "other value"; 
+	private final String sDefaultTitle = "Type other value and press Enter";
+	
+	//Definition of variables
+	private TextBox txtbxOtherValueEUR = new TextBox(); 
+	private TextBox txtbxOtherValueDollar = new TextBox();
+	
 	@SuppressWarnings("deprecation")
 	public void onModuleLoad() {
 		RootPanel rootPanel = RootPanel.get();
+		rootPanel.setHeight("100%");
 		
+		//Parent div
 		HTMLPanel divEntries = new HTMLPanel("");
 		divEntries.setStyleName("entries");
 		rootPanel.add(divEntries, 10, 10);
 		
+		//Child empty div
 		HTMLPanel divRightedit = new HTMLPanel("");
 		divRightedit.setStyleName("rightedit");
 		divEntries.add(divRightedit);
 		
-		
+		//Child content div
 		HTMLPanel divPost = new HTMLPanel("");
 		divPost.setStyleName("post");
 		divEntries.add(divPost);
 		
-		HTML contenidoDivPost = new HTML(getParrafo(null) + getCabecera("Donate to comunes", 2)+
-				getParrafo("Comunes is a non-profit organization dedicated to " +
-				"encourage the commons, those goods collectively owned by everybody, " +
-				"and also serves as an umbrella for other related initiatives. We rely " +
-				"on the generous support of people like you and other collectives to " +
-				"help us continue the work we do.") + getParrafo(null) + 
-				getCabecera("Regular donation per month (the most necessary for us)", 3) + 
-				getParrafo(null), true);
-		contenidoDivPost.setStyleName("textoPost");
+		HTML divTitle = new HTML("Donate to Comunes", true);
+		divPost.add(divTitle);
+		divTitle.setStyleName("title");
 		
-		divPost.add(contenidoDivPost);
+		HTML divIntro = new HTML("Comunes is a non-profit organization dedicated to encourage the commons, those goods collectively owned by everybody, and also serves as an umbrella for other related initiatives. We rely on the generous support of people like you and other collectives to help us continue the work we do.", true);
+		divIntro.setStyleName("intro");
+		divPost.add(divIntro);
 		
-		//Opciones para donaciones en Euros
-		HTMLPanel pnListaEuro = new HTMLPanel("");
-		pnListaEuro.setStyleName("p0");
+		HTML divTitleRegular = new HTML("Regular donation per month (the most necessary for us)", true);
+		divTitleRegular.setStyleName("titleRegular");
+		divPost.add(divTitleRegular);
 		
-		HTML divListaEUR = new HTML("<ul class='blue'>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=10&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>10 &euro;/month</span></a></li> " +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=15&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>15 &euro;/month</span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=20&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>20 &euro;/month</span></a></li>");
-		divListaEUR.setStyleName("cm-btn cm-btn-line");
-		pnListaEuro.add(divListaEUR);
+		//Panel for Regular Donations in Euros
+		HTMLPanel divRegularDonationsEUR = new HTMLPanel("");
+		divRegularDonationsEUR.setStyleName("pnlOptions");
+		divPost.add(divRegularDonationsEUR);
+		divRegularDonationsEUR.setSize("550px", "28px");
 		
-		divPost.add(pnListaEuro);
-		txtbxOtherValue.addBlurHandler(new BlurHandler() {
+		HTMLPanel pnlRegularDonation10EUR = new HTMLPanel("");
+		pnlRegularDonation10EUR.setStyleName("option");
+		divRegularDonationsEUR.add(pnlRegularDonation10EUR);
+		pnlRegularDonation10EUR.setSize("115px", "28px");
+		
+		Anchor lnk1EUR = new Anchor();
+		lnk1EUR.setStyleName("optionLeft");
+		lnk1EUR.setHTML("10 \u20AC/month");
+		lnk1EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=10&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation10EUR.add(lnk1EUR);
+		lnk1EUR.setSize("85px", "28px");
+		
+		HTMLPanel pnlRegularDonation15EUR = new HTMLPanel("");
+		pnlRegularDonation15EUR.setStyleName("option");
+		divRegularDonationsEUR.add(pnlRegularDonation15EUR);
+		pnlRegularDonation15EUR.setSize("115px", "28px");
+		
+		Anchor lnk2EUR = new Anchor();
+		lnk2EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=15&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		lnk2EUR.setStyleName("optionLeft");
+		lnk2EUR.setHTML("15 \u20AC/month");
+		pnlRegularDonation15EUR.add(lnk2EUR);
+		lnk2EUR.setSize("85px", "28px");
+		
+		HTMLPanel pnlRegularDonation20EUR = new HTMLPanel("");
+		pnlRegularDonation20EUR.setStyleName("option");
+		divRegularDonationsEUR.add(pnlRegularDonation20EUR);
+		pnlRegularDonation20EUR.setSize("115px", "28px");
+		
+		Anchor lnk3EUR = new Anchor();
+		lnk3EUR.setStyleName("optionLeft");
+		lnk3EUR.setHTML("20 \u20AC/month");
+		lnk3EUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=EUR&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=20&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation20EUR.add(lnk3EUR);
+		lnk3EUR.setSize("85px", "28px");
+		
+		HTMLPanel pnlRegularDonationOtherEUR = new HTMLPanel("");
+		pnlRegularDonationOtherEUR.setStyleName("optionOther");
+		divRegularDonationsEUR.add(pnlRegularDonationOtherEUR);
+		pnlRegularDonationOtherEUR.setSize("174px", "28px");
+		
+		FormPanel formPanelEUR = new FormPanel();
+		formPanelEUR.setAction("https://www.paypal.com/cgi-bin/webscr");
+		formPanelEUR.setMethod(FormPanel.METHOD_GET);
+		pnlRegularDonationOtherEUR.add(formPanelEUR);
+		
+		FlowPanel flowPanelEUR = new FlowPanel();
+		formPanelEUR.setWidget(flowPanelEUR);
+		flowPanelEUR.setSize("100%", "100%");
+		txtbxOtherValueEUR.setVisibleLength(10);
+		txtbxOtherValueEUR.setName("a3");
+		
+		//Other Value Euro events
+		txtbxOtherValueEUR.addFocusHandler(new FocusHandler() {
+			public void onFocus(FocusEvent event) {
+				String sDefaultValue = "other value";
+				//Window.alert(txtbxOtherValue.getText());
+				if(txtbxOtherValueEUR.getText().equals(sDefaultValue))
+				{
+					txtbxOtherValueEUR.setText("");
+				}
+			}
+		});
+		
+		txtbxOtherValueEUR.addBlurHandler(new BlurHandler() {
 			String sDefaultValue = "other value";
 			public void onBlur(BlurEvent event) {
-				String sActualValue = txtbxOtherValue.getText();
+				String sActualValue = txtbxOtherValueEUR.getText();
 				int iActualValue = 0;
 				if(!sActualValue.equals(""))
 				{	
@@ -75,127 +145,145 @@
 				//validate
 				if(sActualValue == "" || iActualValue == 0 || sActualValue != "" + iActualValue)
 				{
-					txtbxOtherValue.setText(sDefaultValue);
+					txtbxOtherValueEUR.setText(sDefaultValue);
 				}
 			}
 		});
+		//End Other Value Euro events
 		
-		//Configuramos el boton
-		txtbxOtherValue.setName("a3");
-		txtbxOtherValue.setVisibleLength(10);
-		txtbxOtherValue.setTextAlignment(TextBoxBase.ALIGN_CENTER);
-		txtbxOtherValue.setSize("83px", "16px");
-		txtbxOtherValue.setValue(sDefaultValue);
-		txtbxOtherValue.setTitle("Type other value and press Enter");
+		Hidden h1EUR = new Hidden("business");
+		h1EUR.setDefaultValue("donate at ourproject.org");
+		flowPanelEUR.add(h1EUR);
 		
-		txtbxOtherValue.addFocusHandler(new FocusHandler() {
-			//FieldFocused
-			public void onFocus(FocusEvent event) {
-				String sDefaultValue = "other value";
-				//Window.alert(txtbxOtherValue.getText());
-				if(txtbxOtherValue.getText().equals(sDefaultValue))
-				{
-					txtbxOtherValue.setText("");
-				}
-			}
-		});
+		Hidden h2EUR = new Hidden("cmd");
+		h2EUR.setDefaultValue("_xclick-subscriptions");
+		flowPanelEUR.add(h2EUR);
 		
-		HTMLPanel pnOtherValue = new HTMLPanel("");
-		divPost.add(pnOtherValue);
-		pnOtherValue.setStyleName("p1");
+		Hidden h3EUR = new Hidden("item_name");
+		h3EUR.setDefaultValue(" Donate to comunes.org");
+		flowPanelEUR.add(h3EUR);
 		
-		//Campos del form
-		Hidden h1 = new Hidden();
-		h1.setName("business");
-		h1.setValue("donate at ourproject.org");
+		Hidden h4EUR = new Hidden("currency_code");
+		h4EUR.setDefaultValue("EUR");
+		flowPanelEUR.add(h4EUR);
 		
-		Hidden h2 = new Hidden();
-		h2.setName("cmd");
-		h2.setValue("_xclick-subscriptions");
+		Hidden h5EUR = new Hidden("no_shipping");
+		h5EUR.setDefaultValue("1");
+		flowPanelEUR.add(h5EUR);
 		
-		Hidden h3 = new Hidden();
-		h3.setName("item_name");
-		h3.setValue("Donate to comunes.org");
+		Hidden h6EUR = new Hidden("t3");
+		h6EUR.setDefaultValue("M");
+		flowPanelEUR.add(h6EUR);
 		
-		Hidden h4 = new Hidden();
-		h4.setName("currency_code");
-		h4.setValue("EUR");
+		Hidden h7EUR = new Hidden("p3");
+		h7EUR.setDefaultValue("1");
+		flowPanelEUR.add(h7EUR);
 		
-		Hidden h4Dolar = new Hidden();
-		h4Dolar.setName("currency_code");
-		h4Dolar.setValue("USD");
+		Hidden h8EUR = new Hidden("src");
+		h8EUR.setDefaultValue("1");
+		flowPanelEUR.add(h8EUR);
 		
-		Hidden h5 = new Hidden();
-		h5.setName("no_shipping");
-		h5.setValue("1");
+		Hidden h9EUR = new Hidden("image_url");
+		h9EUR.setDefaultValue("http://comunes.org/cm/images/logo-pp.png");
+		flowPanelEUR.add(h9EUR);
 		
-		Hidden h6 = new Hidden();
-		h6.setName("t3");
-		h6.setValue("M");
-
-		Hidden h7 = new Hidden();
-		h7.setName("p3");
-		h7.setValue("1");
-	
-		Hidden h8 = new Hidden();
-		h8.setName("src");
-		h8.setValue("1");
-
-		Hidden h9 = new Hidden();
-		h9.setName("image_url");
-		h9.setValue("http://comunes.org/cm/images/logo-pp.png");
+		Hidden h10EUR = new Hidden("sra");
+		h10EUR.setDefaultValue("1");
+		flowPanelEUR.add(h10EUR);
 		
-		Hidden h10 = new Hidden();
-		h10.setName("sra");
-		h10.setValue("1");
+		Hidden h11EUR = new Hidden("lc");
+		h11EUR.setDefaultValue("us");
+		flowPanelEUR.add(h11EUR);
 		
-		Hidden h11 = new Hidden();
-		h11.setName("lc");
-		h11.setValue("us");
-		//Fin campos del form
+		flowPanelEUR.add(txtbxOtherValueEUR);
+		txtbxOtherValueEUR.setSize("83px", "16px");
+		txtbxOtherValueEUR.setTextAlignment(TextBoxBase.ALIGN_CENTER);
+		txtbxOtherValueEUR.setText(sDefaultValue);
+		txtbxOtherValueEUR.setTitle(sDefaultTitle);
 		
-		FormPanel frmOtherValue = new FormPanel();
-		frmOtherValue.setMethod("get");
-		frmOtherValue.setAction("https://www.paypal.com/cgi-bin/webscr");
+		Label lblOtherEUR = new Label("\u20AC/month");
+		flowPanelEUR.add(lblOtherEUR);
+		lblOtherEUR.setStyleName("labelOther");
+		//End of Panel for Regular Donations in Euros
 		
-		VerticalPanel pnFrmOtherValue = new VerticalPanel();
-
-		pnFrmOtherValue.add(h1);
-		pnFrmOtherValue.add(h2);
-		pnFrmOtherValue.add(h3);
-		pnFrmOtherValue.add(h4);
-		pnFrmOtherValue.add(h5);
-		pnFrmOtherValue.add(h6);
-		pnFrmOtherValue.add(h7);
-		pnFrmOtherValue.add(h8);
-		pnFrmOtherValue.add(h9);
-		pnFrmOtherValue.add(h10);
-		pnFrmOtherValue.add(h11);
-		pnFrmOtherValue.add(txtbxOtherValue);
+		//Panel for Regular Donations in Dollars
+		HTMLPanel divRegularDonationsDollar = new HTMLPanel("");
+		divRegularDonationsDollar.setStyleName("pnlOptions");
+		divPost.add(divRegularDonationsDollar);
+		divRegularDonationsDollar.setSize("550px", "28px");
 		
-		frmOtherValue.add(pnFrmOtherValue);
-		pnOtherValue.add(frmOtherValue);
+		HTMLPanel pnlRegularDonation10Dollar = new HTMLPanel("");
+		pnlRegularDonation10Dollar.setStyleName("option");
+		divRegularDonationsDollar.add(pnlRegularDonation10Dollar);
+		pnlRegularDonation10Dollar.setSize("115px", "28px");
 		
-		HTMLPanel pnLabelEUR = new HTMLPanel(" &euro;/month   ");
-		pnLabelEUR.setStyleName("p1Label");
-		divPost.add(pnLabelEUR);
-	
-		//Opciones para donaciones en Dolares
-		HTMLPanel pnListaDolar = new HTMLPanel("");
-		pnListaDolar.setStyleName("p0");
+		Anchor lnk1Dollar = new Anchor();
+		lnk1Dollar.setStyleName("optionLeft");
+		lnk1Dollar.setHTML("10 $/month");
+		lnk1Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=10&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation10Dollar.add(lnk1Dollar);
+		lnk1Dollar.setSize("85px", "28px");
 		
-		HTML divListaUSA = new HTML("<ul class='blue'>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=10&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>10 &#36;/month</span></a></li> " +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=15&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>15 &#36;/month</span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=20&lc=es&item_name=Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>20 &#36;/month</span></a></li>");
-		divListaUSA.setStyleName("cm-btn cm-btn-line");
-		pnListaDolar.add(divListaUSA);
+		HTMLPanel pnlRegularDonation15Dollar = new HTMLPanel("");
+		pnlRegularDonation15Dollar.setStyleName("option");
+		divRegularDonationsDollar.add(pnlRegularDonation15Dollar);
+		pnlRegularDonation15Dollar.setSize("115px", "28px");
 		
-		divPost.add(pnListaDolar);
-		txtbxOtherValueDolar.addBlurHandler(new BlurHandler() {
+		Anchor lnk2Dollar = new Anchor();
+		lnk2Dollar.setStyleName("optionLeft");
+		lnk2Dollar.setHTML("15 $/month");
+		lnk2Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=15&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation15Dollar.add(lnk2Dollar);
+		lnk2Dollar.setSize("85px", "28px");
+		
+		HTMLPanel pnlRegularDonation20Dollar = new HTMLPanel("");
+		pnlRegularDonation20Dollar.setStyleName("option");
+		divRegularDonationsDollar.add(pnlRegularDonation20Dollar);
+		pnlRegularDonation20Dollar.setSize("115px", "28px");
+		
+		Anchor lnk3Dollar = new Anchor();
+		lnk3Dollar.setStyleName("optionLeft");
+		lnk3Dollar.setHTML("20 $/month");
+		lnk3Dollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_xclick-subscriptions&business=donate%40ourproject.org&currency_code=USD&no_shipping=1&t3=M&p3=1&src=1&sra=1&a3=20&lc=es&item_name= Donate to comunes.org&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation20Dollar.add(lnk3Dollar);
+		lnk3Dollar.setSize("85px", "28px");
+		
+		HTMLPanel pnlRegularDonationOtherDollar = new HTMLPanel("");
+		pnlRegularDonationOtherDollar.setStyleName("optionOther");
+		divRegularDonationsDollar.add(pnlRegularDonationOtherDollar);
+		pnlRegularDonationOtherDollar.setSize("174px", "28px");
+		
+		FormPanel formPanelDollar = new FormPanel();
+		formPanelDollar.setMethod(FormPanel.METHOD_GET);
+		formPanelDollar.setAction("https://www.paypal.com/cgi-bin/webscr");
+		pnlRegularDonationOtherDollar.add(formPanelDollar);
+		
+		FlowPanel flowPanelDollar = new FlowPanel();
+		formPanelDollar.setWidget(flowPanelDollar);
+		flowPanelDollar.setSize("100%", "100%");
+		txtbxOtherValueDollar.setName("a3");
+		txtbxOtherValueDollar.setVisibleLength(10);
+		
+		txtbxOtherValueDollar.setTitle("Type other value and press Enter");
+		txtbxOtherValueDollar.setTextAlignment(TextBoxBase.ALIGN_CENTER);
+		txtbxOtherValueDollar.setText("other value");
+		
+		//Other Value Dollar events
+		txtbxOtherValueDollar.addFocusHandler(new FocusHandler() {
+			public void onFocus(FocusEvent event) {
+				String sDefaultValue = "other value";
+				//Window.alert(txtbxOtherValue.getText());
+				if(txtbxOtherValueDollar.getText().equals(sDefaultValue))
+				{
+					txtbxOtherValueDollar.setText("");
+				}
+			}
+		});
+		
+		txtbxOtherValueDollar.addBlurHandler(new BlurHandler() {
 			String sDefaultValue = "other value";
 			public void onBlur(BlurEvent event) {
-				String sActualValue = txtbxOtherValueDolar.getText();
+				String sActualValue = txtbxOtherValueDollar.getText();
 				int iActualValue = 0;
 				if(!sActualValue.equals(""))
 				{	
@@ -204,150 +292,237 @@
 				//validate
 				if(sActualValue == "" || iActualValue == 0 || sActualValue != "" + iActualValue)
 				{
-					txtbxOtherValueDolar.setText(sDefaultValue);
+					txtbxOtherValueDollar.setText(sDefaultValue);
 				}
 			}
 		});
+		//End Other Value Dollar events
 		
-		//Configuramos el boton de Dolar
-		txtbxOtherValueDolar.setName("a3");
-		txtbxOtherValueDolar.setVisibleLength(10);
-		txtbxOtherValueDolar.setTextAlignment(TextBoxBase.ALIGN_CENTER);
-		txtbxOtherValueDolar.setSize("83px", "16px");
-		txtbxOtherValueDolar.setValue(sDefaultValue);
-		txtbxOtherValueDolar.setTitle("Type other value and press Enter");
+		Hidden h1Dollar = new Hidden("business");
+		h1Dollar.setDefaultValue("donate at ourproject.org");
+		flowPanelDollar.add(h1Dollar);
 		
-		txtbxOtherValueDolar.addFocusHandler(new FocusHandler() {
-			//FieldFocused
-			public void onFocus(FocusEvent event) {
-				String sDefaultValue = "other value";
-				//Window.alert(txtbxOtherValueDolar.getText());
-				if(txtbxOtherValueDolar.getText().equals(sDefaultValue))
-				{
-					txtbxOtherValueDolar.setText("");
-				}
-			}
-		});
+		Hidden h2Dollar = new Hidden("cmd");
+		h2Dollar.setDefaultValue("_xclick-subscriptions");
+		flowPanelDollar.add(h2Dollar);
 		
-		HTMLPanel pnOtherValueDolar = new HTMLPanel("");
-		divPost.add(pnOtherValueDolar);
-		pnOtherValueDolar.setStyleName("p1");
+		Hidden h3Dollar = new Hidden("item_name");
+		h3Dollar.setDefaultValue(" Donate to comunes.org");
+		flowPanelDollar.add(h3Dollar);
 		
-		FormPanel frmOtherValueDolar = new FormPanel();
-		frmOtherValueDolar.setMethod("get");
-		frmOtherValueDolar.setAction("https://www.paypal.com/cgi-bin/webscr");
+		Hidden h4Dollar = new Hidden("currency_code");
+		h4Dollar.setDefaultValue("USD");
+		flowPanelDollar.add(h4Dollar);
 		
-		VerticalPanel pnFrmOtherValueDolar = new VerticalPanel();
-
-		pnFrmOtherValueDolar.add(h1);
-		pnFrmOtherValueDolar.add(h2);
-		pnFrmOtherValueDolar.add(h3);
-		pnFrmOtherValueDolar.add(h4Dolar); //Hidden diferente
-		pnFrmOtherValueDolar.add(h5);
-		pnFrmOtherValueDolar.add(h6);
-		pnFrmOtherValueDolar.add(h7);
-		pnFrmOtherValueDolar.add(h8);
-		pnFrmOtherValueDolar.add(h9);
-		pnFrmOtherValueDolar.add(h10);
-		pnFrmOtherValueDolar.add(h11);
-		pnFrmOtherValueDolar.add(txtbxOtherValueDolar);
+		Hidden h5Dollar = new Hidden("no_shipping");
+		h5Dollar.setDefaultValue("1");
+		flowPanelDollar.add(h5Dollar);
 		
-		frmOtherValueDolar.add(pnFrmOtherValueDolar);
-		pnOtherValueDolar.add(frmOtherValueDolar);
+		Hidden h6Dollar = new Hidden("t3");
+		h6Dollar.setDefaultValue("M");
+		flowPanelDollar.add(h6Dollar);
 		
-		HTMLPanel pnLabelDolar = new HTMLPanel(" &#36;/month   ");
-		pnLabelDolar.setStyleName("p1Label");
-		divPost.add(pnLabelDolar);
+		Hidden h7Dollar = new Hidden("p3");
+		h7Dollar.setDefaultValue("1");
+		flowPanelDollar.add(h7Dollar);
 		
-		//Siguiente p�rrafo
-		HTML contenidoDivPost2 = new HTML(getCabecera("Single donation", 3), true);
-		contenidoDivPost2.setStyleName("textoPost");
+		Hidden h8Dollar = new Hidden("src");
+		h8Dollar.setDefaultValue("1");
+		flowPanelDollar.add(h8Dollar);
 		
-		divPost.add(contenidoDivPost2);
+		Hidden h9Dollar = new Hidden("image_url");
+		h9Dollar.setDefaultValue("http://comunes.org/cm/images/logo-pp.png");
+		flowPanelDollar.add(h9Dollar);
 		
-		//Opciones para donaciones simples en Euros
-		HTMLPanel pnListaEuro2 = new HTMLPanel("");
-		pnListaEuro2.setStyleName("p0");
+		Hidden h10Dollar = new Hidden("sra");
+		h10Dollar.setDefaultValue("1");
+		flowPanelDollar.add(h10Dollar);
 		
-		HTML divListaEUR2 = new HTML("<ul class='blue'>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=EUR&amount=25&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>25 &euro; </span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=EUR&amount=75&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>75 &euro; </span></a></li> " +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=EUR&amount=150&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>150 &euro; </span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=EUR&amount=300&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>300 &euro; </span></a></li>");
-		divListaEUR2.setStyleName("cm-btn cm-btn-line");
-		pnListaEuro2.add(divListaEUR2);
-		divPost.add(pnListaEuro2);
+		Hidden h11Dollar = new Hidden("lc");
+		h11Dollar.setDefaultValue("us");
+		flowPanelDollar.add(h11Dollar);
 		
-		//Opciones para donaciones simples en dolares
-		HTMLPanel pnListaDolar2 = new HTMLPanel("");
-		pnListaDolar2.setStyleName("p0");
+		flowPanelDollar.add(txtbxOtherValueDollar);
+		txtbxOtherValueDollar.setSize("83px", "16px");
 		
-		HTML divListaUSA2 = new HTML("<ul class='blue'>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=USD&amount=25&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>25 &#36; </span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=USD&amount=75&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>75 &#36; </span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=USD&amount=150&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>150 &#36; </span></a></li>" +
-									"<li><a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=USD&amount=300&image_url=http://comunes.org/cm/images/logo-pp.png' class='current'><span>300 &#36; </span></a></li>");
-		divListaUSA2.setStyleName("cm-btn cm-btn-line");
-		pnListaDolar2.add(divListaUSA2);
+		Label lblOtherDollar = new Label("$/month");
+		lblOtherDollar.setStyleName("labelOther");
+		flowPanelDollar.add(lblOtherDollar);
 		
-		divPost.add(pnListaDolar2);
+		HTML divTitleSingle = new HTML("Single donation", true);
+		divPost.add(divTitleSingle);
+		divTitleSingle.setStyleName("titleRegular");
 		
-		HTMLPanel pnVacio = new HTMLPanel("");
-		pnVacio.setStyleName("divVacio");
+		HTMLPanel divSingleDonationEUR = new HTMLPanel("");
+		divSingleDonationEUR.setStyleName("pnlOptions");
+		divPost.add(divSingleDonationEUR);
+		divSingleDonationEUR.setSize("340px", "28px");
 		
-		divPost.add(pnVacio);
+		HTMLPanel pnlRegularDonation25EUR = new HTMLPanel("");
+		pnlRegularDonation25EUR.setStyleName("option");
+		divSingleDonationEUR.add(pnlRegularDonation25EUR);
+		pnlRegularDonation25EUR.setSize("75px", "28px");
 		
-		//Texto final
-		HTML contenidoDivPost3 = new HTML(getParrafo("For other amounts use <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=EUR&image_url=http://comunes.org/cm/images/logo-pp.png'>this link for Euros</a> or <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name=Donate to comunes.org&currency_code=USD&image_url=http://comunes.org/cm/images/logo-pp.png'>this one for USD.</a>") + 
-										  getParrafo("Please consider donating more if you can afford it.") + 
-										  getCabecera("Give using your Bank", 3) + 
-										  "<br />" + 
-										  getParrafo("<a href='http://comunes.org/bank-info'>See our Bank account info page</a>") + 
-										  getParrafo("Unless you specify the contrary, we will add you to our donor list.") + 
-										  getParrafo("If you have doubts please contact us at donate at ourproject dot org.") + 
-										  getCabecera("Thanks indeed!", 3), true);
-		contenidoDivPost3.setStyleName("textoPost");
+		Anchor lnk1SingleEUR = new Anchor();
+		lnk1SingleEUR.setStyleName("optionLeft");
+		lnk1SingleEUR.setHTML("25 \u20AC");
+		lnk1SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=EUR&amount=25&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation25EUR.add(lnk1SingleEUR);
+		lnk1SingleEUR.setSize("45px", "28px");
 		
-		divPost.add(contenidoDivPost3);
-	}
-	
-	public String getParrafo(String sTexto)
-	{
-		String p = "<p>";
-		if(sTexto != null)
-		{
-			p += sTexto;
-		}
-		p += "</p>";
+		HTMLPanel pnlRegularDonation75EUR = new HTMLPanel("");
+		pnlRegularDonation75EUR.setStyleName("option");
+		divSingleDonationEUR.add(pnlRegularDonation75EUR);
+		pnlRegularDonation75EUR.setSize("75px", "28px");
 		
-		return p;
-	}
-	
-	public String getCabecera(String sTexto, int iTipo)
-	{
-		String cab = "";
-		String sCabecera = "";
-		String sFinCabecera = "";
-		switch(iTipo)
-		{
-			case 2:
-			case 3:
-				sCabecera = "<h" + iTipo + ">";
-				sFinCabecera = "</h" + iTipo + ">";
-			break;
-			default:
-				sCabecera = "<h2>";
-				sFinCabecera = "</h2>";
-			break;
-		}
+		Anchor lnk2SingleEUR = new Anchor();
+		lnk2SingleEUR.setStyleName("optionLeft");
+		lnk2SingleEUR.setHTML("75 \u20AC");
+		lnk2SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=EUR&amount=75&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation75EUR.add(lnk2SingleEUR);
+		lnk2SingleEUR.setSize("45px", "28px");
 		
-		cab += sCabecera;
-		if(sTexto != null)
-		{
-			cab += sTexto;
-		}
-		cab += sFinCabecera;
+		HTMLPanel pnlRegularDonation150EUR = new HTMLPanel("");
+		pnlRegularDonation150EUR.setStyleName("option");
+		divSingleDonationEUR.add(pnlRegularDonation150EUR);
+		pnlRegularDonation150EUR.setSize("75px", "28px");
 		
-		return cab;
+		Anchor lnk3SingleEUR = new Anchor();
+		lnk3SingleEUR.setStyleName("optionLeft");
+		lnk3SingleEUR.setHTML("100 \u20AC");
+		lnk3SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=EUR&amount=100&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation150EUR.add(lnk3SingleEUR);
+		lnk3SingleEUR.setSize("45px", "28px");
+		
+		HTMLPanel pnlRegularDonation300EUR = new HTMLPanel("");
+		pnlRegularDonation300EUR.setStyleName("option");
+		divSingleDonationEUR.add(pnlRegularDonation300EUR);
+		pnlRegularDonation300EUR.setSize("75px", "28px");
+		
+		Anchor lnk4SingleEUR = new Anchor();
+		lnk4SingleEUR.setStyleName("optionLeft");
+		lnk4SingleEUR.setHTML("300 \u20AC");
+		lnk4SingleEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=EUR&amount=300&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation300EUR.add(lnk4SingleEUR);
+		lnk4SingleEUR.setSize("45px", "28px");
+		
+		HTMLPanel divSingleDonationDollar = new HTMLPanel("");
+		divSingleDonationDollar.setStyleName("pnlOptions");
+		divPost.add(divSingleDonationDollar);
+		divSingleDonationDollar.setSize("340px", "28px");
+		
+		HTMLPanel pnlRegularDonation25Dollar = new HTMLPanel("");
+		pnlRegularDonation25Dollar.setStyleName("option");
+		divSingleDonationDollar.add(pnlRegularDonation25Dollar);
+		pnlRegularDonation25Dollar.setSize("75px", "28px");
+		
+		Anchor lnk1SingleDollar = new Anchor();
+		lnk1SingleDollar.setStyleName("optionLeft");
+		lnk1SingleDollar.setHTML("25 $");
+		lnk1SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=USD&amount=25&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation25Dollar.add(lnk1SingleDollar);
+		lnk1SingleDollar.setSize("45px", "28px");
+		
+		HTMLPanel pnlRegularDonation75Dollar = new HTMLPanel("");
+		pnlRegularDonation75Dollar.setStyleName("option");
+		divSingleDonationDollar.add(pnlRegularDonation75Dollar);
+		pnlRegularDonation75Dollar.setSize("75px", "28px");
+		
+		Anchor lnk2SingleDollar = new Anchor();
+		lnk2SingleDollar.setStyleName("optionLeft");
+		lnk2SingleDollar.setHTML("75 $");
+		lnk2SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=USD&amount=75&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation75Dollar.add(lnk2SingleDollar);
+		lnk2SingleDollar.setSize("45px", "28px");
+		
+		HTMLPanel pnlRegularDonation100Dollar = new HTMLPanel("");
+		pnlRegularDonation100Dollar.setStyleName("option");
+		divSingleDonationDollar.add(pnlRegularDonation100Dollar);
+		pnlRegularDonation100Dollar.setSize("75px", "28px");
+		
+		Anchor lnk3SingleDollar = new Anchor();
+		lnk3SingleDollar.setStyleName("optionLeft");
+		lnk3SingleDollar.setHTML("100 $");
+		lnk3SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=USD&amount=100&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation100Dollar.add(lnk3SingleDollar);
+		lnk3SingleDollar.setSize("45px", "28px");
+		
+		HTMLPanel pnlRegularDonation300Dollar = new HTMLPanel("");
+		pnlRegularDonation300Dollar.setStyleName("option");
+		divSingleDonationDollar.add(pnlRegularDonation300Dollar);
+		pnlRegularDonation300Dollar.setSize("75px", "28px");
+		
+		Anchor lnk4SingleDollar = new Anchor();
+		lnk4SingleDollar.setStyleName("optionLeft");
+		lnk4SingleDollar.setHTML("300 $");
+		lnk4SingleDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=USD&amount=300&image_url=http://comunes.org/cm/images/logo-pp.png");
+		pnlRegularDonation300Dollar.add(lnk4SingleDollar);
+		lnk4SingleDollar.setSize("45px", "28px");
+		
+		HTMLPanel divTextOther = new HTMLPanel("");
+		divTextOther.setStyleName("divTextDonate");
+		divPost.add(divTextOther);
+		
+		HTML htmlOther = new HTML("For other amounts use", true);
+		htmlOther.setStyleName("textDonate");
+		divTextOther.add(htmlOther);
+		htmlOther.setWidth("148px");
+		
+		Anchor lnkTextOtherEUR = new Anchor();
+		lnkTextOtherEUR.setText("this link for Euros");
+		lnkTextOtherEUR.setStyleName("textDonate");
+		lnkTextOtherEUR.setHTML("this link for Euros");
+		lnkTextOtherEUR.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=EUR&image_url=http://comunes.org/cm/images/logo-pp.png");
+		divTextOther.add(lnkTextOtherEUR);
+		lnkTextOtherEUR.setSize("127px", "28px");
+		
+		HTML htmlOther2 = new HTML("or", true);
+		htmlOther2.setStyleName("textDonate");
+		divTextOther.add(htmlOther2);
+		htmlOther2.setWidth("17px");
+		
+		Anchor lnkTextOtherDollar = new Anchor();
+		lnkTextOtherDollar.setText("this link for USD.");
+		lnkTextOtherDollar.setStyleName("textDonate");
+		lnkTextOtherDollar.setHTML("this link for USD.");
+		lnkTextOtherDollar.setHref("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&[email protected]&item_name= Donate to comunes.org&currency_code=USD&image_url=http://comunes.org/cm/images/logo-pp.png");
+		divTextOther.add(lnkTextOtherDollar);
+		lnkTextOtherDollar.setSize("127px", "28px");
+		
+		HTML htmlOther3 = new HTML("Please consider donating more if you can afford it. ", true);
+		htmlOther3.setStyleName("textDonateNewLine");
+		divTextOther.add(htmlOther3);
+		htmlOther3.setWidth("471px");
+		
+		HTML divTitleBank = new HTML("Give using your Bank", true);
+		divTitleBank.setStyleName("titleRegular");
+		divPost.add(divTitleBank);
+		
+		HTMLPanel divTextOtherBank = new HTMLPanel("");
+		divTextOtherBank.setStyleName("divTextOtherBank");
+		divPost.add(divTextOtherBank);
+		
+		Anchor lnkBank = new Anchor();
+		lnkBank.setText("See our Bank account info page");
+		lnkBank.setStyleName("textDonate");
+		lnkBank.setHTML("See our Bank account info page");
+		lnkBank.setHref("http://comunes.org/bank-info/");
+		divTextOtherBank.add(lnkBank);
+		lnkBank.setSize("471px", "28px");
+		
+		HTML htmlBank1 = new HTML("Unless you specify the contrary, we will add you to our donor list. ", true);
+		htmlBank1.setStyleName("textDonateNewLine");
+		divTextOtherBank.add(htmlBank1);
+		htmlBank1.setWidth("471px");
+		
+		HTML htmlBank2 = new HTML("If you have doubts please contact us at donate at ourproject dot org. ", true);
+		htmlBank2.setStyleName("textDonateNewLine");
+		divTextOtherBank.add(htmlBank2);
+		htmlBank2.setWidth("471px");
+		
+		HTML divTitleFinal = new HTML("Thanks indeed!", true);
+		divTitleFinal.setStyleName("titleRegular");
+		divPost.add(divTitleFinal);
+		//End of Panel for Regular Donations in Dollars
 	}
-}
+}
\ No newline at end of file




More information about the kune-commits mailing list