Remove resize at document ready that was causing tiny pages in 2up mode on IE7. ...
[bookreader.git] / BookReaderIA / inc / BookReader.inc
index 809c146..94f6773 100644 (file)
@@ -102,7 +102,8 @@ class BookReader
     $version = "r28";
     
     if (BookReader::getDevHost($server)) {
-        // on dev host - add time to force reload
+        // On dev host - add time to force reload
+        // If debugging on IE, remove this line otherwise breakpoints will be invalid after reload
         $version .= '_' . time();
     }
     
@@ -131,16 +132,27 @@ class BookReader
 <? } /* uiMode */ ?>
     <script src="/includes/jquery-1.4.2.min.js" type="text/javascript"></script>
     <script type="text/javascript" src="/bookreader/jquery-ui-1.8.5.custom.min.js?v=<? echo($version); ?>"></script>
+    <script type="text/javascript" src="http://www.archive.org/includes/analytics.js?v=2"></script>
     <script type="text/javascript" src="/bookreader/dragscrollable.js?v=<? echo($version); ?>"></script>
     <script type="text/javascript" src="/bookreader/jquery.colorbox-min.js"></script>
+    <script type="text/javascript" src="/bookreader/jquery.ui.ipad.js"></script>
      <!-- THIS ALLOWS BEAUTYTIPS TO WORK ON IE -->
         <!--[if lt IE 9]>
-        <script type="text/javascript" src="excanvas.compiled.js"></script>
+        <script type="text/javascript" src="/includes/excanvas.compiled.js"></script>
         <![endif]-->
     <script type="text/javascript" src="/bookreader/jquery.bt.min.js"></script>
     <script type="text/javascript" src="/bookreader/BookReader.js?v=<? echo($version); ?>"></script>
+<? if ( !preg_match("/mobile/i", $_SERVER['HTTP_USER_AGENT']) ) { ?>
+    <script type="text/javascript" src="/bookreader/soundmanager/soundmanager2-ia.js?v=<? echo($version); ?>"></script>
+    <script>
+        soundManager.debugMode = false;
+        soundManager.url = '/bookreader/soundmanager/swf/';       
+        soundManager.useHTML5Audio = true;
+        soundManager.flashVersion = 9; //flash 8 version of swf is buggy when calling play() on a sound that is still loading
+    </script>
+<? } /* mobile user agent */ ?>
 </head>
-<body style="background-color: #FFFFFF;">
+<body style="background-color: ##939598;">
 
 <?
 /*
@@ -154,189 +166,6 @@ class BookReader
 
 <div id="BookReader">Internet Archive BookReader <noscript>requires JavaScript to be enabled.</noscript></div>
 
-<script type="text/javascript">
-// XXXmang
-$().ready(function(){
-    $('.chapter').bt({
-        contentSelector: '$(this).find(".title")',
-        trigger: 'hover',
-        closeWhenOthersOpen: true,
-        cssStyles: {
-            backgroundColor: '#000',
-            border: '2px solid #e2dcc5',
-            borderBottom: 'none',
-            padding: '5px 10px',
-            fontFamily: '"Arial", sans-serif',
-            fontSize: '11px',
-            fontWeight: '700',
-            color: '#fff',
-            whiteSpace: 'nowrap'
-        },
-        shrinkToFit: true,
-        width: '200px',
-        padding: 0,
-        spikeGirth: 0,
-        spikeLength: 0,
-        overlap: '16px',
-        overlay: false,
-        killTitle: true, 
-        textzIndex: 9999,
-        boxzIndex: 9998,
-        wrapperzIndex: 9997,
-        offsetParent: null,
-        positions: ['top'],
-        fill: 'black',
-        windowMargin: 10,
-        strokeWidth: 0,
-        cornerRadius: 0,
-        centerPointX: 0,
-        centerPointY: 0,
-        shadow: false
-    });
-    $('.search').bt({
-        contentSelector: '$(this).find(".query")',
-        trigger: 'click',
-        closeWhenOthersOpen: true,
-        cssStyles: {
-            padding: '10px 10px 15px',
-            backgroundColor: '#fff',
-            border: '3px solid #e2dcc5',
-            borderBottom: 'none',
-            fontFamily: '"Lucida Grande","Arial",sans-serif',
-            fontSize: '12px',
-            lineHeight: '18px',
-            color: '#615132'
-        },
-        shrinkToFit: false,
-        width: '230px',
-        padding: 0,
-        spikeGirth: 0,
-        spikeLength: 0,
-        overlap: '10px',
-        overlay: false,
-        killTitle: false, 
-        textzIndex: 9999,
-        boxzIndex: 9998,
-        wrapperzIndex: 9997,
-        offsetParent: null,
-        positions: ['top'],
-        fill: 'white',
-        windowMargin: 10,
-        strokeWidth: 3,
-        strokeStyle: '#e2dcc5',
-        cornerRadius: 0,
-        centerPointX: 0,
-        centerPointY: 0,
-        shadow: false
-    });
-    $('.searchChap').bt({
-        contentSelector: '$(this).find(".query")',
-        trigger: 'click',
-        closeWhenOthersOpen: true,
-        cssStyles: {
-            width: '250px',
-            padding: '10px 10px 15px',
-            backgroundColor: '#fff',
-            border: '3px solid #e2dcc5',
-            borderBottom: 'none',
-            fontFamily: '"Lucida Grande","Arial",sans-serif',
-            fontSize: '12px',
-            lineHeight: '18px',
-            color: '#615132'
-        },
-        shrinkToFit: false,
-        width: '230px',
-        padding: 0,
-        spikeGirth: 0,
-        spikeLength: 0,
-        overlap: '10px',
-        overlay: false,
-        killTitle: true, 
-        textzIndex: 9999,
-        boxzIndex: 9998,
-        wrapperzIndex: 9997,
-        offsetParent: null,
-        positions: ['top'],
-        fill: 'white',
-        windowMargin: 10,
-        strokeWidth: 3,
-        strokeStyle: '#e2dcc5',
-        cornerRadius: 0,
-        centerPointX: 0,
-        centerPointY: 0,
-        shadow: false
-    });
-    $('.chapter').each(function(){
-        $(this).hover(function(){
-            $(this).addClass('front');
-        },function(){
-            $(this).removeClass('front');
-        });
-    });
-    $('.search').each(function(){
-        $(this).hover(function(){
-            $(this).addClass('front');
-        },function(){
-            $(this).removeClass('front');
-        });
-    });
-    $('.searchChap').each(function(){
-        $(this).hover(function(){
-            $(this).addClass('front');
-        },function(){
-            $(this).removeClass('front');
-        });
-    });
-    $("#pager").draggable({axis:'x',containment:'parent'});
-});
-</script>
-<div id="BRnav">
-    <div id="BRnavpos">
-    <div id="pager"></div>
-        <div id="BRnavline"></div>
-<!-- LOAD SEARCH RESULTS FIRST SO CHAPTER INDICATORS CAN APPEAR IN FRONT -->
-        <div class="search" style="left:80%;" title="Search result">
-            <div class="query">The Kingdom of the Future, for instance, though interesting in a Caley Robinson way, with its cold, mystical colour relieved by touches of warm reddish browns, and its big draped figures, was a composition in the past, and did not stimulate the <strong><a href="">emotional</a></strong> powers of the observer with a suggestion of coming ages or a prophecy of progress. <span>Page 26</span></div>
-        </div>
-        
-        <div class="search" style="left:22%;" title="Search result">
-            <div class="query">A related distinction is between the emotion and the results of the emotion, principally behaviors and <strong><a href="">emotional</a></strong> expressions. People often behave in certain ways as a direct result of their <strong><a href="">emotional</a></strong> state, such as crying, fighting or fleeing. <span>Page 27</span></div>
-        </div>
-        
-        <div class="search" style="left:75%;" title="Search result">
-            <div class="query">A related distinction is between the emotion and the results of the emotion, principally behaviors and <strong><a href="">emotional</a></strong> expressions. People often behave in certain ways as a direct result of their <strong><a href="">emotional</a></strong> state, such as crying, fighting or fleeing. <span>Page 27</span></div>
-        </div>
-        
-        <div class="chapter" style="left:1%;">
-            <div class="title">I. The Minotaur <span>|</span> Page 1</div>
-        </div>
-        
-        <div class="chapter" style="left:17%;">
-            <div class="title">II. The Griffon <span>|</span> Page 44</div>
-        </div>
-        
-        <div class="chapter" style="left:30%;">
-            <div class="title">III. The Firedrake <span>|</span> Page 129</div>
-        </div>
-        
-        <div class="chapter" style="left:67.5%;">
-            <div class="title">V. The Pegasus <span>|</span> Page 201</div>
-        </div>
-        
-        <div class="chapter" style="left:90%;">
-            <div class="title">VI. The Goblin <span>|</span> Page 255</div>
-        </div>
-        
-        <div class="searchChap" style="left:49%;" title="Search result">
-            <div class="query">
-            A related distinction is between the emotion and the results of the emotion, principally behaviors and <strong><a href="">emotional</a></strong> expressions. People often behave in certain ways as a direct result of their <strong><a href="">emotional</a></strong> state, such as crying, fighting or fleeing. <span>Page 163</span>
-                <div class="queryChap">IV. The Witch <span>|</span> Page 163</div>
-            </div>
-        </div>
-        
-    </div>
-</div>
-
 <script type="text/javascript">
   // Set some config variables -- $$$ NB: Config object format has not been finalized
   var brConfig = {};
@@ -349,63 +178,9 @@ $().ready(function(){
 <? } ?>
 </script>
 <!-- The script included below is dynamically generated JavaScript that includes the book metadata and page image access functions -->
-<script type="text/javascript" src="<? echo($metaURL); ?>"></script>
-
-<? if ($uiMode == 'XXXmang was full') { ?>
-<div id="BookReaderSearch" style="width:190px; right:0px; top:10px; bottom:2em;">
-    <form action='javascript:' onsubmit="br.search($('#BookReaderSearchBox').val());">
-        <p style="display: inline">
-            <input id="BookReaderSearchBox" type="text" size="20" value="search..." onfocus="if('search...'==this.value)this.value='';" /><input type="submit" value="go" />
-        </p>
-    </form>
-    <div id="BookReaderSearchResults">
-        Search results
-    </div>
-</div>
-
-
-<div id="BRfooter">
-    <div class="BRlogotype">
-        <a href="http://archive.org/" class="BRblack">Internet Archive</a>
-    </div>
-    <div class="BRnavlinks">
-        <!-- <a class="BRblack" href="http://openlibrary.org/dev/docs/bookreader">About the Bookreader</a> | -->
-        <a class="BRblack" href="http://www.archive.org/about/faqs.php#Report_Item">Content Problems</a> |
-        <a class="BRblack" href="https://bugs.launchpad.net/bookreader/+filebug">Report Bugs</a> |
-        <a class="BRblack" href="http://www.archive.org/details/texts">Texts Collection</a> |
-        <a class="BRblack" href="http://www.archive.org/about/contact.php">Contact Us</a>
-    </div>
-</div>
-<? } /* uiMode */ ?>
-
-<script type="text/javascript">
-    // $$$ hack to workaround sizing bug when starting in two-up mode
-    $(document).ready(function() {
-        $(window).trigger('resize');
-    });
-    
-    //XXXmang
-   function hideFace() {
-        $('#BookReader').die('mousemove').live('mousemove',function(event) {
-            var toolpos = $('#BRtoolbar').offset();
-            var tooltop = toolpos.top;
-            var navkey = $(document).height() - 75;
-            if ((event.pageY < 76) || (event.pageY > navkey)) {
-                if (tooltop == -60) {
-                    $('#BRtoolbar').animate({top:'0'});
-                    $('#BRnav').animate({bottom:'0'});
-                };
-            } else if ($('.bt-wrapper').size() == 0) {
-                if (tooltop == 0) {
-                    $('#BRtoolbar').animate({top:'-60'});
-                    $('#BRnav').animate({bottom:'-60'});
-                }
-            };
-        });
-    };
-    window.onload = function() {
-        window.setTimeout(hideFace, 3000);
-    };
+<script type="text/javascript" src="<? echo($metaURL); ?>"></script>    
+    // Usage stats
+    if(window.archive_analytics) { window.archive_analytics.values['bookreader'] = 'open'};
 </script>
   <?
     exit;