Browse Source

add support for telegram

Fernando Ribeiro 7 years ago
parent
commit
cc013be965

+ 1 - 1
conf/default.php

@@ -8,7 +8,7 @@
 //$conf['fixme']    = 'FIXME';
 
 
-$conf['networks']           = 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$conf['networks']           = 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 
 $conf['display']            = 'color';
 

+ 6 - 0
images/telegram.svg

@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"
+aria-label="Telegram" role="img"
+viewBox="0 0 512 512"><rect
+width="512" height="512"
+rx="15%"
+fill="#37aee2"/><path fill="#c8daea" d="M199 404c-11 0-10-4-13-14l-32-105 245-144"/><path fill="#a9c9dd" d="M199 404c7 0 11-4 16-8l45-43-56-34"/><path fill="#f6fbfe" d="M204 319l135 99c14 9 26 4 30-14l55-258c5-22-9-32-24-25L79 245c-21 8-21 21-4 26l83 26 190-121c9-5 17-3 11 4"/></svg>

+ 1 - 1
lang/de/settings.php

@@ -7,7 +7,7 @@
 
 
 $lang['networks']           = 'Liste Ihrer bevorzugten Socialmedia Buttons, mit Leerzeichen getrennt und in der Reihenfolge ihrer Anzeige. G&uuml;ltige Namen sind: ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = 'Anzeigeoptionen: Zeige Socialmedia Buttons mit Symbol und Name, nur das Symbol oder den Namen auf Hintergrundfarbe. ';
 $lang['target']             = 'Verkn&uuml;pfungsziel: Gibt an, wo die Seite des sozialen Netzwerks ge&ouml;ffnet werden soll.';
 $lang['twitter_user']       = 'Twitter-Nutzername (ohne "@")';

+ 1 - 1
lang/en/settings.php

@@ -9,7 +9,7 @@
 // $lang['fixme'] = 'FIXME';
 
 $lang['networks']           = 'List of your favorite social buttons, space separated and in order of appearance. Valid names are: ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = 'Display options: show social buttons with icon and name, just the icon or name on backgroud color.';
 $lang['target']             = 'Link target: specifies where to open the social network page.';
 $lang['twitter_user']       = 'Twitter username of content author (don\'t include "@").';

+ 1 - 1
lang/es/settings.php

@@ -9,7 +9,7 @@
 // $lang['fixme'] = 'FIXME';
 
 $lang['networks']           = 'Lista de tus butones sociales favoritos, separados por espacio y en orden de aparición. Son nombre válidos: ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = 'Opciones de visualización: muestra texto o solamente el icono.';
 $lang['target']             = 'Link target: specifies where to open the social network page.';
 $lang['twitter_user']       = 'Nombre de usuario del autor en Twitter (sin incluir la "@").';

+ 1 - 1
lang/fr/settings.php

@@ -9,7 +9,7 @@
 // $lang['fixme'] = 'FIXME';
 
 $lang['networks']           = 'Liste des boutons de vos réseaux sociaux préférés, séparés par un espace et dans l\'ordre d\'affichage. Noms acceptés : ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = 'Options d\'affichage : Montrer le bouton avec l\'icône et le nom, uniquement l\'icône ou le nom sur un fond coloré.';
 $lang['target']             = 'Link target: specifies where to open the social network page.';
 $lang['twitter_user']       = 'Nom d\'utilisateur du compte Twitter de l\'auteur du contenu (ne pas ajouter "@").';

+ 1 - 1
lang/ja/settings.php

@@ -9,7 +9,7 @@
 // $lang['fixme'] = 'FIXME';
 
 $lang['networks']           = '表示するボタンを半角スペースで区切り順番に指定します。 指定可能なボタン名は ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = '表示プション: アイコンと名前の両方、アイコンのみ、背景色の上に名前のみから選択';
 $lang['target']             = 'Link target: specifies where to open the social network page.';
 $lang['twitter_user']       = 'Twitterユーザー名("@"は含めない)';

+ 1 - 1
lang/pt/settings.php

@@ -9,7 +9,7 @@
 // $lang['fixme'] = 'FIXME';
 
 $lang['networks']           = 'A lista dos teus botões sociais favoritos, ordenados e separados por espaços. Os nomes válidos são: ';
-$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon xing vk email';
+$lang['networks']          .= 'twitter facebook googleplus linkedin pinterest tumblr reddit taringa stumbleupon telegram xing vk email';
 $lang['display']            = 'Opções de exibição: mostra texto ou apenas o ícone.';
 $lang['target']             = 'Alvo da ligação: especifica onde abrir a página da rede social.';
 $lang['twitter_user']       = 'O nome de utilizador do autor no Twitter (sem incluir o "@").';

+ 2 - 2
plugin.info.txt

@@ -1,7 +1,7 @@
 base   socialite
 author Fernando Ribeiro
-email  pinguim.ribeiro@gmail.com
-date   2017-12-07
+email  fribeiro@fribeiro.org
+date   2018-04-09
 name   Socialite plugin
 desc   Lightweight responsive social buttons
 url    https://www.dokuwiki.org/plugin:socialite

+ 17 - 0
style.css

@@ -200,6 +200,23 @@
     background-color: #eb4924;
 }
 
+/* Telegram */
+
+.socialite li.name .telegram,
+.socialite li.icon .telegram,
+.socialite li.color .telegram {
+    border-color: #1d94d3;
+}
+
+.socialite li.name .telegram,
+.socialite li.icon .telegram {
+    background-image: url("images/telegram.svg");
+}
+
+.socialite li.color .telegram {
+    background-color: #1d94d3;
+}
+
 /* Xing */
 
 .socialite li.name .xing,

+ 5 - 1
syntax/button.php

@@ -85,7 +85,7 @@ class syntax_plugin_socialite_button extends DokuWiki_Syntax_Plugin {
         $valid_networks = array('twitter', 'facebook', 'googleplus',
                                 'linkedin', 'pinterest', 'tumblr',
                                 'reddit', 'taringa', 'stumbleupon',
-                                'xing', 'vk', 'email');
+                                'telegram', 'xing', 'vk', 'email');
 
         if (in_array($data['display'], $valid_displays)) {
             $display = $data['display'];
@@ -159,6 +159,10 @@ class syntax_plugin_socialite_button extends DokuWiki_Syntax_Plugin {
                 $name = 'StumbleUpon';
                 $href = 'http://www.stumbleupon.com/submit?url='. $url .'&title=' . $title;
                 break;
+            case 'telegram':
+                $name = 'Telegram';
+                $href = 'https://telegram.me/share/url?url='. $url .'&text=' . $title;
+                break;
             case 'xing':
                 $name = 'Xing';
                 $href = 'https://www.xing-share.com/app/user?op=share;sc_p=xing-share;url='. $url;