Thanks, I went ahead and folded in your change.
It will appear in the production relase of Ptolemy II 2.0.
In general, we need a better way of handling urls, but this
seems like a simple enough extension

-Christopher

--------

    Hi,
    
    I tried using a <A href="mailto:...";> in Ptolemy II 2.0-beta, and have
    that opened via the browser. I noticed however that the #in_browser
    trick does not work for mailto:.
    
    To circumvent this I added a few lines to
    HTMLViewer::hyperlinkUpdate(), (HTMLViewer.java, line 125), that I
    think may be useful to others as well.
    
    Instead of
    
       boolean useBrowser = false;
       String ref = newUrl.getRef();
       if (ref != null) {
           useBrowser = ref.equals("in_browser");
       }
       if (!useBrowser && event instanceof HTMLFrameHyperlinkEvent) {
    
    it now says
    
       boolean useBrowser = false;
       String ref = newUrl.getRef();
       if (ref != null) {
           useBrowser = ref.equals("in_browser");
       }
       // Added for mailto: references, PL 20020725
       String prot = newUrl.getProtocol();
       if (prot != null) {
           useBrowser |= prot.equals("mailto");
       }
       if (!useBrowser && event instanceof HTMLFrameHyperlinkEvent) {
    
    and this works nicely. (At least, under WinNT it pops up a new Outlook
    mail window, not tested with other browsers/mailers.)
    
    Best regards,
    Paul Lieverse
--------

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to