Sophie

Sophie

distrib > Fedora > 13 > i386 > media > os > by-pkgid > a83c96295685e3a2e488954db8324406 > files > 135

MochiKit-1.4.2-4.fc12.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>script.aculo.us Drag and drop functional test file</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
    <script type="text/javascript" src="/MochiKit/Position.js"></script>
    <script type="text/javascript" src="/MochiKit/Visual.js"></script>
    <script type="text/javascript" src="/MochiKit/DragAndDrop.js"></script>
  <style type="text/css" media="screen">
    #thelist li { background: green; margin:5px; padding: 30px; }
    #thelist2 li { background: #ffb; margin:2px; padding: 2px; }
  </style>
</head>
<body>
<h1>script.aculo.us Drag and drop functional test file</h1>

<h2>Draggables/Droppables</h2>

<div id="revertbox1" class="box1" style="z-index:1000;width:150px;height:150px;background:#bbf;">
  <span id="handle1">drag here</span><br/>
  <input type="checkbox" id="shouldrevert1"/> Revert?
</div>

<div id="revertbox2" class="box" style="z-index:1000;width:150px;height:150px;background:#bbf;">
  <span id="handle2">drag here</span><br/>
  <input type="checkbox" id="shouldrevert2"/> Revert?
</div>

<div id="droptarget1" style="width:200px;height:200px;background-color:#eee;">accepts first box</div>
<div id="droptarget2" style="width:200px;height:200px;background-color:#eee;">accepts second box</div>

<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
  new MochiKit.DragAndDrop.Draggable('revertbox1',{handle:'handle1',revert:function(element){return ($('shouldrevert1').checked)}});
  new MochiKit.DragAndDrop.Draggable('revertbox2',{handle:'handle2',revert:function(element){return ($('shouldrevert2').checked)}});
  new MochiKit.DragAndDrop.Droppable('droptarget1',{accept:['box1','otherstuff'],ondrop:function(){alert('drop!')}});
  new MochiKit.DragAndDrop.Droppable('droptarget2',{accept:['box'],ondrop:function(){alert('drop!')}});
// ]]>
</script>


</body>
</html>