sharing_tags 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d576ef0d8930620b15c8fbbaf497db4fe8a6061
|
4
|
+
data.tar.gz: e6b78ab9e807f3d443ccf1e23a4c345f3773f4ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edb3ae5affbe92ccd26f5eb69e2a16ac39b82d55e8e5a7d15627e692aca22e964acd3b8af8d10ad78e99df29d5b08760f0716131d29ec871019f9546734e0202
|
7
|
+
data.tar.gz: 444822406df89fb0cd2041b07209b64b63479cd430a4f46863ae6a66a294b8b582d3fb4706ca3731741b62483382ff6d72c770489213e5e6ee8db9ced757095c
|
@@ -1,7 +1,8 @@
|
|
1
1
|
class @SharingTags
|
2
2
|
|
3
3
|
@share: (network, attributes, callback)->
|
4
|
-
SharingTags.Share
|
4
|
+
share_object = if attributes.mobile then SharingTags.MobileShare else SharingTags.Share
|
5
|
+
share_object[network]?(attributes, callback)
|
5
6
|
|
6
7
|
class @Share
|
7
8
|
|
@@ -41,8 +42,23 @@ class @SharingTags
|
|
41
42
|
share_window = window.open share_url, 'Sharing', 'width=740,height=440'
|
42
43
|
|
43
44
|
clearInterval(@interval)
|
45
|
+
iteration = 0
|
44
46
|
@interval = setInterval((=>
|
45
|
-
|
47
|
+
iteration++
|
48
|
+
if @_checkSharing(share_url, share_window, iteration)
|
46
49
|
clearInterval @interval
|
47
50
|
callback() if callback
|
48
51
|
), 500)
|
52
|
+
|
53
|
+
@_checkSharing: (share_url, share_window, iteration)=>
|
54
|
+
# console.log("check desktop sharing", share_url, share_window, iteration)
|
55
|
+
share_window.closed || iteration >= 10
|
56
|
+
|
57
|
+
class @MobileShare extends @Share
|
58
|
+
|
59
|
+
@twitter: ({title, url, message}, callback) ->
|
60
|
+
super
|
61
|
+
|
62
|
+
@_checkSharing: (share_url, share_window, iteration)=>
|
63
|
+
# console.log("check mobile sharing", share_url, share_window, iteration)
|
64
|
+
return true if iteration >= 1
|
data/lib/sharing_tags/version.rb
CHANGED