Changeset 472817
- Timestamp:
- 12/09/2011 02:40:20 PM (14 years ago)
- Location:
- mailchimp-widget/trunk
- Files:
-
- 4 edited
-
js/mailchimp-widget-min.js (modified) (1 diff)
-
js/mailchimp-widget.js (modified) (3 diffs)
-
mailchimp-widget.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
mailchimp-widget/trunk/js/mailchimp-widget-min.js
r316529 r472817 1 (function(a){ jQuery.fn.ns_mc_widget=function(b){var e,c,d;e={url:"/",cookie_id:false,cookie_value:""};d=jQuery.extend(e,b);c=jQuery(this);c.submit(function(){var f;f=jQuery("<div></div>");f.css({"background-image":"url("+d.loader_graphic+")","background-position":"center center","background-repeat":"no-repeat",height:"100%",left:"0",position:"absolute",top:"0",width:"100%","z-index":"100"});c.css({height:"100%",position:"relative",width:"100%"});c.children().hide();c.append(f);jQuery.getJSON(d.url,c.serialize(),function(h,k){var j,g,i;if("success"===k){if(true===h.success){i=jQuery("<p>"+h.success_message+"</p>");i.hide();c.fadeTo(400,0,function(){c.html(i);i.show();c.fadeTo(400,1)});if(false!==d.cookie_id){j=new Date();j.setTime(j.getTime()+"3153600000");document.cookie=d.cookie_id+"="+d.cookie_value+"; expires="+j.toGMTString()+";"}}else{g=jQuery(".error",c);if(0===g.length){f.remove();c.children().show();g=jQuery('<div class="error"></div>');g.prependTo(c)}g.html(h.error)}}return false});return false})}}(jQuery));1 (function(a){a.fn.ns_mc_widget=function(b){var e,c,d;e={url:"/",cookie_id:false,cookie_value:""};d=jQuery.extend(e,b);c=a(this);c.submit(function(){var f;f=jQuery("<div></div>");f.css({"background-image":"url("+d.loader_graphic+")","background-position":"center center","background-repeat":"no-repeat",height:"100%",left:"0",position:"absolute",top:"0",width:"100%","z-index":"100"});c.css({height:"100%",position:"relative",width:"100%"});c.children().hide();c.append(f);a.getJSON(d.url,c.serialize(),function(h,k){var j,g,i;if("success"===k){if(true===h.success){i=jQuery("<p>"+h.success_message+"</p>");i.hide();c.fadeTo(400,0,function(){c.html(i);i.show();c.fadeTo(400,1)});if(false!==d.cookie_id){j=new Date();j.setTime(j.getTime()+"3153600000");document.cookie=d.cookie_id+"="+d.cookie_value+"; expires="+j.toGMTString()+";"}}else{g=jQuery(".error",c);if(0===g.length){f.remove();c.children().show();g=jQuery('<div class="error"></div>');g.prependTo(c)}else{f.remove();c.children().show()}g.html(h.error)}}return false});return false})}}(jQuery)); -
mailchimp-widget/trunk/js/mailchimp-widget.js
r316529 r472817 3 3 (function ($) { 4 4 5 jQuery.fn.ns_mc_widget = function (options) {5 $.fn.ns_mc_widget = function (options) { 6 6 7 7 var defaults, eL, opts; 8 9 8 defaults = { 10 11 9 'url' : '/', 12 10 'cookie_id' : false, 13 11 'cookie_value' : '' 14 15 12 }; 16 17 13 opts = jQuery.extend(defaults, options); 18 19 eL = jQuery(this); 20 14 eL = $(this); 21 15 eL.submit(function () { 22 16 23 17 var ajax_loader; 24 25 18 ajax_loader = jQuery('<div></div>'); 26 27 19 ajax_loader.css({ 28 29 20 'background-image' : 'url(' + opts.loader_graphic + ')', 30 21 'background-position' : 'center center', … … 36 27 'width' : '100%', 37 28 'z-index' : '100' 38 39 29 }); 40 30 41 31 eL.css({ 42 43 32 'height' : '100%', 44 33 'position' : 'relative', 45 34 'width' : '100%' 46 47 35 }); 48 36 49 37 eL.children().hide(); 50 51 38 eL.append(ajax_loader); 52 39 53 jQuery.getJSON(opts.url, eL.serialize(), function (data, textStatus) { 54 40 $.getJSON(opts.url, eL.serialize(), function (data, textStatus) { 55 41 var cookie_date, error_container, new_content; 56 57 42 if ('success' === textStatus) { 58 59 43 if (true === data.success) { 60 61 44 new_content = jQuery('<p>' + data.success_message + '</p>'); 62 63 45 new_content.hide(); 64 65 46 eL.fadeTo(400, 0, function () { 66 67 47 eL.html(new_content); 68 69 48 new_content.show(); 70 71 49 eL.fadeTo(400, 1); 72 50 … … 74 52 75 53 if (false !== opts.cookie_id) { 76 77 54 cookie_date = new Date(); 78 79 55 cookie_date.setTime(cookie_date.getTime() + '3153600000'); 80 81 56 document.cookie = opts.cookie_id + '=' + opts.cookie_value + '; expires=' + cookie_date.toGMTString() + ';'; 82 83 57 } 84 85 58 } else { 86 87 59 error_container = jQuery('.error', eL); 88 89 60 if (0 === error_container.length) { 90 91 61 ajax_loader.remove(); 92 93 62 eL.children().show(); 94 95 63 error_container = jQuery('<div class="error"></div>'); 96 97 64 error_container.prependTo(eL); 98 65 } else { 66 ajax_loader.remove(); 67 eL.children().show(); 99 68 } 100 101 69 error_container.html(data.error); 102 103 70 } 104 105 71 } 106 107 72 return false; 108 109 73 }); 110 111 74 return false; 112 113 75 }); 114 115 76 }; 116 117 77 }(jQuery)); -
mailchimp-widget/trunk/mailchimp-widget.php
r458542 r472817 5 5 Description: 6 6 Author: James Lafferty 7 Version: 0.8.1 17 Version: 0.8.12 8 8 Author URI: https://github.com/kalchas 9 9 License: GPL2 -
mailchimp-widget/trunk/readme.txt
r458542 r472817 41 41 42 42 == Changelog == 43 = 0.8.12 = 44 * Bugfix to account for multiple failed submissions. Also cleans up the mailchimp-widget.js file. Thank you to verify for pointing out the problem and its solution. 45 43 46 = 0.8.11 = 44 47 * Added Russian translation. Thank you to Игорь Клипач for contributing! … … 127 130 128 131 == Upgrade Notice == 132 = 0.8.12 = 133 * Bugfix to account for multiple failed submissions. Also cleans up the mailchimp-widget.js file. Thank you to verify for pointing out the problem and its solution. 134 129 135 = 0.8.11 = 130 136 * Added Russian translation. Thank you to Игорь Клипач for contributing!
Note: See TracChangeset
for help on using the changeset viewer.