Parent: [ef14c6] (diff)

Child: [9d4d8f] (diff)

Download this file

containerscript.js    45 lines (43 with data), 1.4 kB

 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
// This script saves the location details when a mouse button is
// clicked. This is for replacing data provided by QWebElement on a
// right-click if/when we switch to QT WebEngine which does not have
// an equivalent service. This is always installed but only used if
// upplay is built with webengine (not the case and not possible for
// now)
var locDetails = '';
function saveLoc(ev)
{
el = ev.target;
locDetails = '';
while (el && el.attributes && !el.attributes.getNamedItem("objid")) {
// console.log('el: ' + el);
el = el.parentNode;
}
objid = el.attributes.getNamedItem("objid");
if (objid) {
objidvalue = objid.value;
} else {
objidvalue = "";
}
objidvalue = el.attributes.getNamedItem("objid").value;
objidx = el.attributes.getNamedItem("objidx");
if (objidx) {
objidxvalue = objidx.value;
} else {
objidxvalue = "";
}
otype = el.attributes.getNamedItem("class");
if (otype) {
otypevalue = otype.value
} else {
otypevalue = "";
}
if (el && el.attributes) {
locDetails =
'objid = ' + objidvalue + '\n' +
'title = ' + (el.textContent || el.innerText || "") + '\n' +
'objidx = ' + objidxvalue + '\n' +
'otype = ' + otypevalue + '\n';
}
//console.log(locDetails);
}