How to use vanilla-sharing - 3 common examples

To help you get started, we’ve selected a few vanilla-sharing examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CodeForAfrica / africanCOMMONS / src / js / plugins.js View on Github external
if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
      redirectUri = 'http://localhost:4000/'
    }

    var network = $(this).data('pattern-network')
    var title = $(this).data('pattern-title')
    var tags = $(this).data('pattern-tags')
    // var tagline = $(this).data('pattern-tagline')  // Unused
    tags = '#' + tags

    tags = ' #civicpatterns #africanCOMMONS #commons'

    switch (network) {
      case 'facebook-share':
        VanillaSharing.fbShare({
          url: url,
          redirectUri: redirectUri,
          hashtag: tags,
          quote: title,
          fbAppId: fbAppId
        })
        break
      case 'facebook-like':
        VanillaSharing.fbFeed({
          url: url,
          redirectUri: redirectUri,
          fbAppId: fbAppId
        })
        break
      case 'twitter':
        VanillaSharing.tw({
github CodeForAfrica / africanCOMMONS / src / js / plugins.js View on Github external
tags = '#' + tags

    tags = ' #civicpatterns #africanCOMMONS #commons'

    switch (network) {
      case 'facebook-share':
        VanillaSharing.fbShare({
          url: url,
          redirectUri: redirectUri,
          hashtag: tags,
          quote: title,
          fbAppId: fbAppId
        })
        break
      case 'facebook-like':
        VanillaSharing.fbFeed({
          url: url,
          redirectUri: redirectUri,
          fbAppId: fbAppId
        })
        break
      case 'twitter':
        VanillaSharing.tw({
          url: url,
          title: title + tags
        })
        break
      default:
    }

    return false
  })
github CodeForAfrica / africanCOMMONS / src / js / plugins.js View on Github external
url: url,
          redirectUri: redirectUri,
          hashtag: tags,
          quote: title,
          fbAppId: fbAppId
        })
        break
      case 'facebook-like':
        VanillaSharing.fbFeed({
          url: url,
          redirectUri: redirectUri,
          fbAppId: fbAppId
        })
        break
      case 'twitter':
        VanillaSharing.tw({
          url: url,
          title: title + tags
        })
        break
      default:
    }

    return false
  })
})

vanilla-sharing

Small (1.6 KB) simple tool for sharing url, title, description and image to VK, Facebook (Feed, Dialog, Button, Messenger), Twitter, Reddit, Pinterest, Tumblr, G+, VK, OK, Mail.ru, LinkedIn, Whatsapp, Viber, Telegram, Line.

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis