@@ -5,3 +5,3 @@ { | ||
"description": "Ajaxify your mailchimp form.", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "./jquery.ajaxchimp.js", | ||
@@ -34,2 +34,2 @@ "author": { | ||
"ignore": [] | ||
} | ||
} |
{ | ||
"name": "ajaxchimp", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "./jquery.ajaxchimp.js", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
# ajaxChimp Changelog | ||
### 1.3.0 - 8/May/2014 | ||
- Transalations for success message now work | ||
- Language file: German (updated) - [Cube42](https://github.com/Cube42) | ||
### 1.2.0 - 1/Mar/2014 | ||
@@ -4,0 +9,0 @@ |
@@ -9,16 +9,17 @@ /*! | ||
$('#form_id').ajaxchimp(options); | ||
- Form should have one <input> element with attribute 'type=email' | ||
- Form should have one label element with attribute 'for=email_input_id' (used to display error/success message) | ||
- All options are optional. | ||
Options: | ||
======= | ||
options = { | ||
language: 'en', | ||
callback: callbackFunction, | ||
url: 'http://blahblah.us1.list-manage.com/subscribe/post?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f', | ||
url: 'http://blahblah.us1.list-manage.com/subscribe/post?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f' | ||
} | ||
Notes: | ||
===== | ||
===== | ||
To get the mailchimp JSONP url (undocumented), change 'post?' to 'post-json?' and add '&c=?' to the end. | ||
@@ -46,3 +47,2 @@ For e.g. 'http://blahblah.us1.list-manage.com/subscribe/post-json?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f&c=?', | ||
} | ||
}; | ||
@@ -67,2 +67,3 @@ | ||
form.submit(function () { | ||
var msg; | ||
function successCallback(resp) { | ||
@@ -77,3 +78,2 @@ if (resp.result === 'success') { | ||
var index = -1; | ||
var msg; | ||
try { | ||
@@ -102,4 +102,4 @@ var parts = resp.msg.split(' - ', 2); | ||
if ( | ||
settings.language !== 'en' | ||
&& $.ajaxChimp.responses[msg] | ||
settings.language !== 'en' | ||
&& $.ajaxChimp.responses[msg] !== undefined | ||
&& $.ajaxChimp.translations | ||
@@ -137,3 +137,3 @@ && $.ajaxChimp.translations[settings.language] | ||
var submitMsg = 'Submitting...'; | ||
if( | ||
if( | ||
settings.language !== 'en' | ||
@@ -143,3 +143,3 @@ && $.ajaxChimp.translations | ||
&& $.ajaxChimp.translations[settings.language]['submit'] | ||
) { | ||
) { | ||
submitMsg = $.ajaxChimp.translations[settings.language]['submit']; | ||
@@ -146,0 +146,0 @@ } |
@@ -28,14 +28,15 @@ (function ($) { | ||
}, | ||
// Translation via https://github.com/Cube42 | ||
'de': { | ||
'submit': 'Senden...', | ||
0: 'Wir haben Ihnen eine Bestätigungs-E-Mail geschickt', | ||
1: 'Bitte geben Sie Ihre E-Mail-Adresse ein', | ||
2: 'Eine E-Mail-Adresse muss ein @ enthalten', | ||
3: 'Der Domain-Teil der E-Mail-Adresse ist ungültig (der Teil nach dem @)', | ||
4: 'Der Benutzername der E-Mail-Adresse ist ungültig (der Teil vor dem @)', | ||
5: 'Diese E-Mail-Adresse scheint gefälscht oder ungültig zu sein. Bitte geben Sie eine echte E-Mail-Adresse an!' | ||
}, | ||
// The translations below are from google translate, and may not be accurate. | ||
// Pull requests with translations for other languages as well as corrections are welcome. | ||
'de': { | ||
'submit': 'Aufnahme läuft...', | ||
0: 'Wir haben Ihnen eine Bestätigungs-E-Mail verschickt', | ||
1: 'Bitte geben Sie einen Wert', | ||
2: 'Eine E-Mail-Adresse muss ein einzelnes enthalten @', | ||
3: 'Der Domänenteil der E-Mail-Adresse ist ungültig (der Teil nach dem @:)', | ||
4: 'Der Benutzername Teil der E-Mail-Adresse ist ungültig (der Teil vor dem @:)', | ||
5: 'Diese E-Mail-Adresse sieht gefälscht oder ungültig. Bitte geben Sie eine echte E-Mail-Adresse' | ||
}, | ||
'es': { | ||
@@ -42,0 +43,0 @@ 'submit': 'Grabación en curso...', |
@@ -1,1 +0,1 @@ | ||
(function($){"use strict";$.ajaxChimp.translations={it:{submit:"Registrazione in corso...",0:"Ti abbiamo inviato una mail di conferma",1:"Per favore inserisci una mail",2:"Un indirizzo valido contiene una sola @",3:"Il dominio della tua mail non è valido (la porzione dopo la @: )",4:"Il nome della mail non è valido (la porzione prima della @: )",5:"L'indirizzo email sembra finto o non valido: per favore inseriscine uno reale"},de:{submit:"Aufnahme läuft...",0:"Wir haben Ihnen eine Bestätigungs-E-Mail verschickt",1:"Bitte geben Sie einen Wert",2:"Eine E-Mail-Adresse muss ein einzelnes enthalten @",3:"Der Domänenteil der E-Mail-Adresse ist ungültig (der Teil nach dem @:)",4:"Der Benutzername Teil der E-Mail-Adresse ist ungültig (der Teil vor dem @:)",5:"Diese E-Mail-Adresse sieht gefälscht oder ungültig. Bitte geben Sie eine echte E-Mail-Adresse"},es:{submit:"Grabación en curso...",0:"Te hemos enviado un email de confirmación",1:"Por favor, introduzca un valor",2:"Una dirección de correo electrónico debe contener una sola @",3:"La parte de dominio de la dirección de correo electrónico no es válida (la parte después de la @:)",4:"La parte de usuario de la dirección de correo electrónico no es válida (la parte antes de la @:)",5:"Esta dirección de correo electrónico se ve falso o no válido. Por favor, introduce una dirección de correo electrónico real"},fr:{submit:"Enregistrement en cours...",0:"Nous vous avons envoyé un e-mail de confirmation",1:"S'il vous plaît entrer une valeur",2:"Une adresse e-mail doit contenir un seul @",3:"La partie domaine de l'adresse e-mail n'est pas valide (la partie après le @:)",4:"La partie nom d'utilisateur de l'adresse email n'est pas valide (la partie avant le signe @:)",5:"Cette adresse e-mail semble faux ou non valides. S'il vous plaît entrer une adresse email valide"}}})(jQuery); | ||
(function($){"use strict";$.ajaxChimp.translations={it:{submit:"Registrazione in corso...",0:"Ti abbiamo inviato una mail di conferma",1:"Per favore inserisci una mail",2:"Un indirizzo valido contiene una sola @",3:"Il dominio della tua mail non è valido (la porzione dopo la @: )",4:"Il nome della mail non è valido (la porzione prima della @: )",5:"L'indirizzo email sembra finto o non valido: per favore inseriscine uno reale"},de:{submit:"Senden...",0:"Wir haben Ihnen eine Bestätigungs-E-Mail geschickt",1:"Bitte geben Sie Ihre E-Mail-Adresse ein",2:"Eine E-Mail-Adresse muss ein @ enthalten",3:"Der Domain-Teil der E-Mail-Adresse ist ungültig (der Teil nach dem @)",4:"Der Benutzername der E-Mail-Adresse ist ungültig (der Teil vor dem @)",5:"Diese E-Mail-Adresse scheint gefälscht oder ungültig zu sein. Bitte geben Sie eine echte E-Mail-Adresse an!"},es:{submit:"Grabación en curso...",0:"Te hemos enviado un email de confirmación",1:"Por favor, introduzca un valor",2:"Una dirección de correo electrónico debe contener una sola @",3:"La parte de dominio de la dirección de correo electrónico no es válida (la parte después de la @:)",4:"La parte de usuario de la dirección de correo electrónico no es válida (la parte antes de la @:)",5:"Esta dirección de correo electrónico se ve falso o no válido. Por favor, introduce una dirección de correo electrónico real"},fr:{submit:"Enregistrement en cours...",0:"Nous vous avons envoyé un e-mail de confirmation",1:"S'il vous plaît entrer une valeur",2:"Une adresse e-mail doit contenir un seul @",3:"La partie domaine de l'adresse e-mail n'est pas valide (la partie après le @:)",4:"La partie nom d'utilisateur de l'adresse email n'est pas valide (la partie avant le signe @:)",5:"Cette adresse e-mail semble faux ou non valides. S'il vous plaît entrer une adresse email valide"}}})(jQuery); |
@@ -1,1 +0,1 @@ | ||
(function($){"use strict";$.ajaxChimp={responses:{"We have sent you a confirmation email":0,"Please enter a value":1,"An email address must contain a single @":2,"The domain portion of the email address is invalid (the portion after the @: )":3,"The username portion of the email address is invalid (the portion before the @: )":4,"This email address looks fake or invalid. Please enter a real email address":5},translations:{en:null},init:function(selector,options){$(selector).ajaxChimp(options)}};$.fn.ajaxChimp=function(options){$(this).each(function(i,elem){var form=$(elem);var email=form.find("input[type=email]");var label=form.find("label[for="+email.attr("id")+"]");var settings=$.extend({url:form.attr("action"),language:"en"},options);var url=settings.url.replace("/post?","/post-json?").concat("&c=?");form.attr("novalidate","true");email.attr("name","EMAIL");form.submit(function(){function successCallback(resp){if(resp.result==="success"){msg="We have sent you a confirmation email";label.removeClass("error").addClass("valid");email.removeClass("error").addClass("valid")}else{email.removeClass("valid").addClass("error");label.removeClass("valid").addClass("error");var index=-1;var msg;try{var parts=resp.msg.split(" - ",2);if(parts[1]===undefined){msg=resp.msg}else{var i=parseInt(parts[0],10);if(i.toString()===parts[0]){index=parts[0];msg=parts[1]}else{index=-1;msg=resp.msg}}}catch(e){index=-1;msg=resp.msg}}if(settings.language!=="en"&&$.ajaxChimp.responses[msg]&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]){msg=$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]}label.html(msg);label.show(2e3);if(settings.callback){settings.callback(resp)}}var data={};var dataArray=form.serializeArray();$.each(dataArray,function(index,item){data[item.name]=item.value});$.ajax({url:url,data:data,success:successCallback,dataType:"jsonp",error:function(resp,text){console.log("mailchimp ajax submit error: "+text)}});var submitMsg="Submitting...";if(settings.language!=="en"&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language]["submit"]){submitMsg=$.ajaxChimp.translations[settings.language]["submit"]}label.html(submitMsg).show(2e3);return false})});return this}})(jQuery); | ||
(function($){"use strict";$.ajaxChimp={responses:{"We have sent you a confirmation email":0,"Please enter a value":1,"An email address must contain a single @":2,"The domain portion of the email address is invalid (the portion after the @: )":3,"The username portion of the email address is invalid (the portion before the @: )":4,"This email address looks fake or invalid. Please enter a real email address":5},translations:{en:null},init:function(selector,options){$(selector).ajaxChimp(options)}};$.fn.ajaxChimp=function(options){$(this).each(function(i,elem){var form=$(elem);var email=form.find("input[type=email]");var label=form.find("label[for="+email.attr("id")+"]");var settings=$.extend({url:form.attr("action"),language:"en"},options);var url=settings.url.replace("/post?","/post-json?").concat("&c=?");form.attr("novalidate","true");email.attr("name","EMAIL");form.submit(function(){var msg;function successCallback(resp){if(resp.result==="success"){msg="We have sent you a confirmation email";label.removeClass("error").addClass("valid");email.removeClass("error").addClass("valid")}else{email.removeClass("valid").addClass("error");label.removeClass("valid").addClass("error");var index=-1;try{var parts=resp.msg.split(" - ",2);if(parts[1]===undefined){msg=resp.msg}else{var i=parseInt(parts[0],10);if(i.toString()===parts[0]){index=parts[0];msg=parts[1]}else{index=-1;msg=resp.msg}}}catch(e){index=-1;msg=resp.msg}}if(settings.language!=="en"&&$.ajaxChimp.responses[msg]!==undefined&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]){msg=$.ajaxChimp.translations[settings.language][$.ajaxChimp.responses[msg]]}label.html(msg);label.show(2e3);if(settings.callback){settings.callback(resp)}}var data={};var dataArray=form.serializeArray();$.each(dataArray,function(index,item){data[item.name]=item.value});$.ajax({url:url,data:data,success:successCallback,dataType:"jsonp",error:function(resp,text){console.log("mailchimp ajax submit error: "+text)}});var submitMsg="Submitting...";if(settings.language!=="en"&&$.ajaxChimp.translations&&$.ajaxChimp.translations[settings.language]&&$.ajaxChimp.translations[settings.language]["submit"]){submitMsg=$.ajaxChimp.translations[settings.language]["submit"]}label.html(submitMsg).show(2e3);return false})});return this}})(jQuery); |
@@ -5,3 +5,3 @@ { | ||
"description": "ajaxchimp", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"main": "./jquery.ajaxchimp.js", | ||
@@ -22,5 +22,10 @@ "homepage": "https://github.com/scdoshi/jquery-ajaxchimp", | ||
"_id": "ajaxchimp@1.2.0", | ||
"_from": "ajaxchimp@latest", | ||
"_from": "ajaxchimp@", | ||
"readme": "# ajaxchimp", | ||
"readmeFilename": "README.md" | ||
} | ||
"readmeFilename": "README.md", | ||
"bugs": { | ||
"url": "https://github.com/scdoshi/jquery-ajaxchimp/issues" | ||
}, | ||
"_shasum": "51dcb6cf671eb41f98ca215d710264952d985286", | ||
"_resolved": "https://registry.npmjs.org/ajaxchimp/-/ajaxchimp-1.2.0.tgz" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
20613
2.15%231
1.32%2
-33.33%1
Infinity%