ソースを参照

Typekit (by adobe) support

Amauri CHAMPEAUX 10 年 前
コミット
220f464547
1 ファイル変更23 行追加1 行削除
  1. 23 1
      tarteaucitron.services.js

+ 23 - 1
tarteaucitron.services.js

@@ -1,4 +1,4 @@
-/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google*/
+/*global tarteaucitron, ga, Shareaholic, stLight, clicky, top, google, Typekit*/
 /*jslint regexp: true, nomen: true*/
 
 // addthis
@@ -455,6 +455,28 @@ tarteaucitron.services.sharethis = {
     }
 };
 
+// typekit
+tarteaucitron.services.typekit = {
+    "key": "typekit",
+    "type": "api",
+    "name": "Typekit (adobe)",
+    "uri": "http://www.adobe.com/fr/privacy.html",
+    "needConsent": true,
+    "cookies": [],
+    "js": function () {
+        "use strict";
+        if (tarteaucitron.user.typekitId === undefined) {
+            return;
+        }
+        tarteaucitron.addScript('//use.typekit.net/' + tarteaucitron.user.typekitId + '.js', '', function () {
+            try {
+                Typekit.load();
+            } catch (e) {}
+        });
+    }
+};
+
+
 // twitter
 tarteaucitron.services.twitter = {
     "key": "twitter",