source: main/trunk/model-cols-dev/peijones/transform/pages/about-flip.xsl@ 24616

Last change on this file since 24616 was 24616, checked in by papitha, 13 years ago

Pei Jones - Collage included and Photo Notes included

File size: 5.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util">
9
10 <!-- the page content -->
11 <xsl:template match="/page">
12
13 <!--Display the description text of the current collection,
14 and if some services are available then create a list
15 of links for each service within a <ul id="servicelist"> element.-->
16 <table><tbody><tr><td style="width:60%;"><gslib:collectionDescriptionTextAndServicesLinks/></td>
17 <td>
18 <div id="Book" style="position:relative;">
19 <img src="placeholder.png" width="404"><xsl:text> </xsl:text></img>
20 </div>
21 </td></tr></tbody></table>
22
23 <script type="text/javascript">
24<xsl:text disable-output-escaping="yes">
25// 7 variables to control behavior
26 var Book_Image_Width=200;
27 var Book_Image_Height=280;
28 var Book_Border=true;
29 var Book_Border_Color="gray";
30 var Book_Speed=15;
31 var Book_NextPage_Delay=1500; //1 second=1000
32 var Book_Vertical_Turn=0;
33 var Book_Image_Sources = new Array();
34
35
36function getImages()
37{
38 var url = "?a=g&amp;s=GetAllImagesInCollection&amp;rt=r&amp;s1.extregex=(jpg|png)&amp;s1.c=" + gs.cgiParams.c + "&amp;o=xml";
39 var callback = {
40 success: function(data)
41 {
42 var xml = data.responseXML;
43
44 var imageList = xml.getElementsByTagName("image");
45
46 for(var i = 0; i &lt; imageList.length; i++)
47 {
48 var imageURL = imageList[i].firstChild.nodeValue;
49
50 imageURL = imageURL.replace(/\\/gi, "/");
51 imageURL = imageURL.replace(/%5C/gi, "/");
52 imageURL = imageURL.substring(imageURL.indexOf("sites"));
53
54 Book_Image_Sources.push(imageURL);
55 Book_Image_Sources.push(imageURL);
56 }
57
58 if(Book_Image_Sources.length &gt; 0)
59 {
60 ImageBook();
61 }
62 },
63 failed: function(data){alert("FAILED");}
64 };
65
66 YAHOO.util.Connect.asyncRequest("GET", url , callback);
67}
68
69/***************** DO NOT EDIT BELOW **********************************/
70 var B_LI,B_MI,B_RI,B_TI,B_Angle=0,B_CrImg=6,B_MaxW,B_Direction=1;
71 var B_MSz,B_Stppd=false;B_Pre_Img=new Array(Book_Image_Sources.length);
72
73 function ImageBook()
74 {
75 if(document.getElementById)
76 {
77 for(i=0;i&lt;Book_Image_Sources.length;i+=2)
78 {
79 B_Pre_Img[i]=new Image();B_Pre_Img[i].src=Book_Image_Sources[i]
80 }
81
82 Book_Div=document.getElementById("Book");
83 B_LI=document.createElement("img");Book_Div.appendChild(B_LI);
84 B_RI=document.createElement("img");Book_Div.appendChild(B_RI);
85 B_MI=document.createElement("img");Book_Div.appendChild(B_MI);
86
87 B_LI.style.position = B_MI.style.position = B_RI.style.position = "absolute";
88
89 B_LI.style.zIndex=B_RI.style.zIndex=0;B_MI.style.zIndex=1;
90
91 B_LI.style.top=(Book_Vertical_Turn?Book_Image_Height+1:-Book_Image_Height/3)+"px";
92 B_LI.style.left=0+"px";
93 B_MI.style.top=-Book_Image_Height/3+"px";
94 B_MI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
95 B_RI.style.top=-Book_Image_Height/3+"px";
96 B_RI.style.left=(Book_Vertical_Turn?0:Book_Image_Width+1)+"px";
97
98 B_LI.style.height=Book_Image_Height+"px";
99 B_MI.style.height=Book_Image_Height+"px";
100 B_RI.style.height=Book_Image_Height+"px";
101 B_LI.style.width=Book_Image_Width+"px";
102 B_MI.style.width=Book_Image_Width+"px";
103 B_RI.style.width=Book_Image_Width+"px";
104
105 if(Book_Border)
106 {
107 B_LI.style.borderStyle=B_MI.style.borderStyle=B_RI.style.borderStyle="solid";
108 B_LI.style.borderWidth=1+"px";
109 B_MI.style.borderWidth=1+"px";
110 B_RI.style.borderWidth=1+"px";
111 B_LI.style.borderColor=B_MI.style.borderColor=B_RI.style.borderColor=Book_Border_Color
112 }
113
114 B_LI.src=B_Pre_Img[0].src;
115 B_LI.lnk=Book_Image_Sources[1];
116 B_MI.src=B_Pre_Img[2].src;
117 B_MI.lnk=Book_Image_Sources[3];
118 B_RI.src=B_Pre_Img[4].src;
119 B_RI.lnk=Book_Image_Sources[5];
120 B_LI.onclick=B_MI.onclick=B_RI.onclick=B_LdLnk;
121 B_LI.onmouseover=B_MI.onmouseover=B_RI.onmouseover=B_Stp;
122 B_LI.onmouseout=B_MI.onmouseout=B_RI.onmouseout=B_Rstrt;
123 BookImages()
124 }
125 }
126
127 function BookImages(){
128 if(!B_Stppd)
129 {
130 if(Book_Vertical_Turn)
131 {
132 B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Height));
133 MidOffset=!B_Direction?Book_Image_Height+1:Book_Image_Height-B_MSz;
134 B_MI.style.top=MidOffset+"px";
135 B_MI.style.height=B_MSz+"px"
136 }
137 else
138 {
139 B_MSz=Math.abs(Math.round(Math.cos(B_Angle)*Book_Image_Width));
140 MidOffset=B_Direction?Book_Image_Width+1:Book_Image_Width-B_MSz;
141 B_MI.style.left=MidOffset+"px";
142 B_MI.style.width=B_MSz+"px"
143 }
144 B_Angle+=Book_Speed/720*Math.PI;
145 if(B_Angle&gt;=Math.PI/2&amp;&amp;B_Direction)
146 {
147 B_Direction=0;
148 if(B_CrImg==Book_Image_Sources.length)B_CrImg=0;
149 B_MI.src=B_Pre_Img[B_CrImg].src;
150 B_MI.lnk=Book_Image_Sources[B_CrImg+1];
151 B_CrImg+=2
152 }
153 if(B_Angle&gt;=Math.PI)
154 {
155 B_Direction=1;
156 B_TI=B_LI;
157 B_LI=B_MI;
158 B_MI=B_TI;
159 if(Book_Vertical_Turn)B_MI.style.top=0+"px";
160 else B_MI.style.left=Book_Image_Width+1+"px";
161 B_MI.src=B_RI.src;
162 B_MI.lnk=B_RI.lnk;
163
164 setTimeout("Book_Next_Delay()",Book_NextPage_Delay)
165 }
166 else
167 {
168 setTimeout("BookImages()",50)
169 }
170 }
171 else
172 {
173 setTimeout("BookImages()",50)
174 }
175 }
176
177 function Book_Next_Delay()
178 {
179 if(B_CrImg==Book_Image_Sources.length)
180 {
181 B_CrImg=0;
182 }
183
184 B_RI.src=B_Pre_Img[B_CrImg].src;
185 B_RI.lnk=Book_Image_Sources[B_CrImg+1];
186 B_MI.style.zIndex=2;
187 B_LI.style.zIndex=1;
188 B_Angle=0;
189 B_CrImg+=2;
190
191 setTimeout("BookImages()",50)
192 }
193
194 function B_LdLnk()
195 {
196 if(this.lnk)
197 {
198 window.location.href=this.lnk
199 }
200 }
201
202 function B_Stp()
203 {
204 B_Stppd=true;
205 this.style.cursor=this.lnk?"pointer":"default"
206 }
207
208 function B_Rstrt()
209 {
210 B_Stppd=false
211 }
212
213 window.onload=getImages;
214 </xsl:text>
215</script>
216
217 </xsl:template>
218
219
220</xsl:stylesheet>
221
Note: See TracBrowser for help on using the repository browser.