Changeset 13971


Ignore:
Timestamp:
2007-03-12T16:27:18+13:00 (17 years ago)
Author:
kjdon
Message:

document.dm added flash plugin for veronica's turning the pages thing, pref.dm added a switch in preferences to display docs using this plugin

Location:
trunk/gsdl/macros
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/document.dm

    r13534 r13971  
    189189_collagecaption_
    190190</center>
    191 
    192 }
    193 
     191}
     192
     193
     194_flashbook_ {
     195 <div id="bookdiv">
     196 </div>
     197
     198 <script type="text/javascript">
     199 //get the height and width of the window
     200 var myWidth = 0, myHeight = 0;
     201 if (typeof(window.innerWidth) == 'number')
     202 \{
     203    //Non-IE
     204    myWidth = window.innerWidth;
     205    myHeight = window.innerHeight;
     206 \}
     207 else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
     208 \{
     209    //IE 6+ in 'standards compliant mode'
     210    myWidth = document.documentElement.clientWidth;
     211    myHeight = document.documentElement.clientHeight;
     212 \}
     213 else if(document.body && (document.body.clientWidth || document.body.clientHeight))
     214 \{
     215    //IE 4 compatible
     216    myWidth = document.body.clientWidth;
     217    myHeight = document.body.clientHeight;
     218 \}
     219 
     220 var img_cover = '_httpcollimg_/_thisOID_/cover.jpg';
     221 var doc_url = document.URL;
     222 doc_url = doc_url.replace(/(&|\\?)book=[a-z]+/gi,'');
     223 doc_url += '&book=flashxml';
     224
     225 var flash_plug_html = "";
     226 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \\n';
     227 flash_plug_html += '  codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \\n';
     228 flash_plug_html += '  height="';
     229 flash_plug_html += myHeight + '" id="Book" swLiveConnect="true" \\n';
     230 flash_plug_html += '  width="';
     231 flash_plug_html += myWidth + '">\\n';
     232
     233 flash_plug_html += '    <PARAM name="allowScriptAccess" value="always" />\\n';
     234 flash_plug_html += '    <PARAM name="movie" value="_httpimg_/Book.swf';
     235 flash_plug_html += '?src_image=' + escape(img_cover);
     236 flash_plug_html += '&doc_url=' + escape(doc_url);
     237 flash_plug_html += '" />\\n';
     238 flash_plug_html += '    <PARAM name="quality" value="high" />\\n';
     239 flash_plug_html += '    <PARAM name="bgcolor" value="#FFFFFF" />\\n';
     240 flash_plug_html += '    <EMBED align="middle" \\n';
     241 flash_plug_html += '      allowScriptAccess="always" swLiveConnect="true" \\n';
     242 flash_plug_html += '      bgcolor="#FFFFFF" height="';
     243 flash_plug_html += myHeight + '" name="Book" \\n';
     244 flash_plug_html += '      pluginspage="http://www.macromedia.com/go/getflashplayer" \\n';
     245 flash_plug_html += '      quality="high" \\n';
     246 flash_plug_html += '      src="_httpimg_/Book.swf';
     247 flash_plug_html += '?src_image=' + escape(img_cover);
     248 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
     249 flash_plug_html += '"\\n';
     250 flash_plug_html += '      type="application/x-shockwave-flash" width="';
     251 flash_plug_html += myWidth + '" />\\n';
     252 flash_plug_html += '</OBJECT>\\n';
     253
     254 var flash_div = document.getElementById("bookdiv");
     255 flash_div.innerHTML = flash_plug_html;
     256 </script>
     257}
    194258
    195259#######################################################################
  • trunk/gsdl/macros/pref.dm

    r13578 r13971  
    257257\}
    258258
     259
     260function updatebook (value) \{
     261  href = location.href;
     262  if (href.match(/&book=[^&]+/))
     263  \{
     264    if (value == 0) 
     265        href = href.replace(/&book=[^&]+/, "&book=off");
     266    else
     267        href = href.replace(/&book=[^&]+/, "&book=on");
     268  \}
     269  else
     270  \{
     271    if (value == 0)
     272        href += "&book=off";
     273    else
     274        href += "&book=on";
     275  \}
     276  while (href.match(/&cc=[\\w]+/)) href = href.replace(/&cc=[\\w]+/, "");
     277  location.href = href + getargs();
     278\}
     279
    259280}
    260281
     
    456477}
    457478
     479
     480_bookoption_ {
     481<td valign=baseline>_textbookoption_</td>
     482<td><input type=radio name=book value=0 onClick="updatebook(0);"
     483        _If_("_cgiargbook_" eq "off", checked)>_textbookvieweroff_<br>
     484<input type=radio name=book value=1 onClick="updatebook(1);"
     485        _If_("_cgiargbook_" eq "on", checked)>_textbookvieweron_</td>
     486}
     487
     488# for [l=en]
     489_textbookoption_  {Book viewer mode}
     490_textbookvieweron_ {on}
     491_textbookvieweroff_ {off}
     492
    458493_content_ {
     494
    459495_optnavigationbar_
    460496_If_(_prefschanged_,<p>_prefschanged_<br><div class="divbar">&nbsp;</div>)
     
    532568_If_(_encodingoption_,<tr><td>_textencoding_</td><td>_encodingoption_</td></tr>)
    533569
    534 <tr>_formatoption_</tr></table>
     570<tr>_formatoption_</tr>
     571<tr>_bookoption_</tr>
     572</table>
    535573</blockquote>
    536574<div class="divbar">&nbsp;</div>
Note: See TracChangeset for help on using the changeset viewer.