tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

006.xhtml (1196B)


      1 <?xml version="1.0" encoding="utf-8"?>
      2 <html xmlns="http://www.w3.org/1999/xhtml">
      3 <head>
      4 <title>Dropzone and link drag and drop: allowed effects 'move','copyMove','linkMove' and 'all'</title>
      5 <style type="text/css">
      6 div
      7  {background-color:gray;
      8  width:200px;
      9  height:200px;}
     10 </style>
     11 <script type="application/ecmascript">
     12 var effects = ['move','copyMove','linkMove','all'];
     13 function start(event)
     14  {var e = parseInt(event.target.href.substring(16));
     15  event.dataTransfer.effectAllowed = effects[e];}
     16 function finish(event)
     17  {var e = parseInt(event.dataTransfer.getData('text/uri-list').substring(16,17));
     18  document.querySelectorAll('a')[e].firstChild.nodeValue = (event.dataTransfer.dropEffect == 'move' &amp;&amp; event.dataTransfer.effectAllowed == effects[e])?'PASS':'FAIL';}
     19 </script>
     20 </head>
     21 <body>
     22 <p>Drag links one by one and drop them into gray box below, link text should be updated as you drop them.</p>
     23 <p ondragstart="start(event)">
     24  <a href="data:text/plain,0">Link</a>
     25  <a href="data:text/plain,1">Link</a>
     26  <a href="data:text/plain,2">Link</a>
     27  <a href="data:text/plain,3">Link</a>
     28 </p>
     29 <div dropzone="move string:text/uri-list" ondrop="finish(event)"/>
     30 </body>
     31 </html>