luv-assets 1.0.2 → 1.0.4
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/dist/css/style.css +1 -1
- package/dist/js/dropload.js +313 -0
- package/dist/js/dropload.min.js +2 -0
- package/dist/js/js.js +552 -0
- package/dist/js/sharer.js +483 -0
- package/dist/js/sharer.min.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @preserve
|
|
3
|
+
* Sharer.js
|
|
4
|
+
*
|
|
5
|
+
* @description Create your own social share buttons
|
|
6
|
+
* @version 0.5.1
|
|
7
|
+
* @author Ellison Leao <ellisonleao@gmail.com>
|
|
8
|
+
* @license MIT
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
(function(window, document) {
|
|
13
|
+
'use strict';
|
|
14
|
+
/**
|
|
15
|
+
* @constructor
|
|
16
|
+
*/
|
|
17
|
+
var Sharer = function(elem) {
|
|
18
|
+
this.elem = elem;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @function init
|
|
23
|
+
* @description bind the events for multiple sharer elements
|
|
24
|
+
* @returns {Empty}
|
|
25
|
+
*/
|
|
26
|
+
Sharer.init = function() {
|
|
27
|
+
var elems = document.querySelectorAll('[data-sharer]'),
|
|
28
|
+
i,
|
|
29
|
+
l = elems.length;
|
|
30
|
+
|
|
31
|
+
for (i = 0; i < l; i++) {
|
|
32
|
+
elems[i].addEventListener('click', Sharer.add);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @function add
|
|
38
|
+
* @description bind the share event for a single dom element
|
|
39
|
+
* @returns {Empty}
|
|
40
|
+
*/
|
|
41
|
+
Sharer.add = function(elem) {
|
|
42
|
+
var target = elem.currentTarget || elem.srcElement;
|
|
43
|
+
var sharer = new Sharer(target);
|
|
44
|
+
sharer.share();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// instance methods
|
|
48
|
+
Sharer.prototype = {
|
|
49
|
+
constructor: Sharer,
|
|
50
|
+
/**
|
|
51
|
+
* @function getValue
|
|
52
|
+
* @description Helper to get the attribute of a DOM element
|
|
53
|
+
* @param {String} attr DOM element attribute
|
|
54
|
+
* @returns {String|Empty} returns the attr value or empty string
|
|
55
|
+
*/
|
|
56
|
+
getValue: function(attr) {
|
|
57
|
+
var val = this.elem.getAttribute('data-' + attr);
|
|
58
|
+
// handing facebook hashtag attribute
|
|
59
|
+
if (val && attr === 'hashtag') {
|
|
60
|
+
if (!val.startsWith('#')) {
|
|
61
|
+
val = '#' + val;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return val === null ? '' : val;
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @event share
|
|
69
|
+
* @description Main share event. Will pop a window or redirect to a link
|
|
70
|
+
* based on the data-sharer attribute.
|
|
71
|
+
*/
|
|
72
|
+
share: function() {
|
|
73
|
+
var sharer = this.getValue('sharer').toLowerCase(),
|
|
74
|
+
sharers = {
|
|
75
|
+
facebook: {
|
|
76
|
+
shareUrl: 'https://www.facebook.com/sharer/sharer.php',
|
|
77
|
+
params: {
|
|
78
|
+
u: this.getValue('url'),
|
|
79
|
+
hashtag: this.getValue('hashtag'),
|
|
80
|
+
quote: this.getValue('quote'),
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
linkedin: {
|
|
84
|
+
shareUrl: 'https://www.linkedin.com/shareArticle',
|
|
85
|
+
params: {
|
|
86
|
+
url: this.getValue('url'),
|
|
87
|
+
mini: true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
twitter: {
|
|
91
|
+
shareUrl: 'https://twitter.com/intent/tweet',
|
|
92
|
+
params: {
|
|
93
|
+
text: this.getValue('title'),
|
|
94
|
+
url: this.getValue('url'),
|
|
95
|
+
hashtags: this.getValue('hashtags'),
|
|
96
|
+
via: this.getValue('via'),
|
|
97
|
+
related: this.getValue('related'),
|
|
98
|
+
in_reply_to: this.getValue('in_reply_to')
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
email: {
|
|
102
|
+
shareUrl: 'mailto:' + this.getValue('to'),
|
|
103
|
+
params: {
|
|
104
|
+
subject: this.getValue('subject'),
|
|
105
|
+
body: this.getValue('title') + '\n' + this.getValue('url'),
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
whatsapp: {
|
|
109
|
+
shareUrl: this.getValue('web') === 'true' ? 'https://web.whatsapp.com/send' : 'https://wa.me/',
|
|
110
|
+
params: {
|
|
111
|
+
phone: this.getValue('to'),
|
|
112
|
+
text: this.getValue('title') + ' ' + this.getValue('url'),
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
telegram: {
|
|
116
|
+
shareUrl: 'https://t.me/share',
|
|
117
|
+
params: {
|
|
118
|
+
text: this.getValue('title'),
|
|
119
|
+
url: this.getValue('url'),
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
viber: {
|
|
123
|
+
shareUrl: 'viber://forward',
|
|
124
|
+
params: {
|
|
125
|
+
text: this.getValue('title') + ' ' + this.getValue('url'),
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
line: {
|
|
129
|
+
shareUrl:
|
|
130
|
+
'http://line.me/R/msg/text/?' + encodeURIComponent(this.getValue('title') + ' ' + this.getValue('url')),
|
|
131
|
+
},
|
|
132
|
+
pinterest: {
|
|
133
|
+
shareUrl: 'https://www.pinterest.com/pin/create/button/',
|
|
134
|
+
params: {
|
|
135
|
+
url: this.getValue('url'),
|
|
136
|
+
media: this.getValue('image'),
|
|
137
|
+
description: this.getValue('description'),
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
tumblr: {
|
|
141
|
+
shareUrl: 'http://tumblr.com/widgets/share/tool',
|
|
142
|
+
params: {
|
|
143
|
+
canonicalUrl: this.getValue('url'),
|
|
144
|
+
content: this.getValue('url'),
|
|
145
|
+
posttype: 'link',
|
|
146
|
+
title: this.getValue('title'),
|
|
147
|
+
caption: this.getValue('caption'),
|
|
148
|
+
tags: this.getValue('tags'),
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
hackernews: {
|
|
152
|
+
shareUrl: 'https://news.ycombinator.com/submitlink',
|
|
153
|
+
params: {
|
|
154
|
+
u: this.getValue('url'),
|
|
155
|
+
t: this.getValue('title'),
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
reddit: {
|
|
159
|
+
shareUrl: 'https://www.reddit.com/submit',
|
|
160
|
+
params: { url: this.getValue('url'), title: this.getValue('title') },
|
|
161
|
+
},
|
|
162
|
+
vk: {
|
|
163
|
+
shareUrl: 'http://vk.com/share.php',
|
|
164
|
+
params: {
|
|
165
|
+
url: this.getValue('url'),
|
|
166
|
+
title: this.getValue('title'),
|
|
167
|
+
description: this.getValue('caption'),
|
|
168
|
+
image: this.getValue('image'),
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
xing: {
|
|
172
|
+
shareUrl: 'https://www.xing.com/social/share/spi',
|
|
173
|
+
params: {
|
|
174
|
+
url: this.getValue('url'),
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
buffer: {
|
|
178
|
+
shareUrl: 'https://buffer.com/add',
|
|
179
|
+
params: {
|
|
180
|
+
url: this.getValue('url'),
|
|
181
|
+
title: this.getValue('title'),
|
|
182
|
+
via: this.getValue('via'),
|
|
183
|
+
picture: this.getValue('picture'),
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
instapaper: {
|
|
187
|
+
shareUrl: 'http://www.instapaper.com/edit',
|
|
188
|
+
params: {
|
|
189
|
+
url: this.getValue('url'),
|
|
190
|
+
title: this.getValue('title'),
|
|
191
|
+
description: this.getValue('description'),
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
pocket: {
|
|
195
|
+
shareUrl: 'https://getpocket.com/save',
|
|
196
|
+
params: {
|
|
197
|
+
url: this.getValue('url'),
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
|
+
mashable: {
|
|
201
|
+
shareUrl: 'https://mashable.com/submit',
|
|
202
|
+
params: {
|
|
203
|
+
url: this.getValue('url'),
|
|
204
|
+
title: this.getValue('title'),
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
mix: {
|
|
208
|
+
shareUrl: 'https://mix.com/add',
|
|
209
|
+
params: {
|
|
210
|
+
url: this.getValue('url'),
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
flipboard: {
|
|
214
|
+
shareUrl: 'https://share.flipboard.com/bookmarklet/popout',
|
|
215
|
+
params: {
|
|
216
|
+
v: 2,
|
|
217
|
+
title: this.getValue('title'),
|
|
218
|
+
url: this.getValue('url'),
|
|
219
|
+
t: Date.now(),
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
weibo: {
|
|
223
|
+
shareUrl: 'http://service.weibo.com/share/share.php',
|
|
224
|
+
params: {
|
|
225
|
+
url: this.getValue('url'),
|
|
226
|
+
title: this.getValue('title'),
|
|
227
|
+
pic: this.getValue('image'),
|
|
228
|
+
appkey: this.getValue('appkey'),
|
|
229
|
+
ralateUid: this.getValue('ralateuid'),
|
|
230
|
+
language: 'zh_cn',
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
blogger: {
|
|
234
|
+
shareUrl: 'https://www.blogger.com/blog-this.g',
|
|
235
|
+
params: {
|
|
236
|
+
u: this.getValue('url'),
|
|
237
|
+
n: this.getValue('title'),
|
|
238
|
+
t: this.getValue('description'),
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
baidu: {
|
|
242
|
+
shareUrl: 'http://cang.baidu.com/do/add',
|
|
243
|
+
params: {
|
|
244
|
+
it: this.getValue('title'),
|
|
245
|
+
iu: this.getValue('url'),
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
douban: {
|
|
249
|
+
shareUrl: 'https://www.douban.com/share/service',
|
|
250
|
+
params: {
|
|
251
|
+
name: this.getValue('name'),
|
|
252
|
+
href: this.getValue('url'),
|
|
253
|
+
image: this.getValue('image'),
|
|
254
|
+
comment: this.getValue('description'),
|
|
255
|
+
},
|
|
256
|
+
},
|
|
257
|
+
okru: {
|
|
258
|
+
shareUrl: 'https://connect.ok.ru/dk',
|
|
259
|
+
params: {
|
|
260
|
+
'st.cmd': 'WidgetSharePreview',
|
|
261
|
+
'st.shareUrl': this.getValue('url'),
|
|
262
|
+
title: this.getValue('title'),
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
mailru: {
|
|
266
|
+
shareUrl: 'http://connect.mail.ru/share',
|
|
267
|
+
params: {
|
|
268
|
+
share_url: this.getValue('url'),
|
|
269
|
+
linkname: this.getValue('title'),
|
|
270
|
+
linknote: this.getValue('description'),
|
|
271
|
+
type: 'page',
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
evernote: {
|
|
275
|
+
shareUrl: 'https://www.evernote.com/clip.action',
|
|
276
|
+
params: {
|
|
277
|
+
url: this.getValue('url'),
|
|
278
|
+
title: this.getValue('title'),
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
skype: {
|
|
282
|
+
shareUrl: 'https://web.skype.com/share',
|
|
283
|
+
params: {
|
|
284
|
+
url: this.getValue('url'),
|
|
285
|
+
title: this.getValue('title'),
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
delicious: {
|
|
289
|
+
shareUrl: 'https://del.icio.us/post',
|
|
290
|
+
params: {
|
|
291
|
+
url: this.getValue('url'),
|
|
292
|
+
title: this.getValue('title'),
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
sms: {
|
|
296
|
+
shareUrl: 'sms://',
|
|
297
|
+
params: {
|
|
298
|
+
body: this.getValue('body'),
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
trello: {
|
|
302
|
+
shareUrl: 'https://trello.com/add-card',
|
|
303
|
+
params: {
|
|
304
|
+
url: this.getValue('url'),
|
|
305
|
+
name: this.getValue('title'),
|
|
306
|
+
desc: this.getValue('description'),
|
|
307
|
+
mode: 'popup',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
messenger: {
|
|
311
|
+
shareUrl: 'fb-messenger://share',
|
|
312
|
+
params: {
|
|
313
|
+
link: this.getValue('url'),
|
|
314
|
+
},
|
|
315
|
+
},
|
|
316
|
+
odnoklassniki: {
|
|
317
|
+
shareUrl: 'https://connect.ok.ru/dk',
|
|
318
|
+
params: {
|
|
319
|
+
st: {
|
|
320
|
+
cmd: 'WidgetSharePreview',
|
|
321
|
+
deprecated: 1,
|
|
322
|
+
shareUrl: this.getValue('url'),
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
meneame: {
|
|
327
|
+
shareUrl: 'https://www.meneame.net/submit',
|
|
328
|
+
params: {
|
|
329
|
+
url: this.getValue('url'),
|
|
330
|
+
},
|
|
331
|
+
},
|
|
332
|
+
diaspora: {
|
|
333
|
+
shareUrl: 'https://share.diasporafoundation.org',
|
|
334
|
+
params: {
|
|
335
|
+
title: this.getValue('title'),
|
|
336
|
+
url: this.getValue('url'),
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
googlebookmarks: {
|
|
340
|
+
shareUrl: 'https://www.google.com/bookmarks/mark',
|
|
341
|
+
params: {
|
|
342
|
+
op: 'edit',
|
|
343
|
+
bkmk: this.getValue('url'),
|
|
344
|
+
title: this.getValue('title'),
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
qzone: {
|
|
348
|
+
shareUrl: 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey',
|
|
349
|
+
params: {
|
|
350
|
+
url: this.getValue('url'),
|
|
351
|
+
},
|
|
352
|
+
},
|
|
353
|
+
refind: {
|
|
354
|
+
shareUrl: 'https://refind.com',
|
|
355
|
+
params: {
|
|
356
|
+
url: this.getValue('url'),
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
surfingbird: {
|
|
360
|
+
shareUrl: 'https://surfingbird.ru/share',
|
|
361
|
+
params: {
|
|
362
|
+
url: this.getValue('url'),
|
|
363
|
+
title: this.getValue('title'),
|
|
364
|
+
description: this.getValue('description'),
|
|
365
|
+
},
|
|
366
|
+
},
|
|
367
|
+
yahoomail: {
|
|
368
|
+
shareUrl: 'http://compose.mail.yahoo.com',
|
|
369
|
+
params: {
|
|
370
|
+
to: this.getValue('to'),
|
|
371
|
+
subject: this.getValue('subject'),
|
|
372
|
+
body: this.getValue('body'),
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
wordpress: {
|
|
376
|
+
shareUrl: 'https://wordpress.com/wp-admin/press-this.php',
|
|
377
|
+
params: {
|
|
378
|
+
u: this.getValue('url'),
|
|
379
|
+
t: this.getValue('title'),
|
|
380
|
+
s: this.getValue('title'),
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
amazon: {
|
|
384
|
+
shareUrl: 'https://www.amazon.com/gp/wishlist/static-add',
|
|
385
|
+
params: {
|
|
386
|
+
u: this.getValue('url'),
|
|
387
|
+
t: this.getValue('title'),
|
|
388
|
+
},
|
|
389
|
+
},
|
|
390
|
+
pinboard: {
|
|
391
|
+
shareUrl: 'https://pinboard.in/add',
|
|
392
|
+
params: {
|
|
393
|
+
url: this.getValue('url'),
|
|
394
|
+
title: this.getValue('title'),
|
|
395
|
+
description: this.getValue('description'),
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
threema: {
|
|
399
|
+
shareUrl: 'threema://compose',
|
|
400
|
+
params: {
|
|
401
|
+
text: this.getValue('text'),
|
|
402
|
+
id: this.getValue('id'),
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
kakaostory: {
|
|
406
|
+
shareUrl: 'https://story.kakao.com/share',
|
|
407
|
+
params: {
|
|
408
|
+
url: this.getValue('url'),
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
yummly: {
|
|
412
|
+
shareUrl: 'http://www.yummly.com/urb/verify',
|
|
413
|
+
params: {
|
|
414
|
+
url: this.getValue('url'),
|
|
415
|
+
title: this.getValue('title'),
|
|
416
|
+
yumtype: 'button',
|
|
417
|
+
},
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
s = sharers[sharer];
|
|
421
|
+
|
|
422
|
+
// custom popups sizes
|
|
423
|
+
if (s) {
|
|
424
|
+
s.width = this.getValue('width');
|
|
425
|
+
s.height = this.getValue('height');
|
|
426
|
+
}
|
|
427
|
+
return s !== undefined ? this.urlSharer(s) : false;
|
|
428
|
+
},
|
|
429
|
+
/**
|
|
430
|
+
* @event urlSharer
|
|
431
|
+
* @param {Object} sharer
|
|
432
|
+
*/
|
|
433
|
+
urlSharer: function(sharer) {
|
|
434
|
+
var p = sharer.params || {},
|
|
435
|
+
keys = Object.keys(p),
|
|
436
|
+
i,
|
|
437
|
+
str = keys.length > 0 ? '?' : '';
|
|
438
|
+
for (i = 0; i < keys.length; i++) {
|
|
439
|
+
if (str !== '?') {
|
|
440
|
+
str += '&';
|
|
441
|
+
}
|
|
442
|
+
if (p[keys[i]]) {
|
|
443
|
+
str += keys[i] + '=' + encodeURIComponent(p[keys[i]]);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
sharer.shareUrl += str;
|
|
447
|
+
|
|
448
|
+
var isLink = this.getValue('link') === 'true';
|
|
449
|
+
var isBlank = this.getValue('blank') === 'true';
|
|
450
|
+
|
|
451
|
+
if (isLink) {
|
|
452
|
+
if (isBlank) {
|
|
453
|
+
window.open(sharer.shareUrl, '_blank');
|
|
454
|
+
} else {
|
|
455
|
+
window.location.href = sharer.shareUrl;
|
|
456
|
+
}
|
|
457
|
+
} else {
|
|
458
|
+
console.log(sharer.shareUrl);
|
|
459
|
+
// defaults to popup if no data-link is provided
|
|
460
|
+
var popWidth = sharer.width || 600,
|
|
461
|
+
popHeight = sharer.height || 480,
|
|
462
|
+
left = window.innerWidth / 2 - popWidth / 2 + window.screenX,
|
|
463
|
+
top = window.innerHeight / 2 - popHeight / 2 + window.screenY,
|
|
464
|
+
popParams = 'scrollbars=no, width=' + popWidth + ', height=' + popHeight + ', top=' + top + ', left=' + left,
|
|
465
|
+
newWindow = window.open(sharer.shareUrl, '', popParams);
|
|
466
|
+
|
|
467
|
+
if (window.focus) {
|
|
468
|
+
newWindow.focus();
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
};
|
|
473
|
+
|
|
474
|
+
// adding sharer events on domcontentload
|
|
475
|
+
if (document.readyState === 'complete' || document.readyState !== 'loading') {
|
|
476
|
+
Sharer.init();
|
|
477
|
+
} else {
|
|
478
|
+
document.addEventListener('DOMContentLoaded', Sharer.init);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
// exporting sharer for external usage
|
|
482
|
+
window.Sharer = Sharer;
|
|
483
|
+
})(window, document);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(m,r){"use strict";var s=function(t){this.elem=t};s.init=function(){var t=r.querySelectorAll("[data-sharer]"),e,a=t.length;for(e=0;e<a;e++){t[e].addEventListener("click",s.add)}};s.add=function(t){var e=t.currentTarget||t.srcElement;var a=new s(e);a.share()};s.prototype={constructor:s,getValue:function(t){var e=this.elem.getAttribute("data-"+t);if(e&&t==="hashtag"){if(!e.startsWith("#")){e="#"+e}}return e===null?"":e},share:function(){var t=this.getValue("sharer").toLowerCase(),e={facebook:{shareUrl:"https://www.facebook.com/sharer/sharer.php",params:{u:this.getValue("url"),hashtag:this.getValue("hashtag"),quote:this.getValue("quote")}},linkedin:{shareUrl:"https://www.linkedin.com/shareArticle",params:{url:this.getValue("url"),mini:true}},twitter:{shareUrl:"https://twitter.com/intent/tweet",params:{text:this.getValue("title"),url:this.getValue("url"),hashtags:this.getValue("hashtags"),via:this.getValue("via"),related:this.getValue("related"),in_reply_to:this.getValue("in_reply_to")}},email:{shareUrl:"mailto:"+this.getValue("to"),params:{subject:this.getValue("subject"),body:this.getValue("title")+"\n"+this.getValue("url")}},whatsapp:{shareUrl:this.getValue("web")==="true"?"https://web.whatsapp.com/send":"https://wa.me/",params:{phone:this.getValue("to"),text:this.getValue("title")+" "+this.getValue("url")}},telegram:{shareUrl:"https://t.me/share",params:{text:this.getValue("title"),url:this.getValue("url")}},viber:{shareUrl:"viber://forward",params:{text:this.getValue("title")+" "+this.getValue("url")}},line:{shareUrl:"http://line.me/R/msg/text/?"+encodeURIComponent(this.getValue("title")+" "+this.getValue("url"))},pinterest:{shareUrl:"https://www.pinterest.com/pin/create/button/",params:{url:this.getValue("url"),media:this.getValue("image"),description:this.getValue("description")}},tumblr:{shareUrl:"http://tumblr.com/widgets/share/tool",params:{canonicalUrl:this.getValue("url"),content:this.getValue("url"),posttype:"link",title:this.getValue("title"),caption:this.getValue("caption"),tags:this.getValue("tags")}},hackernews:{shareUrl:"https://news.ycombinator.com/submitlink",params:{u:this.getValue("url"),t:this.getValue("title")}},reddit:{shareUrl:"https://www.reddit.com/submit",params:{url:this.getValue("url"),title:this.getValue("title")}},vk:{shareUrl:"http://vk.com/share.php",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("caption"),image:this.getValue("image")}},xing:{shareUrl:"https://www.xing.com/social/share/spi",params:{url:this.getValue("url")}},buffer:{shareUrl:"https://buffer.com/add",params:{url:this.getValue("url"),title:this.getValue("title"),via:this.getValue("via"),picture:this.getValue("picture")}},instapaper:{shareUrl:"http://www.instapaper.com/edit",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},pocket:{shareUrl:"https://getpocket.com/save",params:{url:this.getValue("url")}},mashable:{shareUrl:"https://mashable.com/submit",params:{url:this.getValue("url"),title:this.getValue("title")}},mix:{shareUrl:"https://mix.com/add",params:{url:this.getValue("url")}},flipboard:{shareUrl:"https://share.flipboard.com/bookmarklet/popout",params:{v:2,title:this.getValue("title"),url:this.getValue("url"),t:Date.now()}},weibo:{shareUrl:"http://service.weibo.com/share/share.php",params:{url:this.getValue("url"),title:this.getValue("title"),pic:this.getValue("image"),appkey:this.getValue("appkey"),ralateUid:this.getValue("ralateuid"),language:"zh_cn"}},blogger:{shareUrl:"https://www.blogger.com/blog-this.g",params:{u:this.getValue("url"),n:this.getValue("title"),t:this.getValue("description")}},baidu:{shareUrl:"http://cang.baidu.com/do/add",params:{it:this.getValue("title"),iu:this.getValue("url")}},douban:{shareUrl:"https://www.douban.com/share/service",params:{name:this.getValue("name"),href:this.getValue("url"),image:this.getValue("image"),comment:this.getValue("description")}},okru:{shareUrl:"https://connect.ok.ru/dk",params:{"st.cmd":"WidgetSharePreview","st.shareUrl":this.getValue("url"),title:this.getValue("title")}},mailru:{shareUrl:"http://connect.mail.ru/share",params:{share_url:this.getValue("url"),linkname:this.getValue("title"),linknote:this.getValue("description"),type:"page"}},evernote:{shareUrl:"https://www.evernote.com/clip.action",params:{url:this.getValue("url"),title:this.getValue("title")}},skype:{shareUrl:"https://web.skype.com/share",params:{url:this.getValue("url"),title:this.getValue("title")}},delicious:{shareUrl:"https://del.icio.us/post",params:{url:this.getValue("url"),title:this.getValue("title")}},sms:{shareUrl:"sms://",params:{body:this.getValue("body")}},trello:{shareUrl:"https://trello.com/add-card",params:{url:this.getValue("url"),name:this.getValue("title"),desc:this.getValue("description"),mode:"popup"}},messenger:{shareUrl:"fb-messenger://share",params:{link:this.getValue("url")}},odnoklassniki:{shareUrl:"https://connect.ok.ru/dk",params:{st:{cmd:"WidgetSharePreview",deprecated:1,shareUrl:this.getValue("url")}}},meneame:{shareUrl:"https://www.meneame.net/submit",params:{url:this.getValue("url")}},diaspora:{shareUrl:"https://share.diasporafoundation.org",params:{title:this.getValue("title"),url:this.getValue("url")}},googlebookmarks:{shareUrl:"https://www.google.com/bookmarks/mark",params:{op:"edit",bkmk:this.getValue("url"),title:this.getValue("title")}},qzone:{shareUrl:"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey",params:{url:this.getValue("url")}},refind:{shareUrl:"https://refind.com",params:{url:this.getValue("url")}},surfingbird:{shareUrl:"https://surfingbird.ru/share",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},yahoomail:{shareUrl:"http://compose.mail.yahoo.com",params:{to:this.getValue("to"),subject:this.getValue("subject"),body:this.getValue("body")}},wordpress:{shareUrl:"https://wordpress.com/wp-admin/press-this.php",params:{u:this.getValue("url"),t:this.getValue("title"),s:this.getValue("title")}},amazon:{shareUrl:"https://www.amazon.com/gp/wishlist/static-add",params:{u:this.getValue("url"),t:this.getValue("title")}},pinboard:{shareUrl:"https://pinboard.in/add",params:{url:this.getValue("url"),title:this.getValue("title"),description:this.getValue("description")}},threema:{shareUrl:"threema://compose",params:{text:this.getValue("text"),id:this.getValue("id")}},kakaostory:{shareUrl:"https://story.kakao.com/share",params:{url:this.getValue("url")}},yummly:{shareUrl:"http://www.yummly.com/urb/verify",params:{url:this.getValue("url"),title:this.getValue("title"),yumtype:"button"}}},a=e[t];if(a){a.width=this.getValue("width");a.height=this.getValue("height")}return a!==undefined?this.urlSharer(a):false},urlSharer:function(t){var e=t.params||{},a=Object.keys(e),r,s=a.length>0?"?":"";for(r=0;r<a.length;r++){if(s!=="?"){s+="&"}if(e[a[r]]){s+=a[r]+"="+encodeURIComponent(e[a[r]])}}t.shareUrl+=s;var l=this.getValue("link")==="true";var i=this.getValue("blank")==="true";if(l){if(i){m.open(t.shareUrl,"_blank")}else{m.location.href=t.shareUrl}}else{console.log(t.shareUrl);var h=t.width||600,u=t.height||480,o=m.innerWidth/2-h/2+m.screenX,p=m.innerHeight/2-u/2+m.screenY,g="scrollbars=no, width="+h+", height="+u+", top="+p+", left="+o,n=m.open(t.shareUrl,"",g);if(m.focus){n.focus()}}}};if(r.readyState==="complete"||r.readyState!=="loading"){s.init()}else{r.addEventListener("DOMContentLoaded",s.init)}m.Sharer=s})(window,document);
|