网页中的橡皮擦工具

时间:2014-04-18 04:17:34

标签: jquery jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>

<!DOCTYPE html >
<html>
<head>
<script type="text/javascript">
function erase()
{
     window.history.go(back);  

}
    </script>

<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>

    $(function() {

        if (localStorage.chkbx && localStorage.chkbx != '') {
            $('#rememberMe').attr('checked', 'checked');
            $('#username').val(localStorage.usrname);
            $('#pass').val(localStorage.pass);
        } else {
            $('#rememberMe').removeAttr('checked');
            $('#username').val('');
            $('#pass').val('');
        }

        $('#rememberMe').click(function() {

            if ($('#rememberMe').is(':checked')) {
                // save username and password
                localStorage.usrname = $('#username').val();
                //localStorage.pass = $('#pass').val();
                localStorage.chkbx = $('#rememberMe').val();
            } else if ($) {
                localStorage.usrname = '';
                localStorage.pass = '';
                localStorage.chkbx = '';
            }
        });
    });
</script>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>RAPTOR</title>

</head>

<body bgcolor=#D0D0D0 >
    <table>

            <div align="right"><a href="painting.html"><img src="Pen.png" width="42" height="42"></a></div>
         <script type="text/javascript">
             /*<![CDATA[*/
            (function() {
                var SOURCE;
                if ( /MSIE/ .test(navigator.userAgent) && !window.opera  )
                {
                    SOURCE = "javascript:(function(){var c,d,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,z,A,B,e,C;d=['red','lime','blue','black'];B='';i=window;j=document;k=j.body;l=j.documentElement||k;function D(a){return j.createElement(a)};function E(a,b){a.appendChild(b)};function F(a,b){a.removeChild(b)};C=l.scrollTop;g='absolute';h='px';o=0;n=d[0];v=[];p=D('div');with(p.style){position=g;left=top='0';zIndex='200';cursor='crosshair';background='url(_0.gif)'}E(k,p);j.namespaces.add('v','urn:schemas-microsoft-com:vml','#default#VML');m=D('input');with(m.style){position=g;left='-1000'+h;top=C+h}m.onpaste=function(){u=i.clipboardData.getData('Text');if(u.length<3){return}v=u.split(/,/g);u=v.shift()-l.clientWidth;o=parseInt(v.shift());n=d[o];G();H();j.onfocus();i.resizeBy(u,0)};q=j.onfocus=function(){with(m){value=B;focus();select()}};E(k,m);q();function G(){var a=[];p.innerHTML='';r=v.length;q=0;z=-1;A=-1;while(q<r){if(v[q]==-1){J(a);z=-1;a.length=0;++q}else{z=v[q++];A=v[q++]-C;a.push(z+'px,'+A+'px')}}J(a)};G();function H(){v.unshift(o);v.unshift(l.clientWidth);m.value=B=v.join(',');v.shift();v.shift();m.select();G()}function I(x,y){v.push(x,y)}function J(a){p.insertAdjacentHTML('beforeEnd','<v:polyline points=\\''+a.join(' ')+'\\' filled=\\'false\\' strokecolor=\\''+n+'\\' strokeweight=\\'3px\\'></v:polyline>')}w=false;q=i.onresize=function(){with(p.style){top=C+h;width=l.clientWidth-20+h;height=l.clientHeight+h}G()};q();q=i.onscroll=function(){C=l.scrollTop;p.style.top=C+h;m.style.top=C+h;G()};q();j.onmousedown=function(){e=i.event;w=true;z=e.clientX;A=e.clientY;I(z,A+C)};j.onmouseup=function(){e=i.event;w=false;I(e.clientX,e.clientY+C);v.push(-1);H()};j.onmousemove=function(){e=i.event;if(!w)return;q=e.clientX;r=e.clientY;I(q,r+C);J([z+'px,'+A,q+'px,'+r+h]);z=q;A=r};m.onkeyup=function(){e=i.event;switch(e.keyCode){case 27:case 88:F(k,p);F(k,m);j.onmousedown=j.onmouseup=j.onmousemove=j.onfocus=i.onresize=i.onscroll=null;break;case 38:case 40:o+=39-e.keyCode;if(o<0)o=d.length-1;n=d[o%d.length];H();break;case 69:i.location='mailto:?body='+B;break;case 46:v.length=0;H()}}})();void(0);";

                }
                else 
                {
                    SOURCE = "javascript:(function(){var c,d,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D;d=['red','lime','blue','black'];f=3;C='';j=window;k=document;l=k.body;function E(a){return k.createElement(a)};function F(a,b){a.appendChild(b)};D=l.scrollTop;g='absolute';h='px';i='0px';q=0;p=d[0];y=[];r=E('canvas');with(r.style){position=g;left=top=i;zIndex='200';cursor='crosshair'}F(l,r);s=r.getContext('2d');n=E('div');F(n,k.createTextNode('Press \\'E\\' to email scribble, UP ARROW or DOWN ARROW to change color, DEL to clear,  ESC or \\'X\\' to close.'));with(n.style){background='#FFF';border='1px solid #000';padding='5px';font='bold 11px sans-serif';position=g;zIndex='199';background='#F2F2F2';opacity=MozOpacity='0.9';top=i}F(l,n);m=E('input');with(m.style){position=g;left='-1000'+h;top=D+h}k.onfocus=function(){with(m){value=C;focus();select()}};F(l,m);k.onfocus();function G(){if(m.value.length<3){m.value='';return}y=m.value.split(/,/g);j.resizeBy(y.shift()-l.clientWidth,0);q=parseInt(y.shift());p=d[q];H();I();k.onfocus()}m.addEventListener('input',G,false);function H(){with(s){clearRect(0,0,r.offsetWidth,r.offsetHeight);u=y.length;t=0;A=-1;B=-1;beginPath();while(t<u){if(y[t]==-1){strokeStyle=p;lineWidth=f;stroke();beginPath();A=-1;++t}else if(A==-1){A=y[t++];B=y[t++]-D;moveTo(A,B)}else{lineTo(y[t++],y[t++]-D)}}stroke()}};function I(){y.unshift(q);y.unshift(l.clientWidth);C=y.join(',');m.value=C;m.focus();m.select();y.shift();y.shift()}z=false;t=j.onresize=function(){r.style.top=D+h;r.width=l.clientWidth;r.height=j.innerHeight;H()};t();t=j.onscroll=function(){D=l.scrollTop||k.documentElement.scrollTop;n.style.top=D+h;r.style.top=D+h;m.style.top=D+h;H()};t();r.onmousedown=function(e){z=true;A=e.clientX;B=e.clientY;y.push(A);y.push(B+D)};r.onmouseup=function(e){z=false;y.push(e.clientX);y.push(e.clientY+D);y.push(-1);I();H()};r.onmousemove=function(e){if(!z)return;t=e.clientX;u=e.clientY;y.push(t);y.push(u+D);with(s){beginPath();moveTo(A,B);lineTo(t,u);strokeStyle=p;lineWidth=f;stroke()}A=t;B=u};m.onkeyup=function(e){switch(e.keyCode){case 86:if(e.ctrlKey)G();break;case 27:case 88:l.removeChild(r);l.removeChild(n);l.removeChild(m); k.onfocus=j.onresize=j.onscroll=null; m.removeEventListener('input',G,false);break;case 38:case 40:q+=39-e.keyCode;if(q<0)q=d.length-1;p=d[q%d.length];I();H();break;case 69:w=E('form');with(w){action='mailto:';method='post';enctype='text/plain';style.visibility='hidden'}x=E('textarea');x.name='Message';x.value='\\n1. Go to: '+j.location.href+'\\n\\n2. Press \\'Scribble here!\\' (or go to http://scribblet.org)\\n\\n3. Paste this into the document:\\n'+C;F(w,x);F(l,w);try{if(escape(x.value).length>=1980)throw 0;w.submit()}catch(e){j.prompt('Could not create email. Copy & paste this instead:',x.value);j.location.href='mailto:'}l.removeChild(w);break;case 46:y.length=(0);I();H()}}})();void(0);";
                }
                document.getElementsByTagName('a')[0].href = SOURCE;
            }
            )
            ();
            /*]]>*/             
        </script>   

            <div align="right"> <a href="#"> <img src="erase.png" width="30" height="30"> </a> </div>       
             <form name="myform" action="Loginservlet" method="post" >  
            <h2 style="color: blue">RAPTOR LOGIN</h2>
            username <input type="text" class="username" placeholder="Username" id="username" name="uname" required><br />
            password <input type="password" class="pass" placeholder="Password" id="pass" name="upass" required><br />
            <input type="checkbox" value="rememberMe" id="rememberMe"> Remember Me 
                <input type="submit" value="Sign in"> 
                <input type="reset" name="Reset"><br />
                 <a href='forgot.jsp'>forgot password?</a>              
            </form>
</table>
</body>
</html>

我想使用Scribblet删除网页中的eraser。为此,我需要在Scribblet工具中插入橡皮擦。我不知道如何插入橡皮擦工具和一件事,如果我点击油漆选项,它只在按下逃脱后起作用油漆它就像指针一样。因此,如果在油漆中它不会选择橡皮擦工具。请帮我。

提前致谢。

0 个答案:

没有答案