We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29446
    • 1 Posts
    This is an auto-generated support/comment thread for emo - E-Mail Obfuscation.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    This plugin replaces all plaintext emails and email links with span elements. Then email addresses are encrypted and stored in javascript variables. Javascript decryption routines are triggered by the browser on 'window.onload' event and replace the span elements with the real email addresses.
      • 10449
      • 956 Posts
      Very nice + useful plugin. Thanks!
        • 29076
        • 615 Posts
        Just installed it and it works perfectly, out of the box. Great!

        Thank you very much for making a great snippet out of the emailobfuscation-script. grin
          I think, thererfor I am! But what I am, and why...?
          • 13373
          • 70 Posts
          It actually took me longer to read the link at ALA that Sylvaticus supplied than it did to install this plugin!!

          Seems to work great too. Doesn’t degrade nicely like the ALA one does, but hey, it’s pretty damn handy anyway!
            • 29446
            • 1 Posts
            Quote from: Sylvaticus at Jan 25, 2008, 01:02 AM

            [...] Thank you very much for making a great snippet out of the emailobfuscation-script. grin

            Well, not exactly... Also, the ’<noscript>’ part is missing. Regarding graceful degradation (for those unlucky 6% without javascript), you could of cause insert a link to your contact form in the span element instead of notifying to turn javascript on: edit the plugin code and change
            <span class=\"emo_address\">Turn on JavaScript!</span>
            

            to
            <span class=\"emo_address\"><a href=\"/url-of-your-contact-form.html\">contact me</a></span>
            


            Have a look at this site if you want to do PHP’s auto_prepend_file outside a cms.
              • 36416
              • 589 Posts
              Really useful plugin, thanks floh.

              One little observation:
              it breaks eForms submitted with email field(s).

              Quick fix:
              wrap email address pattern search like this
              if (!isset($_POST['submit'])) { //Eol: skip submitted pages
                $modx->documentOutput = preg_replace_callback("#<a[^>]*mailto:([^'\"]+)['\"][^>]*>([^<]*)</a>#i", "encodeLink", $modx->documentOutput);
                $modx->documentOutput = preg_replace_callback(email_regex(), "encodeLink", $modx->documentOutput);
              }
              
                • 6726
                • 7,075 Posts
                Wow we have a bunch of plugins to adress this but this one gives it a nice spin smiley
                  .: COO - Commerce Guys - Community Driven Innovation :.


                  MODx est l&#39;outil id
                  • 2912
                  • 315 Posts
                  Great plugin floh and nice catch on the eForms Eol.
                    BBloke
                    • 18174
                    • 116 Posts
                    Hi Folks

                    In IE7 I get an JS Error

                    ---------------------------
                    Fehler
                    ---------------------------
                    Es ist ein Laufzeitfehler aufgetreten.
                    Möchten Sie den Debugmodus starten?
                    
                    Zeile: 22
                    Fehler: Nicht implementiert
                    


                    /*
                     *  Written by: Florian Wobbe
                     *  Contact: www.eprofs.de
                     *  Created: 2008-01-12 - v1.1
                     *  Modified: 2008-01-17 - v1.2 - Email encoding
                     *  Modified: 2008-01-19 - v1.3 - Custom Base64 encoding
                     *  For: MODx cms (modxcms.com)
                     *  Name: emo - E-Mail Obfuscation
                     *  Description: These javascript functions replace html placeholder
                     *    span elements with decrypted email addresses.
                     *  License: GPL
                     */
                    
                    
                    // addLoadEvent is Simon Willison's function that allows for convenient
                    // addition of multiple fuctions that are all supposed to be triggered
                    // on window.onload event.
                    // takes function name as the argument. e.g. addLoadEvent(doPopups);
                    function addLoadEvent(func) {
                      var oldonload = window.onload;
                      if (typeof window.onload != 'function') {
                        window.onload = func;  //*********** SCRIPT STOPS HERE
                    


                    In FF 3.1 no probs.
                    Has anybody a clue what this could be?

                    Best regards
                    manu

                    EDIT:
                    Modification of plugin:
                    // Finish encrypted addresses block
                    $addressesjs .=
                    "      addLoadEvent(emo_replace);" . "\n" . //Parenthesis at emo_replace REMOVED
                    "    //-->" . "\n" . "    </script>" . "\n";


                    As you see, I removed the parenthesis in the plugin code and now it works in IE7 and FF3.0.
                    I’m no an JS pro. Could anybody confirm?
                    Thanks manu
                      • 18174
                      • 116 Posts
                      As the function works nice with the modification mentioned above, nevertheless I put something on the wishlist:
                      The "turn java scipt on" tag is pretty ugly on slow clients, it flickers often when you refresh the page.
                      Did anybody think about to integrate the domready function of motools instead of window.onload?
                      In manager mode this plugin modification works IMHO:
                      // Finish encrypted addresses block
                      $addressesjs .=
                      "     window.addEvent('domready', function(){" . "\n" .
                      "        emo_replace();" . "\n" .
                      "      });" . "\n".
                                                                                      /*REPLACED "      addLoadEvent(emo_replace);" . "\n" .*/
                      "    //-->" . "\n" . "    </script>" . "\n";

                      Since motools is included in manager mode it should be possible to include it generally. But I don’t know how to fix this.

                      so long
                      manu