teerock

My Environment FB Post Like

May 22nd, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.39 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  5. <title>My Environment</title>
  6. <link href="http://my-environment.s3.amazonaws.com/style.css" rel="stylesheet" type="text/css" />
  7. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
  8. <script type="text/javascript" src="http://downloads.mailchimp.com/js/jquery.form-n-validate.js"></script>
  9. <script type="text/javascript" src="http://my-environment.s3.amazonaws.com/jquery.defaultText.js"></script>
  10. <script type="text/javascript">
  11. jQuery(document).ready( function($) {
  12. $.defaultText();
  13.  
  14. $('#mce-NAME').focus(function() {
  15. $('#mce-success-response').hide();
  16. $('#mce-error-response').hide();
  17. });
  18. });
  19. </script>
  20. </head>
  21. <body>
  22. <div id="wrapper">
  23. <div class="intro">
  24. I call upon both sides of the Victorian parliament to approve legislation to create new forest reserves and bring to an end native forest logging in the state.
  25. </div>
  26. <div class="subscribe">
  27. <!-- Begin MailChimp Signup Form -->
  28. <form action="http://myenvironment.us2.list-manage.com/subscribe/post?u=6927d3e0e362818c9fb02cfa8&id=52a3560046" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank">
  29. <div class="input-container"><input type="text" name="NAME" class="required myClass" id="mce-NAME" title="Name"></div>
  30. <div class="input-container"><input type="text" name="EMAIL" class="required email myClass" id="mce-EMAIL" title="Email Address"></div>
  31. <div class="receive-updates">Tick to receive updates from MyEnvironment<input type="checkbox" value="1" name="group[3505][1]" id="mce-group[3505]-3505-0"></div>
  32. <div id="mce-responses" class="clear">
  33. <div class="response" id="mce-error-response" style="display:none"></div>
  34. <div class="response" id="mce-success-response" style="display:none"></div>
  35. </div>
  36. <div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button"></div>
  37. </form>
  38. <script type="text/javascript">
  39. var fnames = new Array();var ftypes = new Array();fnames[1]='NAME';ftypes[1]='text';fnames[0]='EMAIL';ftypes[0]='email';
  40.  
  41. jQuery(document).ready( function($) {
  42. var options = { errorClass: 'mce_inline_error', errorElement: 'div', onkeyup: function(){}, onfocusout:function(){}, onblur:function(){} };
  43. var mce_validator = $("#mc-embedded-subscribe-form").validate(options);
  44. $("#mc-embedded-subscribe-form").unbind('submit');//remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator
  45. options = { url: 'http://myenvironment.us2.list-manage1.com/subscribe/post-json?u=6927d3e0e362818c9fb02cfa8&id=52a3560046&c=?', type: 'GET', dataType: 'json', contentType: "application/json; charset=utf-8",
  46. beforeSubmit: function(){
  47. $('#mce_tmp_error_msg').remove();
  48. $('.datefield','#mc_embed_signup').each(
  49. function(){
  50. var txt = 'filled';
  51. var fields = new Array();
  52. var i = 0;
  53. $(':text', this).each(
  54. function(){
  55. fields[i] = this;
  56. i++;
  57. });
  58. $(':hidden', this).each(
  59. function(){
  60. var bday = false;
  61. if (fields.length == 2){
  62. bday = true;
  63. fields[2] = {'value':1970};//trick birthdays into having years
  64. }
  65. if ( fields[0].value=='MM' && fields[1].value=='DD' && (fields[2].value=='YYYY' || (bday && fields[2].value==1970) ) ){
  66. this.value = '';
  67. } else if ( fields[0].value=='' && fields[1].value=='' && (fields[2].value=='' || (bday && fields[2].value==1970) ) ){
  68. this.value = '';
  69. } else {
  70. this.value = fields[0].value+'/'+fields[1].value+'/'+fields[2].value;
  71. }
  72. });
  73. });
  74. return mce_validator.form();
  75. },
  76. success: mce_success_cb
  77. };
  78. $('#mc-embedded-subscribe-form').ajaxForm(options);
  79.  
  80.  
  81. });
  82. function mce_success_cb(resp){
  83. $('#mce-success-response').hide();
  84. $('#mce-error-response').hide();
  85. if (resp.result=="success"){
  86. // redirect to facebook wall
  87. window.location.replace("http://www.facebook.com/pages/MyEnvironment-Inc/130823970271123");
  88. $('#mce-'+resp.result+'-response').show();
  89. $('#mce-'+resp.result+'-response').html(resp.msg + ' In the meantime click on the wall tab to join our discussions.');
  90. $('#mc-embedded-subscribe-form').each(function(){
  91. this.reset();
  92. });
  93. } else {
  94. var index = -1;
  95. var msg;
  96. try {
  97. var parts = resp.msg.split(' - ',2);
  98. if (parts[1]==undefined){
  99. msg = resp.msg;
  100. } else {
  101. i = parseInt(parts[0]);
  102. if (i.toString() == parts[0]){
  103. index = parts[0];
  104. msg = parts[1];
  105. } else {
  106. index = -1;
  107. msg = resp.msg;
  108. }
  109. }
  110. } catch(e){
  111. index = -1;
  112. msg = resp.msg;
  113. }
  114. try{
  115. if (index== -1){
  116. $('#mce-'+resp.result+'-response').show();
  117. $('#mce-'+resp.result+'-response').html(msg);
  118. } else {
  119. err_id = 'mce_tmp_error_msg';
  120. html = '<div id="'+err_id+'" style="'+err_style+'"> '+msg+'</div>';
  121.  
  122. var input_id = '#mc_embed_signup';
  123. var f = $(input_id);
  124. if (ftypes[index]=='address'){
  125. input_id = '#mce-'+fnames[index]+'-addr1';
  126. f = $(input_id).parent().parent().get(0);
  127. } else if (ftypes[index]=='date'){
  128. input_id = '#mce-'+fnames[index]+'-month';
  129. f = $(input_id).parent().parent().get(0);
  130. } else {
  131. input_id = '#mce-'+fnames[index];
  132. f = $().parent(input_id).get(0);
  133. }
  134. if (f){
  135. $(f).append(html);
  136. $(input_id).focus();
  137. } else {
  138. $('#mce-'+resp.result+'-response').show();
  139. $('#mce-'+resp.result+'-response').html(msg);
  140. }
  141. }
  142. } catch(e){
  143. $('#mce-'+resp.result+'-response').show();
  144. $('#mce-'+resp.result+'-response').html(msg);
  145. }
  146. }
  147. }
  148. </script>
  149. <!--End mc_embed_signup-->
  150. </div>
  151. </div>
  152. </body>
  153. </html>
Advertisement
Add Comment
Please, Sign In to add comment