web-manager 3.1.0 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/lib/account.js +14 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -286,6 +286,11 @@ For these, you must first call `.account().resolve()`
|
|
|
286
286
|
* `.auth-created-element`: Add to any element to show the local string for account creation date
|
|
287
287
|
* `.auth-phone-element`: Add to any element to display the user's phone
|
|
288
288
|
|
|
289
|
+
* `.auth-referral-count-element`: Update this element with the user's referral count
|
|
290
|
+
* `.auth-referral-code-element`: Update this element with the user's referral code
|
|
291
|
+
* `.auth-referral-link-element`: Update this element with the user's referral link
|
|
292
|
+
* `.auth-referral-social-link`: Update this element with the user's referral link for socials where `data-provider` is the social network
|
|
293
|
+
|
|
289
294
|
* Future additions (not added yet)
|
|
290
295
|
* `auth-link-provider-btn`: Initiate a link to the `data-provider` in this element
|
|
291
296
|
* `auth-unlink-provider-btn`: Initiate an unlink to the `data-provider` in this element
|
package/lib/account.js
CHANGED
|
@@ -245,7 +245,7 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
|
|
|
245
245
|
|
|
246
246
|
if (utilities.get(isDevelopment)) {
|
|
247
247
|
currentURL.searchParams
|
|
248
|
-
.forEach((value, key)
|
|
248
|
+
.forEach(function(value, key) {
|
|
249
249
|
var accountValue = utilities.get(account, key, undefined)
|
|
250
250
|
if (typeof accountValue !== undefined) {
|
|
251
251
|
if (value === 'true') { value = true }
|
|
@@ -256,7 +256,9 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
|
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
} catch (e) {
|
|
259
|
-
|
|
259
|
+
if (typeof window !== 'undefined') {
|
|
260
|
+
console.error('Unable to check query strings', e);
|
|
261
|
+
}
|
|
260
262
|
}
|
|
261
263
|
|
|
262
264
|
var planExpireDate = new Date(account.plan.expires.timestamp);
|
|
@@ -399,24 +401,26 @@ Account.prototype._resolveAccount = function (currentUser, account, options) {
|
|
|
399
401
|
$el.setAttribute('target', '_blank')
|
|
400
402
|
|
|
401
403
|
if (provider === 'facebook') {
|
|
402
|
-
$el.setAttribute('href',
|
|
404
|
+
$el.setAttribute('href', 'https://www.facebook.com/sharer.php?u=' + (affiliateLinkURI) + '')
|
|
403
405
|
} else if (provider === 'twitter') {
|
|
404
|
-
$el.setAttribute('href',
|
|
406
|
+
$el.setAttribute('href', 'https://twitter.com/share?url=' + (affiliateLinkURI) + '&text=' + (text || affiliateLinkTextURI) + '')
|
|
405
407
|
} else if (provider === 'pinterest') {
|
|
406
|
-
$el.setAttribute('href',
|
|
408
|
+
$el.setAttribute('href', 'https://pinterest.com/pin/create/button/?url=' + (affiliateLinkURI) + '&description=' + (text || affiliateLinkTextURI) + '')
|
|
407
409
|
} else if (provider === 'tumblr') {
|
|
408
|
-
$el.setAttribute('href',
|
|
410
|
+
$el.setAttribute('href', 'https://www.tumblr.com/share/link?url=' + (affiliateLinkURI) + '&text=' + (text || affiliateLinkTextURI) + '')
|
|
409
411
|
} else if (provider === 'linkedin') {
|
|
410
|
-
$el.setAttribute('href',
|
|
412
|
+
$el.setAttribute('href', 'https://www.linkedin.com/sharing/share-offsite/?url=' + (affiliateLinkURI) + '&title=' + (text || affiliateLinkTextURI) + '')
|
|
411
413
|
// $el.setAttribute('href', `http://www.linkedin.com/shareArticle?mini=true&url=https://stackoverflow.com/questions/10713542/how-to-make-custom-linkedin-share-button/10737122&title=How%20to%20make%20custom%20linkedin%20share%20button&summary=some%20summary%20if%20you%20want&source=stackoverflow.com`)
|
|
412
|
-
// $el.setAttribute('href', `http://www.linkedin.com/shareArticle?mini=false&url
|
|
414
|
+
// $el.setAttribute('href', `http://www.linkedin.com/shareArticle?mini=false&url=' + affiliateLinkURI + '&title=' + text || affiliateLinkTextURI + '`)
|
|
413
415
|
} else if (provider === 'reddit') {
|
|
414
|
-
$el.setAttribute('href',
|
|
416
|
+
$el.setAttribute('href', 'http://www.reddit.com/submit?url=' + (affiliateLinkURI) + '&title=' + (text || affiliateLinkTextURI) + '')
|
|
415
417
|
}
|
|
416
418
|
})
|
|
417
419
|
|
|
418
420
|
} catch (e) {
|
|
419
|
-
|
|
421
|
+
if (typeof window !== 'undefined') {
|
|
422
|
+
console.error('Unable to set DOM elements', e);
|
|
423
|
+
}
|
|
420
424
|
}
|
|
421
425
|
|
|
422
426
|
self.properties = account;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-manager",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Easily access important variables such as the query string, current domain, and current page in a single object.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -28,4 +28,4 @@
|
|
|
28
28
|
"firebase": "^8.10.1",
|
|
29
29
|
"lazysizes": "^5.3.2"
|
|
30
30
|
}
|
|
31
|
-
}
|
|
31
|
+
}
|