/usr/share/pyshared/nevow/livetest-postscripts.js is in python-nevow 0.10.0-4build1.
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 | var testFrameNode = document.getElementById('testframe');
testFrameNode.addEventListener('load', loadNotify, true);
var sendSubmitEvent = function(theTarget, callWhenDone) {
var theEvent = testFrameNode.contentDocument.createEvent("HTMLEvents");
theEvent.initEvent("submit",
true,
true);
theTarget.dispatchEvent(theEvent);
callWhenDone()
}
var ifTesteeUsingLivePage = function(runThisCode, otherwise) {
if (testFrameNode.contentDocument.defaultView.listenForInputEvents) {
runThisCode()
} else {
otherwise()
}
}
var sendClickEvent = function(theTarget, callWhenDone) {
var doEventOfType = function(eventType) {
var theEvent = testFrameNode.contentDocument.createEvent("MouseEvents");
var evt = document.createEvent("MouseEvents")
evt.initMouseEvent(eventType,
true, //can bubble
true,
window,
1,
theTarget.offsetLeft + theTarget.offsetWidth / 2 + window.screenX, //screen x
theTarget.offsetTop + theTarget.offsetTop / 2 + window.screenY, //screen y
theTarget.offsetLeft + theTarget.offsetWidth / 2, //client x
theTarget.offsetTop + theTarget.offsetTop / 2, //client y
false,
false,
false,
false,
1,
theTarget);
theTarget.dispatchEvent(evt);
}
doEventOfType('mousedown');
doEventOfType('mouseup');
doEventOfType('click');
callWhenDone();
}
|