Переглянути джерело

Fix #235

You can now change engage string with the same method as other texts:

```
<script>
var tarteaucitronCustomText = {
    "engage-twitter": "Follow us on Twitter!",
};
</script>
```
Amauri CHAMPEAUX 6 роки тому
батько
коміт
e20c3a90bb
1 змінених файлів з 7 додано та 2 видалено
  1. 7 2
      tarteaucitron.js

+ 7 - 2
tarteaucitron.js

@@ -1392,11 +1392,16 @@ var tarteaucitron = {
     "engage": function (id) {
     "engage": function (id) {
         "use strict";
         "use strict";
         var html = '',
         var html = '',
-            r = Math.floor(Math.random() * 100000);
+            r = Math.floor(Math.random() * 100000),
+            engage = tarteaucitron.services[id].name + ' ' + tarteaucitron.lang.fallback;
+
+        if (tarteaucitron.lang['engage-' + id] !== undefined) {
+            engage = tarteaucitron.lang['engage-' + id];
+        }
 
 
         html += '<div class="tac_activate">';
         html += '<div class="tac_activate">';
         html += '   <div class="tac_float">';
         html += '   <div class="tac_float">';
-        html += '      <strong>' + tarteaucitron.services[id].name + '</strong> ' + tarteaucitron.lang.fallback;
+        html += '      ' + engage;
         html += '      <button class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
         html += '      <button class="tarteaucitronAllow" id="Eng' + r + 'ed' + id + '" onclick="tarteaucitron.userInterface.respond(this, true);">';
         html += '          &#10003; ' + tarteaucitron.lang.allow;
         html += '          &#10003; ' + tarteaucitron.lang.allow;
         html += '       </button>';
         html += '       </button>';