You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
Chimo 12da81b7c5
Fix demo link, remove redundant "usage" section
7 years ago
css Bundle 'icon' style via gs-share--icon class 8 years ago
images Bundle 'icon' style via gs-share--icon class 8 years ago
js closest: Handle detached DOM trees 8 years ago
.gitattributes Normalize line endings 10 years ago
.gitignore Ignore vim 'undo' files 9 years ago
.jshintrc Adds jshint configs 9 years ago
LICENSE Adds license information 10 years ago
README.md Fix demo link, remove redundant "usage" section 7 years ago
index-es.html Simplify README 7 years ago
index-fr.html Simplify README 7 years ago
index.html Simplify README 7 years ago

README.md

'Share' widget for GNU social

This adds links/buttons to your page so that visitors can share it on GNU social.

HTML

Add the following in the <head> of your page (if necessary, change the path to point to the stylesheet).

<link rel="stylesheet" href="styles.css">

Add the following where you want the links/buttons to appear.

<div class="gs-share">
  <button data-url="URL-from-data" data-title="TITLE-from-data" class="js-gs-share gs-share--icon">Share on GNU social</button>
</div>

The "data-title" and "data-url" attributes are optional. If they are not set, the "title" will be the title of the current page and the "url" will be the URL of the current page.

Add the following at the bottom of your page (if necessary, change the path to point to the JS file).

<script src="gs-share.js"></script>

Demo

https://chromic.org/gs-share/

Server-side fallback

For an example of a server-side fallback, see the "php" branch in this repo.