source: main/trunk/model-sites-dev/hauraki-dl/script/hdl-core.js@ 32597

Last change on this file since 32597 was 32597, checked in by davidb, 5 years ago

Reworking of the GS2 Hauraki DL as a GS3 site

File size: 3.8 KB
Line 
1
2
3function tidy_imgurl (gsurl,gstitle)
4{
5 var url = gsurl;
6 var cutpos = url.indexOf(" ");
7 if (cutpos>0) {
8 url=url.substring(0,cutpos);
9 }
10
11 var img = "<img src='" + url + "' alt='" + gstitle + "'>";
12 document.write(img);
13}
14
15
16function access_hrefurl (url)
17{
18 access_url = url.replace(/profile=(thumb|profile)/,"profile=access");
19
20 var img = "<a href='" + access_url + "'" + " alt='Click on image to view larger version of image'>";
21 document.write(img);
22}
23
24
25function mp_access_hrefurl (url)
26{
27 access_url = url.replace(/\?profile=(thumb|profile)/,"&profile=access");
28 access_url = access_url.replace(/digital.natlib.govt.nz\/get\//,"mp.natlib.govt.nz/image/?imageId=images-");
29
30 var img = "<a href='" + access_url + "'" + " alt='Click on image to view larger version of image'>";
31 document.write(img);
32}
33
34function mp_access_hrefurl_close ()
35{
36 document.write("</a>");
37}
38
39function mp_thumb_imgurl (thumb_id,url,title)
40{
41 thumb_url = url.replace(/\?profile=(thumb|profile)/,"&profile=thumb");
42 thumb_url = thumb_url.replace(/digital.natlib.govt.nz\/get\//,"mp.natlib.govt.nz/image/?imageId=images-");
43
44 //var img = "<img class='thumbnail_image' src='" + thumb_url + "'" + " alt='"+title+"'>";
45
46 thumb_img = $('#'+thumb_id);
47 thumb_img.attr('src',thumb_url);
48 thumb_img.attr('alt',title);
49
50 //document.write(img);
51}
52
53function mp_fullsize_imgurl (url,title,extra)
54{
55 thumb_url = url.replace(/\?profile=(thumb|profile)/,"&profile=access");
56 thumb_url = thumb_url.replace(/digital.natlib.govt.nz\/get\//,"mp.natlib.govt.nz/image/?imageId=images-");
57
58 if (thumb_url)
59 {
60 var img = "<img class='fullsize_image' src='" + thumb_url + "'" + " alt='"+title+"'>";
61 document.write(img);
62 }
63}
64
65function role_hrefurl (url)
66{
67 access_url = url.replace(/profile=(thumb|access)/,"role=PM");
68
69 var img = "<a href='" + access_url + "'" + " alt='Click on image to view larger version of image'>";
70 document.write(img);
71}
72
73//// Used in the Hauraki Photos collections
74var trcolchoice = ['#DAEFF7', '#FFFFFF'];
75var choice = 0;
76
77function trcolor()
78{
79 document.write('<tr bgcolor="' + trcolchoice[choice] + '">');
80 choice = (choice + 1) %2;
81}
82
83function trcolor_close()
84{
85 document.write('</tr>');
86}
87
88function restricted_image(id)
89{
90 var spanElem = document.getElementById(id);
91 spanElem.innerHTML = "<p>Image not available on-line.</p>";
92}
93
94function at_timeframes(refnum,text)
95{
96 var hrefXX = "http://timeframes.natlib.govt.nz/Search for " + refnum;
97 var href = "http://mp.natlib.govt.nz/Search Manuscripts and Portfolio for " + refnum;
98 var onclickXXXXXX = "javascript:window.open('http://timeframes.natlib.govt.nz/logicrouter/servlet/LogicRouter?OUTPUTXSL=simsearch.xslt&pm_BT=%28GKEY+%22" + refnum + "%22%29+&pm_MH=10&pm_USI=3&ds_svGeneric_DDF=Y&api_2=SIMULFIND&DIRECTIVE=createSrHist&ds_svGeneric_MH=10&pm_OPC=N&pm_CL=281&pm_CL=&pm_CL=&pm_CL=&pm_CL=&pm_CL=&api_1=COLLECTION_REPOLOGIN'";
99
100 var onclickXXXX = "javascript:window.open('http://find.natlib.govt.nz/primo_library/libweb/action/search.do?dscnt=0&fn=search&ct=search&vid=TF&vl(D31185043UI0)=any&indx=1&dum=true&vl(freeText0)=" + refnum + "&vl(35124698UI1)=all_items&srt=rank&vl(1UI0)=contains&frbg=&tab=default_tab&dstmp=1340939032280&mode=Basic&scp.scps=scope%3A(Timeframes)'";
101
102 var onclickXX = "javascript:window.open('https://natlib.govt.nz/items?utf8=%E2%9C%93&il%5Bcategory%5D=Images&text="+refnum+"1%2F2-115915-F)'"
103
104 var onclick = "javascript:window.open('http://mp.natlib.govt.nz/search/?l=en&q="+refnum+"&t=items&s=a'";
105 onclick += ",'natlib', 'toolbar=0,menubar=0,location=0,scrollbars=1,directories=0,width=1100,height=900'); return false";
106
107 var composit = '<a href="' + href + '" onclick="' + onclick + '">' + text + '</a>';
108
109 document.write(composit);
110}
111
Note: See TracBrowser for help on using the repository browser.