Hi there Patrick!

Todd,

Our solution was IE 5.0/5/5 specific. This is what I ended up doing:

<script language="JavaScript">
        <!--
              
        function fnOpenModeless(){
  window.showModelessDialog("2.html")
}
  //-->
</script>

<A HREF="javascript://" onclick="javascript:
window.showModelessDialog('2.html')">Open Document</A>

This works quite well.

Dharmesh Goel
Programmer Analyst
IT Dept. - Discount Car & Truck Rentals
416-744-0123 x290

 -----Original Message-----
From:   Todd [mailto:[EMAIL PROTECTED]] 
Sent:   January 8, 2002 10:39 PM
To:     CF-Community
Subject:        Re: Content protection?

oh .. I guess I could help answer your question, heh.

This is the JavaScript that opens a full screen window with most of the
stuff (except the scroll bars) disabled.


window.open(varURL,null,"directories=no,fullscreen=yes,location=no,menubar=n
o,resizable=no,scrollbars=yes,status=no,toolbar=no");

varURL is the URL to the file you want to open.  I'm sure you can see what's
going on and adjust things according to your needs.

The rest of this JavaScript code is used on the page that gets opened by the
code above.  It 'disables' all keyboard keys and mouse buttons (except for
the left click).

<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
// This function 'disables' key presses and any mouse click except for the
left one, and displays the appropriate message for each, if any.
    function secure() {
        alert("Message for key presses, if desired.");

        // This group of functions disable any mouse button except the left
one.
       var message="Message for mouse clicks, if desired.";

        function click(e) {
            if (document.all) {
                if (event.button != 1) {
                    alert(message);
                    return false;
                }
            }
            if (document.layers) {
                if (e.which != 1) {
                    alert(message);
                    return false;
                }
            }
        }

        if (document.layers) {
            document.captureEvents(Event.MOUSEDOWN);
        }

        document.onmousedown=click;
    }
//-->
</SCRIPT>

and this enables the JavaScript on the page:

    <body onkeydown="secure();">

I haven't tried it yet, but you might be able to get around a few
'workarounds' by changing Event.MOUSEDOWN to Event.MOUSEUP.  If it works, it
will negate the workaround that I posted below.

HTH

If you have any questions, let me know.  I have used this code to keep
students, who are using an online testing application, as honest as
possible.  It is currently in production and, judging by the pass/fail
ratio, it's working really well.  :)


Oh .. as a side question, this online testing application that I have
written has turned into a rather complex app, full of all kinds of
supporting pieces.  Does anyone know what kind of need there is for a
full-featured application of this type, or what someone might be looking for
in terms of functionality for something like this?  If it's moderate to
high, I'll rework it and make it as generic as possible.

Todd

______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to