/usr/share/doc/libjs-mochikit/tests/test_MochiKit-Visual.html is in libjs-mochikit 1.4.2-4.
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 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | <html>
<head>
<script type="text/javascript" src="../lib/MochiKit/Base.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Iter.js"></script>
<script type="text/javascript" src="../lib/MochiKit/DOM.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Async.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Style.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Color.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Signal.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Position.js"></script>
<script type="text/javascript" src="../lib/MochiKit/Visual.js"></script>
<script type="text/javascript" src="SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="SimpleTest/test.css">
<style type="text/css">
#elt1, #elt2, #ctn1 {
visibility: hidden;
font-size: 1em;
margin: 2px;
}
#elt3 {
display: none;
}
#ctn1 {
height: 2px;
}
</style>
</head>
<body>
<div id='elt1'>elt1</div>
<div id='ctn1'><div id='elt2'></div></div>
<div id='elt3'>elt3</div>
<pre id="test">
<script type="text/javascript">
try {
var TestQueue = function () {
};
TestQueue.prototype = new MochiKit.Visual.ScopedQueue();
MochiKit.Base.update(TestQueue.prototype, {
startLoop: function (func, interval) {
this.started = true;
var timePos = new Date().getTime();
while (this.started) {
timePos += interval;
MochiKit.Base.map(function (effect) {
effect.loop(timePos);
}, this.effects);
}
},
stopLoop: function () {
this.started = false;
}
});
var gl = new TestQueue();
MochiKit.Visual.Queues.instances['global'] = gl;
MochiKit.Visual.Queues.instances['elt1'] = gl;
MochiKit.Visual.Queues.instances['elt2'] = gl;
MochiKit.Visual.Queues.instances['elt3'] = gl;
MochiKit.Visual.Queues.instances['ctn1'] = gl;
MochiKit.Visual.Queue = gl;
pulsate("elt1", {afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "pulsate ok");
}});
pulsate("elt1", {pulses: 2, afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "pulsate with numbered pulses ok");
}});
shake("elt1", {afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "shake ok");
}});
fade("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "fade ok");
}});
appear("elt1", {afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "appear ok");
}});
toggle("elt1", "size", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "toggle size ok");
}});
toggle("elt1", "size", {afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "toggle size reverse ok");
}});
Morph("elt1", {"style": {"font-size": "2em"}, afterFinish: function () {
is(getStyle("elt1", "font-size"), "2em", "Morph OK");
}});
Morph("elt1", {"style": {"font-size": "1em", "margin-left": "4px"}, afterFinish: function () {
is(getStyle("elt1", "font-size"), "1em", "Morph multiple (font) OK");
is(getStyle("elt1", "margin-left"), "4px", "Morph multiple (margin) OK");
}});
Morph("elt1", {"style": {"font-style": "italic"}, afterFinish: function () {
is(getStyle("elt1", "font-style"), "italic", "Morph generic property OK");
}});
switchOff("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "switchOff ok");
}});
grow("elt1", {afterFinish: function () {
is(getElement('elt1').style.display != 'none', true, "grow ok");
}});
shrink("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "shrink ok");
}});
showElement('elt1');
dropOut("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "dropOut ok");
}});
showElement('elt1');
puff("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "puff ok");
}});
showElement('elt1');
fold("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "fold ok");
}});
showElement('elt1');
squish("elt1", {afterFinish: function () {
is(getElement('elt1').style.display, 'none', "squish ok");
}});
slideUp("ctn1", {afterFinish: function () {
is(getElement('ctn1').style.display, 'none', "slideUp ok");
}});
slideDown("ctn1", {afterFinish: function () {
is(getElement('ctn1').style.display != 'none', true, "slideDown ok");
}});
blindDown("ctn1", {afterFinish: function () {
is(getElement('ctn1').style.display != 'none', true, "blindDown ok");
}});
blindUp("ctn1", {afterFinish: function () {
is(getElement('ctn1').style.display, 'none', "blindUp ok");
}});
multiple(["elt1", "ctn1"], appear, {afterFinish: function (effect) {
is(effect.element.style.display != 'none', true, "multiple ok");
}});
toggle("elt3", "size", {afterFinish: function () {
is(getElement('elt3').style.display != 'none', true, "toggle with css ok");
}});
toggle("elt3", "size", {afterFinish: function () {
is(getElement('elt3').style.display, 'none', "toggle with css ok");
}});
var toTests = [roundElement, roundClass, tagifyText, Opacity, Move, Highlight, ScrollTo, Morph];
for (var m in toTests) {
toTests[m]("elt1");
ok(true, toTests[m].NAME + " doesn't need 'new' keyword");
}
Scale("elt1", 1);
ok(true, "Scale doesn't need 'new' keyword");
ok(true, "visual suite finished");
} catch (err) {
var s = "test suite failure!\n";
var o = {};
var k = null;
for (k in err) {
// ensure unique keys?!
if (!o[k]) {
s += k + ": " + err[k] + "\n";
o[k] = err[k];
}
}
ok ( false, s );
SimpleTest.finish();
}
</script>
</pre>
</body>
</html>
|