/[suikacvs]/www/test/support/result-svg.js
Suika

Contents of /www/test/support/result-svg.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Mon Jan 19 02:51:55 2009 UTC (16 years, 5 months ago) by wakaba
Branch: MAIN
CVS Tags: HEAD
File MIME type: application/javascript
Forgot to add to the CVS repository

1 function setResult (id, value) {
2 var rel = document.getElementById (id);
3 rel.textContent = 'FAIL (script error)';
4 rel.innerText = 'FAIL (script error)';
5 rel.setAttributeNS (null, 'class', 'FAIL'); // NOTE: 'className' setter does not work in Firefox 2.
6 var valueType = typeof value;
7 if (value === undefined) {
8 rel.textContent = '(undefined)';
9 rel.innerText = '(undefined)';
10 } else if (value === null) {
11 rel.textContent = '(null)';
12 rel.innerText = '(null)';
13 } else if (value === '') {
14 rel.textContent = '(empty)';
15 rel.innerText = '(empty)';
16 } else {
17 value = '' + value;
18 rel.textContent = '';
19 rel.innerText = '';
20 rel.appendChild (document.createElementNS
21 ('http://www.w3.org/2000/svg', 'tspan'))
22 .appendChild (document.createTextNode
23 (value.replace (/&/g, '&')
24 .replace (/\u0009/g, '	')
25 .replace (/\u000A/g, '
')
26 .replace (/\u000D/g, '
')));
27 }
28 rel.appendChild (document.createTextNode (', type ' + valueType));
29 rel.setAttributeNS (null, 'class', 'see-detail');
30 }

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24