- Timestamp:
- 2011-05-17T12:19:08+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/oran/transform/document-scripts.xsl
r24009 r24018 169 169 { 170 170 var textDiv = document.getElementById("gs-document-text"); 171 textDiv.style. display = "none";171 textDiv.style.visibility = "hidden"; 172 172 } 173 173 … … 175 175 { 176 176 var textDiv = document.getElementById("gs-document-text"); 177 textDiv.style. display = "block";177 textDiv.style.visibility = "visible"; 178 178 } 179 179 … … 183 183 bookDiv.style.visibility = "hidden"; 184 184 bookDiv.style.height = "0px"; 185 186 var bookObject = document.getElementById("bookObject"); 187 bookObject.style.visibility = "hidden"; 188 bookObject.style.height = "0px"; 189 190 var bookEmbed = document.getElementById("bookEmbed"); 191 bookEmbed.style.visibility = "hidden"; 192 bookEmbed.style.height = "0px"; 185 193 } 186 194 … … 190 198 bookDiv.style.visibility = "visible"; 191 199 bookDiv.style.height = "600px"; 200 201 var bookObject = document.getElementById("bookObject"); 202 bookObject.style.visibility = "visible"; 203 bookObject.style.height = "600px"; 204 205 var bookEmbed = document.getElementById("bookEmbed"); 206 bookEmbed.style.visibility = "visible"; 207 bookEmbed.style.height = "600px"; 208 } 209 210 function swapLinkJavascript(rbOn) 211 { 212 var option = document.getElementById("rbOption"); 213 if(rbOn) 214 { 215 option.setAttribute("onclick", "hideText(); showBook(); swapLinkJavascript(false);"); 216 } 217 else 218 { 219 option.setAttribute("onclick", "hideBook(); showText(); swapLinkJavascript(true);"); 220 } 192 221 } 193 222 … … 201 230 } 202 231 203 function swapLinkJavascript(rbOn)204 {205 var option = document.getElementById("rbOption");206 if(rbOn)207 {208 option.setAttribute("onclick", "hideText(); showBook(); swapLinkJavascript(false);");209 }210 else211 {212 option.setAttribute("onclick", "hideBook(); showText(); swapLinkJavascript(true);");213 }214 }215 216 232 function loadBook() 217 233 { 218 //Work out the URL to the cover image and the document219 var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg<xsl:text disable-output-escaping="yes">';220 234 var doc_url = document.URL; 221 235 doc_url = doc_url.replace(/(&|\?)book=[a-z]+/gi,''); 222 doc_url += '&book=flashxml'; 223 224 //The outer OBJECT element 225 var objectElem = document.createElement("OBJECT"); 226 objectElem.setAttribute("align", "middle"); 227 objectElem.setAttribute("classid", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"); 228 objectElem.setAttribute("codebase", "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"); 229 objectElem.setAttribute("height", "600px"); 230 objectElem.setAttribute("width", "70%"); 231 objectElem.setAttribute("id", "bookObject"); 232 233 //Parameter list 234 var params = new Array(); 235 params[0] = createParam("allowScriptAccess", "always"); 236 params[1] = createParam("movie", "RealisticBook.swf?src_image=" + escape(img_cover) + "&doc_url=" + escape(doc_url)); 237 params[2] = createParam("quality", "high"); 238 params[3] = createParam("bgcolor", "#FFFFFF"); 239 240 //The embed element that goes into the object element 241 var embedElem = document.createElement("EMBED"); 242 embedElem.setAttribute("allowScriptAccess", "always"); 243 embedElem.setAttribute("swLiveConnect", "true"); 244 embedElem.setAttribute("bgcolor", "#FFFFFF"); 245 embedElem.setAttribute("height", "600px"); 246 embedElem.setAttribute("name", "Book"); 247 embedElem.setAttribute("pluginspage", "http://www.macromedia.com/go/getflashplayer"); 248 embedElem.setAttribute("quality", "high"); 249 embedElem.setAttribute("src", "RealisticBook.swf?src_image=" + escape(img_cover) + "&doc_url=" + escape(doc_url)); 250 embedElem.setAttribute("type", "application/x-shockwave-flash"); 251 embedElem.setAttribute("width", "70%"); 252 253 //Append the param and embed elements to the object element 254 for(var i = 0; i < params.length; i++) 255 { 256 objectElem.appendChild(params[i]); 257 } 258 objectElem.appendChild(embedElem); 259 260 //Append the object element to the page 261 var flashDiv = document.getElementById("bookdiv"); 262 flashDiv.appendChild(objectElem); 236 doc_url += '&book=flashxml'; 237 238 var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='assocfilepath']"/>/cover.jpg<xsl:text disable-output-escaping="yes">'; 239 240 var flash_plug_html = "" 241 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n'; 242 flash_plug_html += ' height="600px" id="bookObject" swLiveConnect="true" \n'; 243 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n'; 244 flash_plug_html += ' width="70%">\n'; 245 flash_plug_html += ' <PARAM name="allowScriptAccess" value="always" />\n'; 246 flash_plug_html += ' <PARAM name="movie" value="Book.swf'; 247 flash_plug_html += '?src_image=' + escape(img_cover); 248 flash_plug_html += '&doc_url=' + escape(doc_url) 249 flash_plug_html += '" />\n'; 250 flash_plug_html += ' <PARAM name="quality" value="high" />\n'; 251 flash_plug_html += ' <PARAM name="bgcolor" value="#FFFFFF" />\n'; 252 flash_plug_html += ' <EMBED align="middle" \n'; 253 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \n'; 254 flash_plug_html += ' bgcolor="#FFFFFF" height="600px" name="Book" \n'; 255 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \n'; 256 flash_plug_html += ' quality="high" id="bookEmbed"\n'; 257 flash_plug_html += ' src="Book.swf'; 258 flash_plug_html += '?src_image=' + escape(img_cover); 259 flash_plug_html += '&doc_url=' + escape(doc_url); 260 flash_plug_html += '"\n'; 261 flash_plug_html += ' type="application/x-shockwave-flash" width="70%" />\n'; 262 flash_plug_html += '</OBJECT>\n'; 263 var flash_div = document.getElementById("bookdiv"); 264 flash_div.innerHTML = flash_plug_html; 265 } 266 267 if(document.URL.indexOf("book=on") != -1) 268 { 269 loadBook(); 263 270 } 264 271 </xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.