Skip to content

Commit

Permalink
Merge branch 'medienverbinder-threema'
Browse files Browse the repository at this point in the history
  • Loading branch information
compeak committed Nov 6, 2015
2 parents 6c4aa79 + c286c56 commit 2c0a905
Show file tree
Hide file tree
Showing 12 changed files with 131 additions and 23 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Changelog

* Added Threema service. (medienverbinder)
* Added StumbleUpon service. (craiq)
* Added Reddit service. (craiq)
* Changed rel=popup to data-rel.
Expand Down
2 changes: 1 addition & 1 deletion README-de.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Für den Aufruf von `grunt demo` muss [Grunt CLI](http://gruntjs.com/getting-sta
| `data-media-url` | Zu teilendes Bild (pinterest) | `null` |
| `data-orientation` | Anordnung der Buttons. Verfügbar: `horizontal`, `vertical` | `horizontal` |
| `data-referrer-track` | Wenn angegeben, wird dieser String an die geteilte URL angehängt. Mit `null` deaktivieren. | `null` |
| `data-services` | Liste der Services, die verwendet werden sollen. Für die Verwendung im `data`-Attribut muss die Angabe Entity-enkodiert werden. Die Reihenfolge wird berücksichtigt. Beispiel: `data-services="[&quot;facebook&quot;,&quot;googleplus&quot;]"` <br> Verfügbare Dienste: `twitter`, `facebook`, `googleplus`, `linkedin`, `pinterest`, `xing`, `whatsapp`, `mail`, `info`, `addthis`, `tumblr`, `flattr`, `diaspora`, `reddit`, `stumbleupon` | Twitter, Facebook, Google+ |
| `data-services` | Liste der Services, die verwendet werden sollen. Für die Verwendung im `data`-Attribut muss die Angabe Entity-enkodiert werden. Die Reihenfolge wird berücksichtigt. Beispiel: `data-services="[&quot;facebook&quot;,&quot;googleplus&quot;]"` <br> Verfügbare Dienste: `twitter`, `facebook`, `googleplus`, `linkedin`, `pinterest`, `xing`, `whatsapp`, `mail`, `info`, `addthis`, `tumblr`, `flattr`, `diaspora`, `reddit`, `stumbleupon`, `threema` | Twitter, Facebook, Google+ |
| `data-theme` | Farbschema auswählen. Verfügbar: `standard`, `grey` und `white`. | `standard` |
| `data-title` | Titel der zu teilenden Seite. | Entweder `DC.title`/`DC.creator` oder `<title>` |
| `data-twitter-via` | User von dem der Tweet ursprünglich stammt. | `null` |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Make sure you have installed the [Grunt CLI](http://gruntjs.com/getting-started#
| `data-media-url` | Media url to be shared (pinterest) | `null` |
| `data-orientation` | `vertical` will stack the buttons vertically. | `horizontal` |
| `data-referrer-track` | A string that will be appended to the share url. Can be disabled using `null`. | `null` |
| `data-services` | An entity-encoded JSON string containing an array of service names to be enabled. Example: `data-services="[&quot;facebook&quot;,&quot;googleplus&quot;]"` Available service names: `twitter`, `facebook`, `googleplus`, `linkedin`, `pinterest`, `xing`, `whatsapp`, `mail`, `info`, `addthis`, `tumblr`, `flattr`, `diaspora`, `reddit`, `stumbleupon` | `twitter`, `facebook`, `googleplus`, `info` |
| `data-services` | An entity-encoded JSON string containing an array of service names to be enabled. Example: `data-services="[&quot;facebook&quot;,&quot;googleplus&quot;]"` Available service names: `twitter`, `facebook`, `googleplus`, `linkedin`, `pinterest`, `xing`, `whatsapp`, `mail`, `info`, `addthis`, `tumblr`, `flattr`, `diaspora`, `reddit`, `stumbleupon`, `threema` | `twitter`, `facebook`, `googleplus`, `info` |
| `data-theme` | We include 3 color schemes, `standard`, `grey` and `white`. | `standard` |
| `data-title` | Title to be used as share text in Twitter/Whatsapp | page's `DC.title`/`DC.creator` or `<title>` |
| `data-twitter-via` | Screen name of the user to attribute the Tweet to | `null` |
Expand Down
4 changes: 2 additions & 2 deletions build/shariff.complete.css

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions build/shariff.complete.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/shariff.min.css

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions build/shariff.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ <h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</h1>
<dt>data-backend-url:</dt><dd>/shariff/</dd>
<dt>data-media-url:</dt><dd>http://www.heise.de/imgs/18/1/4/8/0/5/6/9/wa-encryption-d1999f774c5b5757.png</dd>
<dt>data-flattr-user:</dt><dd>example</dd>
<dt>data-services:</dt><dd>[&amp;quot;addthis&amp;quot;,whatsapp&amp;quot;,&amp;quot;facebook&amp;quot;,&amp;quot;xing&amp;quot;,&amp;quot;pinterest&amp;quot;,&amp;quot;linkedin&amp;quot;,&amp;quot;tumblr&amp;quot;,&amp;quot;flattr&amp;quot;,&amp;quot;diaspora&amp;quot;,&amp;quot;reddit&amp;quot;,&amp;quot;stumbleupon&amp;quot;]</dd>
<dt>data-services:</dt><dd>[&amp;quot;addthis&amp;quot;,whatsapp&amp;quot;,&amp;quot;facebook&amp;quot;,&amp;quot;xing&amp;quot;,&amp;quot;pinterest&amp;quot;,&amp;quot;linkedin&amp;quot;,&amp;quot;tumblr&amp;quot;,&amp;quot;flattr&amp;quot;,&amp;quot;diaspora&amp;quot;,&amp;quot;reddit&amp;quot;,&amp;quot;stumbleupon&amp;quot;,&amp;quot;threema&amp;quot;]</dd>
</dl>
<article class="slim">
<header>
<h1>Lorem ipsum dolor sit amet, consectetuer adipiscing elit</h1>
<div data-backend-url="/shariff/" data-flattr-user="example" class="shariff" data-services="[&quot;addthis&quot;,&quot;whatsapp&quot;,&quot;facebook&quot;,&quot;xing&quot;,&quot;pinterest&quot;,&quot;linkedin&quot;,&quot;tumblr&quot;,&quot;flattr&quot;,&quot;diaspora&quot;,&quot;reddit&quot;,&quot;stumbleupon&quot;]" data-media-url="http://www.heise.de/imgs/18/1/4/8/0/5/6/9/wa-encryption-d1999f774c5b5757.png"></div>
<div data-backend-url="/shariff/" data-flattr-user="example" class="shariff" data-services="[&quot;addthis&quot;,&quot;whatsapp&quot;,&quot;facebook&quot;,&quot;xing&quot;,&quot;pinterest&quot;,&quot;linkedin&quot;,&quot;tumblr&quot;,&quot;flattr&quot;,&quot;diaspora&quot;,&quot;reddit&quot;,&quot;stumbleupon&quot;,&quot;threema&quot;]" data-media-url="http://www.heise.de/imgs/18/1/4/8/0/5/6/9/wa-encryption-d1999f774c5b5757.png"></div>
<time datetime="2014-11-13T10:45:00+02:00">13.11.2014 - 12:45 Uhr</time>
</header>
<p class="deck">A small river named Duden flows by their place and supplies it with the necessary regelialia. It is a paradisematic country, in which roasted parts of sentences fly into your mouth.</p>
Expand Down
73 changes: 73 additions & 0 deletions src/js/services/threema.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
'use strict';

module.exports = function(shariff) {
var url = encodeURIComponent(shariff.getURL());

var title = shariff.getMeta('DC.title');
var creator = shariff.getMeta('DC.creator');

if (title.length > 0 && creator.length > 0) {
title += ' - ' + creator;
} else {
title = shariff.getTitle();
}

return {
popup: false,
shareText: {
'bg': 'cподеляне',
'da': 'del',
'de': 'teilen',
'en': 'share',
'es': 'compartir',
'fi': 'Jaa',
'fr': 'partager',
'hr': 'podijelite',
'hu': 'megosztás',
'it': 'condividi',
'ja': '共有',
'ko': '공유하기',
'nl': 'delen',
'no': 'del',
'pl': 'udostępnij',
'pt': 'compartilhar',
'ro': 'partajează',
'ru': 'поделиться',
'sk': 'zdieľať',
'sl': 'deli',
'sr': 'podeli',
'sv': 'dela',
'tr': 'paylaş',
'zh': '分享'
},
name: 'threema',
faName: 'fa-lock',
title: {
'bg': 'Сподели в Threema',
'da': 'Del på Threema',
'de': 'Bei Threema teilen',
'en': 'Share on Threema',
'es': 'Compartir en Threema',
'fi': 'Jaa Threemaissä',
'fr': 'Partager sur Threema',
'hr': 'Podijelite na Threema',
'hu': 'Megosztás Threemaen',
'it': 'Condividi su Threema',
'ja': 'Threema上で共有',
'ko': 'Threema에서 공유하기',
'nl': 'Delen op Threema',
'no': 'Del på Threema',
'pl': 'Udostępnij przez Threema',
'pt': 'Compartilhar no Threema',
'ro': 'Partajează pe Threema',
'ru': 'Поделиться на Threema',
'sk': 'Zdieľať na Threema',
'sl': 'Deli na Threema',
'sr': 'Podeli na Threema-u',
'sv': 'Dela på Threema',
'tr': 'Threema\'ta paylaş',
'zh': '在Threema上分享'
},
shareUrl: 'threema://compose?text=' + encodeURIComponent(title) + '%20' + url + shariff.getReferrerTrack()
};
};
3 changes: 2 additions & 1 deletion src/js/shariff.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ var Shariff = function(element, options) {
require('./services/twitter'),
require('./services/whatsapp'),
require('./services/xing'),
require('./services/tumblr')
require('./services/tumblr'),
require('./services/threema')
];

// filter available services to those that are enabled and initialize them
Expand Down
26 changes: 26 additions & 0 deletions src/style/services/threema.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.shariff {
.threema {
a {
background-color: #333333;
&:hover {
background-color: #1f1f1f;
}
}
.fa-lock {
font-size: 28px;
}
}
.theme-white {
.threema a {
color: #333333;
}
}
}

@media only screen and (min-width: 600px) {
.shariff {
.threema .fa-lock {
font-size: 22px;
}
}
}
1 change: 1 addition & 0 deletions src/style/shariff-services.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@
@import "services/whatsapp";
@import "services/xing";
@import "services/tumblr";
@import "services/threema";

0 comments on commit 2c0a905

Please sign in to comment.