Last change
on this file since 33265 was 33265, checked in by davidb, 5 years ago |
Now takes an extra parameter, although the body of this particular version of the function does not need to use it
|
File size:
1.7 KB
|
Line | |
---|
1 |
|
---|
2 | function berryTitle(berryItem) {
|
---|
3 |
|
---|
4 | var title = berryItem.getAttribute('dc.Title');
|
---|
5 | if (title.length > 76){
|
---|
6 | title = title.substring(0,30)+" ... "+title.substr(title.length-45,45);
|
---|
7 | }
|
---|
8 |
|
---|
9 | return title;
|
---|
10 | }
|
---|
11 |
|
---|
12 |
|
---|
13 | function generateDocDisplay(li, doc, doc_id) {
|
---|
14 |
|
---|
15 | var a = document.createElement('a');
|
---|
16 | a.href=generateURL(doc);
|
---|
17 | a.appendChild(document.createTextNode(doc['dc.Title']));
|
---|
18 | li.appendChild(a);
|
---|
19 | }
|
---|
20 |
|
---|
21 |
|
---|
22 | function populateUrlsAndMetadata(parea){
|
---|
23 |
|
---|
24 | var fulltext="";
|
---|
25 | for (var i in docList){
|
---|
26 | var doc = docList[i];
|
---|
27 | var url = generateURL(doc)+"\n";
|
---|
28 |
|
---|
29 | var metadata = "";
|
---|
30 | if (doc['dc.Title']) {
|
---|
31 | metadata += gs.text.berry.doc_title+": "+doc['dc.Title']+"\n";
|
---|
32 | }
|
---|
33 |
|
---|
34 | if (doc['name']) {
|
---|
35 | metadata += gs.text.berry.doc_name+": "+doc['name']+"\n";
|
---|
36 | }
|
---|
37 | // if (doc['collection']) {
|
---|
38 | // metadata += gs.text.berry.doc_collection+": "+doc['collection']+"\n";
|
---|
39 | // }
|
---|
40 | if (doc['Date']) {
|
---|
41 | metadata += gs.text.berry.doc_date+": "+doc['Date']+"\n";
|
---|
42 | }
|
---|
43 | // allow for inclusion of custom metadata
|
---|
44 | // for (var m in doc) {
|
---|
45 | // if (!default_metas.includes(m)) {
|
---|
46 | // metadata += m +":" + doc[m]+"\n";
|
---|
47 | // }
|
---|
48 | // }
|
---|
49 | fulltext +=url+metadata+"\n";
|
---|
50 | }
|
---|
51 |
|
---|
52 | parea.value = fulltext;
|
---|
53 |
|
---|
54 | }
|
---|
55 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.