From 998ddfd54baa39835753185d95a5bbdac25fc065 Mon Sep 17 00:00:00 2001 From: or-else Date: Fri, 4 Aug 2017 14:47:18 +0300 Subject: [PATCH] changed new code for style and made it usable for other non-email tags --- index.html | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/index.html b/index.html index caf87972..8180d375 100644 --- a/index.html +++ b/index.html @@ -116,13 +116,12 @@ return card; } - // construct email params - function email(emailAddress) { - var tags = []; - if(emailAddress) { - tags.push("email:" + emailAddress); + // Construct a user discovery tag + function to_tag(tagname, value) { + if (tagname && value) { + return [tagname + ":" + value]; } - return tags + return undefined; } /* BEGIN Popup/dropdown menu */ @@ -694,7 +693,7 @@ this.state.password.trim(), vcard(this.state.fn, this.state.imageDataUrl), null, - email(this.state.email)); + to_tag("email", this.state.email)); } }, render: function() {