0

how to disable right click view the .zul page property..?

asked 2011-03-16 08:50:34 +0800

ccabay1 gravatar image ccabay1
6

how to disable right click view the .zul page property..? i want to use zscript disable visitor view my .zul page property when they click right mouse key?

delete flag offensive retag edit

5 Replies

Sort by ยป oldest newest

answered 2011-03-16 22:13:28 +0800

ccabay1 gravatar image ccabay1
6

haha..(._.`)..this Q? have been solved by myself..

link publish delete flag offensive edit

answered 2011-03-16 22:52:45 +0800

youleak gravatar image youleak
6 1

how? can teach me?

link publish delete flag offensive edit

answered 2011-11-26 07:41:34 +0800

hosarb gravatar image hosarb
45

add this section to your zk.xml to prevent the right click :


<device-config>
        <device-type>ajax</device-type>
        <!-- configures zk to reload the page if timeout happnes -->
        <timeout-uri></timeout-uri>
        <!-- configure zk to automatic reload timeout-uri without requireing a event from user -->
        <automatic-timeout/>
        <!-- Custom javascript snippets -->
        <embed>
            <![CDATA[<script type="text/javascript">
            <script language=JavaScript>
                //Disable right mouse click Script
                //By Maximus ([email protected]) w/ mods by DynamicDrive
                //For full source code, visit http://www.dynamicdrive.com

                function clickIE4(){
                    if (event.button==2){
                        return false;
                    }
                }

                function clickNS4(e){
                    if (document.layers||document.getElementById&&!document.all){
                        if (e.which==2||e.which==3){
                            return false;
                        }
                    }
                }

                if (document.layers){
                    document.captureEvents(Event.MOUSEDOWN);
                    document.onmousedown=clickNS4;
                }
                else if (document.all&&!document.getElementById){
                    document.onmousedown=clickIE4;
                }

                document.oncontextmenu=new Function("return false");
            </script>

            ]]>
        </embed>
    </device-config>

link publish delete flag offensive edit

answered 2011-11-26 08:53:51 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

Thanks for sharing hosarb

link publish delete flag offensive edit

answered 2011-11-26 10:24:13 +0800

Bobzk gravatar image Bobzk
444 1 8

updated 2011-11-26 10:24:54 +0800

Assuming you are trying to disabling the right click option "View page source", I hope you are not doing this for security because it won't work. It is possible to get at the page source via various methods if anyone really wants to. All disabling the right click will do is make it more difficult for the average user.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-03-16 08:50:34 +0800

Seen: 470 times

Last updated: Nov 26 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More