Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array of addresses #69

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a79dd57
Create nodejs.yml
yasmanets Mar 31, 2020
d3fb40e
Update vCardFormatter.js
yasmanets Mar 31, 2020
43f0061
Merge pull request #1 from yasmanets/set_correct_encoding-1
yasmanets Mar 31, 2020
c4e05e3
multiple url for Android devices
yasmanets Mar 31, 2020
558b844
linter
yasmanets Apr 5, 2020
656ec19
Merge pull request #2 from yasmanets/url_multiple
yasmanets Apr 5, 2020
de130b0
Allows you to set custom URLs for ios devices
yasmanets Apr 5, 2020
f08c4fa
tests
yasmanets Apr 5, 2020
0d7faa5
Merge pull request #3 from yasmanets/label-ios-urls
yasmanets Apr 5, 2020
8ffc617
Update README.md
yasmanets Apr 5, 2020
a99c3da
Update README.md
yasmanets Apr 5, 2020
88192c9
Update README.md
yasmanets Apr 5, 2020
7e84a0e
new type of variables
yasmanets Apr 5, 2020
2b6dc65
new type of variables
yasmanets Apr 5, 2020
f91c335
Merge pull request #4 from yasmanets/newTypes
yasmanets Apr 5, 2020
8e1ce51
custom social profiles
yasmanets Apr 10, 2020
7b87cc0
update tests
yasmanets Apr 10, 2020
46396a2
Merge pull request #5 from yasmanets/custom-social-profiles
yasmanets Apr 10, 2020
7f198bd
var names
yasmanets Apr 10, 2020
38e92c1
formatter
yasmanets Apr 10, 2020
38a5d93
etiquetas
yasmanets Apr 10, 2020
da76ccd
outlook format
yasmanets Dec 2, 2020
44920ee
.
yasmanets Dec 2, 2020
20338da
Merge pull request #6 from yasmanets/outlookFormat
yasmanets Dec 2, 2020
86d3ea4
version updated
yasmanets Dec 2, 2020
a67589b
the web page must be the first url
yasmanets Dec 2, 2020
1002ed3
Merge pull request #7 from yasmanets/urlsOrder
yasmanets Dec 2, 2020
1acc0f2
versión updated
yasmanets Jan 16, 2021
99a2948
majorVersion conditional
yasmanets Jan 16, 2021
06ca0cb
more than one address can be added per type
yasmanets Jan 15, 2023
8a3540f
README updated
yasmanets Jan 15, 2023
551d09d
version
yasmanets Jan 15, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/
267 changes: 267 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
{
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended",
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017
},
"rules": {
"accessor-pairs": "error",
"array-bracket-newline": "off",
"array-bracket-spacing": "off",
"array-callback-return": "off",
"array-element-newline": "off",
"arrow-body-style": "off",
"arrow-parens": "off",
"arrow-spacing": "off",
"block-scoped-var": "off",
"block-spacing": "off",
"brace-style": "off",
"callback-return": "off",
"camelcase": "off",
"capitalized-comments": "off",
"class-methods-use-this": "error",
"comma-dangle": "off",
"comma-spacing": "off",
"comma-style": [
"error",
"last"
],
"complexity": "off",
"computed-property-spacing": [
"error",
"never"
],
"consistent-return": "off",
"consistent-this": "error",
"curly": "off",
"default-case": "off",
"dot-location": [
"error",
"property"
],
"dot-notation": [
"error",
{
"allowKeywords": true
}
],
"eol-last": "error",
"eqeqeq": "off",
"for-direction": "error",
"func-call-spacing": "off",
"func-name-matching": "error",
"func-names": "off",
"func-style": "off",
"function-paren-newline": "off",
"generator-star-spacing": "error",
"getter-return": "error",
"global-require": "off",
"guard-for-in": "off",
"handle-callback-err": "off",
"id-blacklist": "error",
"id-length": "off",
"id-match": "error",
"indent": [
"error",
4
],
"indent-legacy": "off",
"init-declarations": "off",
"jsx-quotes": "error",
"key-spacing": "off",
"keyword-spacing": "off",
"line-comment-position": "off",
"linebreak-style": [
"error",
"unix"
],
"lines-around-comment": "off",
"lines-around-directive": "off",
"lines-between-class-members": "error",
"max-depth": "off",
"max-len": "off",
"max-lines": "off",
"max-nested-callbacks": "error",
"max-params": "off",
"max-statements": "off",
"max-statements-per-line": "off",
"multiline-comment-style": "off",
"new-cap": "off",
"new-parens": "error",
"newline-after-var": "off",
"newline-before-return": "off",
"no-alert": "error",
"no-array-constructor": "error",
"no-await-in-loop": "off",
"no-bitwise": "off",
"no-buffer-constructor": "off",
"no-caller": "error",
"no-catch-shadow": "off",
"no-confusing-arrow": "off",
"no-continue": "off",
"no-console": "off",
"no-constant-condition": "off",
"no-div-regex": "error",
"no-duplicate-imports": "error",
"no-else-return": "off",
"no-empty": "off",
"no-empty-function": "off",
"no-eq-null": "error",
"no-eval": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-label": "error",
"no-extra-parens": "off",
"no-floating-decimal": "error",
"no-implicit-globals": "error",
"no-implied-eval": "error",
"no-inline-comments": "off",
"no-inner-declarations": [
"error",
"functions"
],
"no-invalid-this": "off",
"no-irregular-whitespace": "off",
"no-iterator": "error",
"no-label-var": "error",
"no-labels": "error",
"no-lone-blocks": "error",
"no-lonely-if": "off",
"no-loop-func": "off",
"no-magic-numbers": "off",
"no-mixed-operators": "off",
"no-mixed-requires": "error",
"no-multi-assign": "off",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": "off",
"no-native-reassign": "error",
"no-negated-condition": "off",
"no-negated-in-lhs": "error",
"no-nested-ternary": "off",
"no-new": "off",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-param-reassign": "off",
"no-path-concat": "off",
"no-plusplus": "off",
"no-process-env": "off",
"no-process-exit": "off",
"no-proto": "error",
"no-prototype-builtins": "off",
"no-restricted-globals": "error",
"no-restricted-imports": "error",
"no-restricted-modules": "error",
"no-restricted-properties": "error",
"no-restricted-syntax": "error",
"no-return-assign": [
"off",
"except-parens"
],
"no-return-await": "error",
"no-script-url": "error",
"no-self-compare": "off",
"no-sequences": "error",
"no-shadow": "off",
"no-shadow-restricted-names": "error",
"no-spaced-func": "off",
"no-sync": "off",
"no-tabs": "off",
"no-template-curly-in-string": "off",
"no-ternary": "off",
"no-throw-literal": "error",
"no-trailing-spaces": "off",
"no-undef": "error",
"no-undef-init": "error",
"no-undefined": "off",
"no-underscore-dangle": "off",
"no-unexpected-multiline": "off",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": "off",
"no-unused-expressions": "error",
"no-use-before-define": "off",
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-concat": "off",
"no-useless-constructor": "error",
"no-useless-escape": "off",
"no-useless-rename": "error",
"no-useless-return": "off",
"no-var": "off",
"no-void": "error",
"no-warning-comments": "off",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": "off",
"object-shorthand": "off",
"one-var": "off",
"one-var-declaration-per-line": "off",
"operator-assignment": "off",
"operator-linebreak": "error",
"padded-blocks": "off",
"padding-line-between-statements": "error",
"prefer-arrow-callback": "off",
"prefer-const": "off",
"prefer-destructuring": "off",
"prefer-numeric-literals": "error",
"prefer-promise-reject-errors": "error",
"prefer-reflect": "off",
"prefer-rest-params": "off",
"prefer-spread": "off",
"prefer-template": "off",
"quote-props": "off",
"quotes": "off",
"radix": "off",
"require-await": "error",
"require-jsdoc": "off",
"rest-spread-spacing": "error",
"semi": "off",
"semi-spacing": "off",
"semi-style": [
"error",
"last"
],
"sort-imports": "error",
"sort-keys": "off",
"sort-vars": "off",
"space-before-blocks": "off",
"space-before-function-paren": "off",
"space-in-parens": "off",
"space-infix-ops": "off",
"space-unary-ops": "off",
"spaced-comment": "off",
"strict": "off",
"switch-colon-spacing": [
"error",
{
"after": true,
"before": false
}
],
"symbol-description": "error",
"template-curly-spacing": [
"error",
"never"
],
"template-tag-spacing": "error",
"unicode-bom": [
"error",
"never"
],
"valid-jsdoc": "off",
"vars-on-top": "off",
"wrap-iife": "error",
"wrap-regex": "off",
"yield-star-spacing": "error"
}
}
30 changes: 30 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.15.0]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
env:
CI: true
59 changes: 45 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,19 +159,27 @@ vCard.logo.attachFromUrl('https://avatars2.githubusercontent.com/u/5659221?v=3&s
vCard.source = 'http://mywebpage/myvcard.vcf';

//set address information
vCard.homeAddress.label = 'Home Address';
vCard.homeAddress.street = '123 Main Street';
vCard.homeAddress.city = 'Chicago';
vCard.homeAddress.stateProvince = 'IL';
vCard.homeAddress.postalCode = '12345';
vCard.homeAddress.countryRegion = 'United States of America';

vCard.workAddress.label = 'Work Address';
vCard.workAddress.street = '123 Corporate Loop\nSuite 500';
vCard.workAddress.city = 'Los Angeles';
vCard.workAddress.stateProvince = 'CA';
vCard.workAddress.postalCode = '54321';
vCard.workAddress.countryRegion = 'United States of America';
vCard.homeAddress = [
{
label: 'Home Address',
street: '123 Main Street',
city: 'Chicago',
stateProvince: 'IL',
postalCode: '12345',
countryRegion: 'United States of America',
},
];

vCard.workAddress = [
{
label: 'Work Address',
street: '123 Corporate Loop\nSuite 500',
city: 'Los Angeles',
stateProvince: 'CA',
postalCode: '54321',
countryRegion: 'United States of America',
}
]

//set social media URLs
vCard.socialUrls['facebook'] = 'https://...';
Expand Down Expand Up @@ -231,6 +239,29 @@ You can mark as a contact as an organization with the following Apple AddressBoo
vCard.isOrganization = true;
```

### Custom url's for iOS devices

You can set custom url's for iOs devices initializing the properties `vCard.iosURL` and `vCard.label` as an empty array and putting in each position of the array a url and its label respectively. As in the following example:

```js
vCard.iosURL = [ ];
vCard.label = [ ];

testCard.iosURL.push('https://www.treeala.com');
testCard.iosURL.push('https://www.twitter.com/yasmaniaco');
testCard.iosURL.push('https://www.instagram.com/yasmanets');
testCard.iosURL.push('https://github.com/yasmanets');

testCard.label.push('Web page');
testCard.label.push('Twitter');
testCard.label.push('Instagram');
testCard.label.push('Github');`
```

You will get the following result:

![Captura de pantalla de 2020-04-05 17-50-06](https://user-images.githubusercontent.com/34303875/78503274-f2f89100-7765-11ea-8610-f96e1f4bfc36.png)

## React Native

A React Native version exists here at this repository --
Expand Down Expand Up @@ -261,4 +292,4 @@ Additional thanks to --
BTC 18N1g2o1b9u2jNPbSpGHhV6x5xs6Qou3EV

## License
Copyright (c) 2014-2019 Eric J Nesser MIT
Copyright (c) 2014-2019 Eric J Nesser MIT
Loading