{"id":13397751,"url":"https://github.com/tmort/Socialite","last_synced_at":"2025-03-14T00:32:38.428Z","repository":{"id":1956140,"uuid":"2886409","full_name":"tmort/Socialite","owner":"tmort","description":null,"archived":false,"fork":false,"pushed_at":"2015-10-30T11:23:30.000Z","size":546,"stargazers_count":1683,"open_issues_count":37,"forks_count":163,"subscribers_count":63,"default_branch":"master","last_synced_at":"2024-10-01T00:58:36.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tmort.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-30T21:05:46.000Z","updated_at":"2024-08-22T21:33:32.000Z","dependencies_parsed_at":"2022-08-29T16:20:09.331Z","dependency_job_id":null,"html_url":"https://github.com/tmort/Socialite","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmort%2FSocialite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmort%2FSocialite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmort%2FSocialite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tmort%2FSocialite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tmort","download_url":"https://codeload.github.com/tmort/Socialite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243504980,"owners_count":20301537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T18:01:43.001Z","updated_at":"2025-03-14T00:32:37.879Z","avatar_url":"https://github.com/tmort.png","language":"HTML","readme":"# Socialite v2\n\n### Because if you're selling your soul, you may as well do it asynchronously.\n\nSocialite provides a very easy way to implement and activate a plethora of social sharing buttons — any time you wish. On document load, on article hover, on any event!\n\n[For a demo visit: **socialitejs.com**](http://www.socialitejs.com/)\n\nAuthor: David Bushell [http://dbushell.com](http://dbushell.com) [@dbushell](http://twitter.com/dbushell)\n\nContributor: Tom Morton [http://twmorton.com](http://twmorton.com) [@tmort](http://twitter.com/tmort)\n\nCopyright © 2013\n\n### Changes from Version 1\n\nPlease be aware that class names used by Socialite have changed since \u003ca href=\"https://github.com/dbushell/Socialite/tags/\"\u003eversion 1\u003c/a\u003e. All instances start with the class `socialite`, they gain the class `socialite-instance` once processed, and finally `socialite-loaded` once activated. **Pinterest** and **Spotify** extensions are no longer in the default build of `socialite.js`. See end of this README for full change log.\n\n## Using Socialite\n\nCreate an element with the class `socialite` and a class like `twitter-share` to specify the social network and type of widget. Best practice is to provide an accessible fallback URL like the example below. Style it however you like, though avoid using `overflow: hidden` in CSS as it will crop overlays. See [http://socialitejs.com](http://socialitejs.com) for demos.\n\n\t\u003ca class=\"socialite twitter-share\" href=\"http://twitter.com/share\" data-url=\"http://socialitejs.com\"\u003e\n\t\tShare on Twitter\n\t\u003c/a\u003e\n\nUse `data-*` attributes to configure your button. These configurations directly correlate to the individual network implementations, so while Twitter uses `data-url`, Facebook uses `data-href`. Not ideal but I'd rather keep this script very small!\n\nSupported widgets are currently:\n\n* Facebook: `facebook-like`\n* Twitter: `twitter-share`, `twitter-follow`, `twitter-mention`, `twitter-hashtag` and `twitter-embed` (for individual tweets)\n* Google+: `googleplus-one`, `googleplus-share`, `googleplus-badge`\n* LinkedIn: `linkedin-share`, `linkedin-recommend`\n\nAlso available as extensions:\n\n* Pinterest: `pinterest-pinit`\n* Spotify: `spotify-play`\n* Hacker News: `hackernews-share`\n* GitHub: `github-watch`, `github-fork`, `github-follow`\n* DZone: `dzone-submit`\n\nFor all individual button configurations visit [Twitter](https://twitter.com/about/resources/buttons/), [Google+](https://developers.google.com/+/plugins/+1button/), [Facebook](http://developers.facebook.com/docs/reference/plugins/like/), [LinkedIn](http://developer.linkedin.com/plugins/share-button/), [Pinterest](http://pinterest.com/about/goodies/), and [Spotify](https://developer.spotify.com/technologies/spotify-play-button/). **Important:** don't include the scripts provided by these networks, Socialite does that for you! Include socialite.js right at the end of your document and activate with the options below.\n\n***Please note:*** you can easily edit socialite.js to remove the social networks you don't need.\n\n## Making it Work\n\n### Load\n\n\tSocialite.load();\n\nThe main Socialite function. `load` will search the document for elements with the class `socialite` and magically transform them into sharing buttons (based on a network class and data-* attributes).\n\nAlways wait for at least the `DOMContentLoaded` event — `$(document).ready(function() { });` with jQuery.\n\n\tSocialite.load(context);\n\nBe kind! Provide a scope to search within using `context` (a containing element) rather than the whole document.\n\n### Activate\n\n\tSocialite.activate(element, 'widget');\n\n`activate` replaces a single element (or an array of) with the specific social widget.\n\n### Process (optional)\n\n\tSocialite.process();\n\nRun `process` only once when the document has loaded to prepare all Socialite instances. This may be necessary to avoid conflicts when multiple or unsupported widgets exist on the page (e.g. Pinterest buttons). Note that `process` removes all fallback content for some widgets. *This optional will be implemented more intelligently in future versions of Socialite*.\n\n### Setup (optional)\n\n\tSocialite.setup({ /* settings */ });\n\n`setup` allows you to specify settings for each network such as localisation (see below for all options).\n\n## Settings\n\n## Facebook\n\n\tSocialite.setup({\n\t\tfacebook: {\n\t\t\tlang     : 'en_GB',\n\t\t\tappId    : 123456789,\n\t\t\tonlike   : function(url) { /* ... */ },\n\t\t\tonunlike : function(url) { /* ... */ },\n\t\t\tonsend   : function(url) { /* ... */ }\n\t\t}\n\t});\n\nSee Facebook's documentation on [Internationalization](http://developers.facebook.com/docs/internationalization/) for supported language codes.\n\n### Twitter\n\n\tSocialite.setup({\n\t\ttwitter: {\n\t\t\tlang       : 'en',\n\t\t\tonclick    : function(e) { /* ... */ },\n\t\t\tontweet    : function(e) { /* ... */ },\n\t\t\tonretweet  : function(e) { /* ... */ },\n\t\t\tonfavorite : function(e) { /* ... */ },\n\t\t\tonfollow   : function(e) { /* ... */ }\n\t\t}\n\t});\n\nSee Twitter's documentation for support on [Web Intents Javascript Events](https://dev.twitter.com/docs/intents/events) and supported [Languages](https://twitter.com/about/resources/buttons#tweet).\n\nTwitter share buttons can override the global language setting with a `data-lang` attribute.\n\n### Google+\n\n\tSocialite.setup({\n\t\tgoogleplus: {\n\t\t\tlang               : 'en-GB',\n\t\t\tonstartinteraction : function(el, e) { /* ... */ },\n\t\t\tonendinteraction   : function(el, e) { /* ... */ },\n\t\t\tcallback           : function(el, e) { /* ... */ }\n\t\t}\n\t});\n\nSee Google's documentation for support on [Events](https://developers.google.com/+/plugins/+1button/#plusonetag-parameters) and [Languages](https://developers.google.com/+/plugins/+1button/#available-languages).\n\n## Contribute\n\nSend me feedback and testing issues!\n\nThe main core of Socialite is built for extensibility. It's basically a fancy script loader designed for social widgets. They can be stripped out easily if not used and new ones added:\n\n\tSocialite.network('network', params);\n\tSocialite.widget('network', 'widget', params);\n\nWith these two functions you can add extended support. See the source code for examples (more guides to come here). I'm always working on support and settings for more networks, check back frequently!\n\n## WordPress Plugin\n\nTom Morton [@tmort](http://twitter.com/tmort/) has also created a WordPress plugin that packages WPSocialite and makes it a one step installation into your WordPress powered website. Download it from here: http://wordpress.org/plugins/wpsocialite/.\n\n## Change Log\n\n### 2.0.3 - 11th June 2012\n\n* added [GitHub Buttons](http://markdotto.github.com/github-buttons/) extension\n* Google+ `window.gapi.render()` now used on inner gplus div to avoid inline styles on the `socialite` element\n\n### 2.0.2 - 10th June 2012\n\n* Hacker News share widget added by [@igrigorik](https://github.com/igrigorik)\n\n### 2.0.1 - 9th June 2012\n\n* added Google+ `googleplus-badge` widget\n* added a Buffer App extension\n* created an `extensions` folder in the repository\n* **Pinterest** and **Spotify** removed from the default `socialite.js` and `socialite.min.js` builds.\n","funding_links":[],"categories":["HTML","📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmort%2FSocialite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftmort%2FSocialite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftmort%2FSocialite/lists"}