/usr/share/doc/libjs-scriptaculous/test/unit/dragdrop_test.html is in libjs-scriptaculous 1.9.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | <!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 Unit test file</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="../../lib/prototype.js" type="text/javascript"></script>
<script src="../../src/scriptaculous.js" type="text/javascript"></script>
<script src="../../src/unittest.js" type="text/javascript"></script>
<link rel="stylesheet" href="../test.css" type="text/css" />
<style type="text/css" media="screen">
/* <![CDATA[ */
#div_absolute_test { position: absolute }
/* ]]> */
</style>
</head>
<body>
<h1>script.aculo.us Unit test file</h1>
<p>
Test of drag & drop functions in dragdrop.js
</p>
<!-- Log output -->
<div id="testlog"> </div>
<p id="p_test">p_test</p>
<p id="p_test2">p_test2</p>
<p id="p_test3">p_test3</p>
<img id="img_test" src="icon.png" alt="img_text"/>
<div id="droppable_test">droppable_test</div>
<div id="div_test">div_test</div>
<div id="div_absolute_test">div_absolute_test</div>
<div id="div_absolute_inline_test" style="position:absolute">div_absolute_inline_test</div>
<div id="droppable_container">
<div id="d1">droppable_test</div>
<div id="d2">droppable_test</div>
</div>
<div id="droppable_container_2">
<div id="d3">droppable_test</div>
</div>
<!-- Tests follow -->
<script type="text/javascript" language="javascript" charset="utf-8">
// <![CDATA[
new Test.Unit.Runner({
testDraggableBasics: function() { with(this) {
var d = new Draggable('p_test');
assertInstanceOf(Draggable, d);
}},
testDraggableStartEffect: function() { with(this) {
var d = new Draggable('p_test2');
assert(d.options.starteffect, 'There should be a default start effect.');
d = new Draggable('p_test3', { endeffect: Prototype.EmptyFunction });
assert(undefined === d.options.startEffect, 'There should be no default start effect.');
}},
testAutoPositioning: function() { with(this) {
assertEqual('static', Element.getStyle('div_test','position'));
new Draggable('div_test');
new Draggable('div_absolute_test');
new Draggable('div_absolute_inline_test');
assertEqual('relative', Element.getStyle('div_test','position'));
assertEqual('absolute', Element.getStyle('div_absolute_test','position'));
assertEqual('absolute', Element.getStyle('div_absolute_inline_test','position'));
}},
testDroppbalesBasics: function() { with(this) {
assertEqual(0, Droppables.drops.length);
assertEqual('static', Element.getStyle('droppable_test','position'));
Droppables.add('droppable_test');
assertEqual(1, Droppables.drops.length);
assertEqual('relative', Element.getStyle('droppable_test','position'));
Droppables.remove('droppable_test');
assertEqual(0, Droppables.drops.length);
// accept option should take strings or array of strings
Droppables.add('droppable_test',{accept:'document'});
assertEqual(['document'].inspect(), Droppables.drops[0].accept.inspect());
Droppables.remove('droppable_test');
Droppables.add('droppable_test',{accept:['document','image']});
assertEqual(['document','image'].inspect(), Droppables.drops[0].accept.inspect());
Droppables.remove('droppable_test');
}},
testDroppableContainment: function() { with(this) {
// Droppable containers should be cached
Droppables.add('droppable_test', {
containment:'droppable_container' });
assertEqual(1, Droppables.drops[0]._containers.length);
assertEqual($('droppable_container'), Droppables.drops[0]._containers[0]);
assert(Droppables.isContained($('d1'), Droppables.drops[0]));
assert(Droppables.isContained($('d2'), Droppables.drops[0]));
assert(!Droppables.isContained($('d3'), Droppables.drops[0]));
Droppables.remove('droppable_test');
Droppables.add('droppable_test', {
containment:['droppable_container','droppable_container_2'] });
assertEqual(2, Droppables.drops[0]._containers.length);
assertEqual($('droppable_container'), Droppables.drops[0]._containers[0]);
assertEqual($('droppable_container_2'), Droppables.drops[0]._containers[1]);
assert(Droppables.isContained($('d1'), Droppables.drops[0]));
assert(Droppables.isContained($('d2'), Droppables.drops[0]));
assert(Droppables.isContained($('d3'), Droppables.drops[0]));
Droppables.remove('droppable_test');
}},
testDroppablesIsAffected: function() { with(this) {
Droppables.add('droppable_test');
Position.prepare();
assert(!Droppables.isAffected([-10, -10], null, Droppables.drops[0]));
var p = Position.page($('droppable_test'));
assert(Droppables.isAffected(p, null, Droppables.drops[0]));
}}
}, "testlog");
// ]]>
</script>
</body>
</html>
|