12/27/2004

New popup method released under the GPL

For the Japanese Rikai site I've developed a new way of doing both the popups and the mediation (i.e., proxying the web through rikai.com). It turns out this is all much simpler when done in Javascript in modern browsers, as I can let the client parse the html for me.

Here's the source:
  • Adding popups for Japanese
  • Rewriting URLs to point back to Rikai.com

    You're welcome to help get these work faster, integrate into Mozilla, or whatever..
    Some notes:
    - the popups load from a small script at http://www.rikai.com/perl/popup.pl. Because of browser security features, this will not work if the main page did not in the rikai.com domain. If you need popups to help develop, you'll need to repoint this at a local file or something.
    - the mediator points to a script at http://www.rikai.com/proxy. I have not as yet released this script as yet, but it does little other than spit back the html from the mediate_uri parameter, plus the small amount of javascript to add popups and repoint URLs.. Currently, that amounts to:

    <script language="JavaScript1.2" src="http://www.rikai.com/mediate/mediate.js">
    </script>
    <script language="JavaScript1.2" src="http://www.rikai.com/popups/popup-script3.js"></script>

    at the start of the body, and:

    <script language="Javascript1.2">addPopups();</script>
    <script language="Javascript1.2">proxyMediateAll();</script>

    at the end.
    It also plops in a base href tag so that relative path images and such load from the original server.
  • 0 Comments:

    Post a Comment

    Links to this post:

    Create a Link

    << Home