source: DASISH/t5.6/client/branches/webannotator-basic-current-xsd/chrome/markingcollection/content/markingcollection/annotator-service/test/test-render-annotations.js @ 5703

Last change on this file since 5703 was 5703, checked in by stephanie.roth@snd.gu.se, 10 years ago

Initial commit of current status quo from GitHub. TODO: Adjust client code to work with updated xsd file.

  • Property svn:executable set to *
File size: 1.1 KB
Line 
1/*Holds test-renders for listing results from backend
2 *
3 *
4 */
5
6function listAnnotations(annotations){
7    $.each(annotations, function(i, annotation){
8        annotation.om_object = annotation2om_object(annotation);
9       
10        var output = '';
11        $.each( annotation, function( key, value ) {
12            if(key === 'om_object'){
13                output += '<strong>om_object</strong><br/>';
14                output += '<table>';
15               
16                $.each( value, function( k, v ) {
17                    if(k === 'oid_property'){
18                        output += '<tr><td>'+k+'</td><td><textarea cols="70" rows="4">'+v+'</textarea></td></tr>';
19                    }else{
20                        output += '<tr><td>'+k+'</td><td>'+v+'</td></tr>';
21                    }
22                });
23                output += '</table>';
24            }else{
25                output += '<span>'+key+': '+value+'</span><br/>';
26            }
27        });
28       
29        $("#annotations").append(
30                '<li>'+
31                    '<strong>'+annotation.body.text+'</strong><br/>'+
32                    output+
33                '</li>'
34        );
35    });
36}
Note: See TracBrowser for help on using the repository browser.