mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
28 lines
1.2 KiB
XML
28 lines
1.2 KiB
XML
|
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
|
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="500px" height="500px" viewBox="0 0 500 500">
|
||
|
|
<title>SVG link drag and drop and history navigation roundtrip</title>
|
||
|
|
<a xlink:href="data:text/plain,1">
|
||
|
|
<circle cx="50" cy="50" r="40" fill="green"/>
|
||
|
|
</a>
|
||
|
|
<textArea x="10" y="100" width="480" height="200" font-size="30">Drag circle above. You will be redirected to new page. When you return back drop circle on itself. You should see word PASS once you drop it.</textArea>
|
||
|
|
<script type="application/ecmascript">
|
||
|
|
var a = document.querySelector('a');
|
||
|
|
a.addEventListener('dragstart',
|
||
|
|
function (event)
|
||
|
|
{event.dataTransfer.effectAllowed = 'copy';
|
||
|
|
window.location = '060-1.svg'}
|
||
|
|
,false);
|
||
|
|
a.addEventListener('dragenter',
|
||
|
|
function (event)
|
||
|
|
{event.preventDefault();}
|
||
|
|
,false);
|
||
|
|
a.addEventListener('dragover',
|
||
|
|
function (event)
|
||
|
|
{event.preventDefault();}
|
||
|
|
,false);
|
||
|
|
a.addEventListener('drop',
|
||
|
|
function (event)
|
||
|
|
{document.querySelector('textArea').firstChild.nodeValue = (event.dataTransfer.getData('text/uri-list').replace(/\r\n$/,'') == 'data:text/plain,1')?'PASS':'FAIL';}
|
||
|
|
,false);
|
||
|
|
</script>
|
||
|
|
</svg>
|