Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 12:09
    Byron Delgado
    0

    TinyMce not recognizing email links

    Problably is not a big issue but editor users dont know much html, so when an email link is inserted they dont know about mailto:. The original TinyMce package recognizes an email and displays a window offering to insert mailto: but this option is not present in Umbraco. Does somebody know something about this issue?. Thanks for any response.

  • Pasang Tamang 239 posts 344 karma points
    Mar 25, 2011 @ 12:16
    Pasang Tamang
    0

    Hi,

    Which version of umbraco you're using? I'm using 4.7.0 and it's working fine for me.

  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 12:29
    Byron Delgado
    0

    Well I have few sites in 4.6 and 4.7 and in none of them is working... mmmm I wonder if it is me!

  • Tom Fulton 2030 posts 4984 karma points c-trib
    Mar 25, 2011 @ 12:31
    Tom Fulton
    0

    Hmm, doesn't work for me on 4.7.  I highlight text, click Insert Link, type an e-mail address in the Url field, and the link ends up being:  <a href="http://mce_host/my@email.com">...</a>

  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 12:36
    Byron Delgado
    0

    The only thing I get when I insert an email is http://mce_host/email@email.com I even tried different browsers.

    I am starting to look if \umbraco\plugins\tinymce3\insertLink.aspx is using the \umbraco_client\tinymce3\utils\validate.js from TinyMce. Which for what I researched is the script that TinyMce uses to recognize emails.

  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 12:38
    Byron Delgado
    0

    Cool (not that great though) it is not me!

  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 14:09
    Byron Delgado
    1

    I made it work! Weird the code in the script was commented out, but so far I have checked it doesn't brake anything (yet). So this is what I did:

    Insert the validate.js call in the \umbraco\plugins\tinymce3\insertLink.aspx

     <umb:JsInclude ID="JsInclude2" runat="server" FilePath="ui/jquery.js" PathNameAlias="UmbracoClient" Priority="0" />
        <umb:JsInclude ID="JsInclude1" runat="server" FilePath="tinymce3/tiny_mce_popup.js" PathNameAlias="UmbracoClient" Priority="100" />
        <umb:JsInclude ID="JsInclude3" runat="server" FilePath="tinymce3/plugins/advlink/js/advlink.js" PathNameAlias="UmbracoClient" Priority="101" />
        <umb:JsInclude ID="JsInclude4" runat="server" FilePath="tinymce3/utils/form_utils.js" PathNameAlias="UmbracoClient" Priority="102" />
        <umb:JsInclude ID="JsInclude5" runat="server" FilePath="tinymce3/utils/validate.js" PathNameAlias="UmbracoClient" Priority="103" />
    

    Now remove the comment in \umbraco_client\tinymce3\plugins\advlink\js\advlink.js line 131 so now it looks like this

    function checkPrefix(n) {
        if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email'))) {
            n.value = 'mailto:' + n.value;
        }
    
        if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external'))) {
            n.value = 'http://' + n.value;
        }
    }
    

    You might have to reload and delete the cache to see the changes.

    I hope this help somebody else.

  • Gordon Saxby 1299 posts 1526 karma points
    Mar 25, 2011 @ 14:31
    Gordon Saxby
    0

    You could just add "mailto:" in the URL box when entering an email address.

     

  • Gordon Saxby 1299 posts 1526 karma points
    Mar 25, 2011 @ 14:31
    Gordon Saxby
    0

    You could just add "mailto:" in the URL box when entering an email address.

    Oops - don't know how I managed to reply twice!?

     

     

  • Byron Delgado 47 posts 70 karma points
    Mar 25, 2011 @ 14:46
    Byron Delgado
    0

    True. But as mentioned at the beggining, I am not expecting every editor to know that.

  • Dav 44 posts 69 karma points
    Jun 08, 2011 @ 12:45
    Dav
    0

    Byron, it does indeed help someone :-) Thanks for sharing your solution!

  • Mads Krohn 206 posts 493 karma points c-trib
    Sep 30, 2011 @ 11:15
    Mads Krohn
    0

    This issue is still persistent in 4.7.1, too bad, but thanks for the workaround will try it asap!

    EDIT: Just tried the workaround, working perfectly, thx!! #h5yr

  • SM 19 posts 41 karma points
    Aug 28, 2013 @ 12:06
    SM
    0

    Add the below script inside the "script" tag in the \umbraco\plugins\tinymce3\insertLink.aspx page

    function AppendProperty() {
        var sText = $('#href').val();
        if (validateEmail(sText)) {
            $('#href').val(function (index, value) {
                return 'mailto:' + value;
            });
        }
        else {
            if (sText != "" && (/^http/i.test(sText)) == false) {
                $('#href').val(function (index, value) {
                    return 'http://' + value;
                });
            }
        }
    }
    
    function validateEmail(sEmail) {
        var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
        if (filter.test(sEmail)) {
            return true;
        }
        else {
            return false;
        }
    }
    

    and modify the input field like the below

    <input id="href" style="width: 220px;" type="text" name="href" value="" onchange="document.getElementById('localUrl').value = ''; selectByValue(this.form,'linklisthref',this.value); AppendProperty();" />
    
  • Tom Fulton 2030 posts 4984 karma points c-trib
    Aug 28, 2013 @ 21:48
    Tom Fulton
    0

    FYI - I added Brian's solution to v4.9.0 a while back, see this issue. Should be working in later Umbraco versions OOTB.

Please Sign in or register to post replies

Write your reply to:

Draft