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: c45d25a9884f3b9c25d3a534186b7a0facfe3d5f
4
- data.tar.gz: ce3b49671fb5737a36a97aa1624bf6a54bc14e8c
3
+ metadata.gz: 0d576ef0d8930620b15c8fbbaf497db4fe8a6061
4
+ data.tar.gz: e6b78ab9e807f3d443ccf1e23a4c345f3773f4ea
5
5
  SHA512:
6
- metadata.gz: 1f9e9705f745c1caa98136944137801ef4a7ede50605037eacd39c084522db98a4aa2a09a7ecbf70f85b59457e3ce22e14dd5fbfc0a2018be5480c3f0baf6ba9
7
- data.tar.gz: 4d10803fdf96c39059ccf87482feccedbde2462b6085c8667dce03ee21e4d9e597e6f34584cc7af352791dac9811203cefb74e0075033444c1191a56a6740059
6
+ metadata.gz: edb3ae5affbe92ccd26f5eb69e2a16ac39b82d55e8e5a7d15627e692aca22e964acd3b8af8d10ad78e99df29d5b08760f0716131d29ec871019f9546734e0202
7
+ data.tar.gz: 444822406df89fb0cd2041b07209b64b63479cd430a4f46863ae6a66a294b8b582d3fb4706ca3731741b62483382ff6d72c770489213e5e6ee8db9ced757095c
@@ -4,6 +4,7 @@ $(document).on 'click', "@sharing_tags_share", (event) ->
4
4
  self = $(@)
5
5
  SharingTags.share(
6
6
  self.data('network'),
7
+ mobile: device?.mobile() # for mobile devices
7
8
  url: self.data 'share-url'
8
9
  title: self.data 'title'
9
10
  message: self.data 'description'
@@ -1,7 +1,8 @@
1
1
  class @SharingTags
2
2
 
3
3
  @share: (network, attributes, callback)->
4
- SharingTags.Share[network]?(attributes, callback)
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
- if share_window.closed
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
@@ -1,3 +1,3 @@
1
1
  module SharingTags
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sharing_tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anatoliy Kovalchuk