Commits

Vlad Riscutia committed bedd826 Merge

Merged in cj89/tinkerer (pull request #12)

  • Participants
  • Parent commits 0fb1df6, af7d2c2

Comments (0)

Files changed (3)

blog/doc/deploying.rst

 
   {% extends "!page.html" %}
 
-  {% set script_files = script_files + ["_static/piwik.js"] %}
-
   {% block footer %}
       {{ super() }}
-      {# you could also add something to the footer of every page #}
+      {% include "../_static/piwik.js" %}
   {% endblock %}
   
 And the analytics code inside ``_static/piwik.js``:

tinkerer/ext/hidemail.py

 '''
 from docutils import nodes
 import re
+from tinkerer.ext.uistr import UIStr
 
 try:
     maketrans = ''.maketrans
     ROT 13 encryption with embedded in Javascript code to decrypt
     in the browser.
     """
-    return """<noscript>(Javascript must be enabled to see this e-mail address)</noscript>
+    return """<noscript>(%s)</noscript>
               <script type="text/javascript">document.write(
               "%s".replace(/[a-zA-Z]/g,
               function(c){
                 return String.fromCharCode(
                 (c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}));
-                </script>""" % rot_13_encrypt(text)
+              </script>""" % (UIStr.MAIL_HIDDEN_BY_JAVASCRIPT, rot_13_encrypt(text))
 
 
 def js_obfuscated_mailto(email, displayname=None):

tinkerer/ext/uistr.py

         UIStr.OLDER = unicode(_("Older"), "utf-8")
         UIStr.PAGE_FMT = unicode(_("Page %d"), "utf-8")
         UIStr.READ_MORE = unicode(_("Read more..."), "utf-8")
+        UIStr.MAIL_HIDDEN_BY_JAVASCRIPT = unicode(_("Javascript must be enabled to see this e-mail address"), "utf-8")