Merge commit 'openlibrary/newui' into newui
authorLance Arthur <lance.arthur@archive.org>
Tue, 19 Oct 2010 23:36:41 +0000 (16:36 -0700)
committerLance Arthur <lance.arthur@archive.org>
Tue, 19 Oct 2010 23:36:41 +0000 (16:36 -0700)
BookReader/BookReader.css
BookReader/BookReader.js
BookReader/jquery.ui.ipad.js
BookReader/search.html [new file with mode: 0644]

index 28e4b82..c29358b 100644 (file)
@@ -103,13 +103,6 @@ a {
     background-color: rgb(234, 226, 205);
 }
 
-/* Disable selection on Firefox and WebKit */
-.BRnoselect {
-    -moz-user-select: none;
-    -webkit-user-select: none;
-    -webkit-user-drag: none;
-}
-
 .BRleafEdgeR {
     /*
     border-style: solid solid solid none;
@@ -830,15 +823,21 @@ div#BRzoombtn {
 
 .BRprogresspopup {
     position: absolute;
-    background-color: #E6E4E1;
+    background-color: #fff;
     font-size: 1.5em; 
     z-index: 3;   
     padding: 5px;
-    text-align: center;
+    border:10px solid #615132;
+    -webkit-border-radius:12px;
+    -moz-border-radius:12px;
+    border-radius:12px;
+    -moz-box-shadow: 1px 3px 10px #000;
+    -webkit-box-shadow: 1px 3px 10px #000;
+    box-shadow: 1px 3px 10px #000;
 }
 
 .BRprogressbar {
-    background-image: url(images/progressbar.gif);
+    background-image: url("images/progressbar.gif");
     background-repeat:no-repeat;
     background-position:center top;
 }
index 1efa4df..c4e9913 100644 (file)
@@ -5012,4 +5012,3 @@ BookReader.prototype.ttsStartPolling = function () {
             };
         });
     });
-
index c73a1bd..6ee5160 100644 (file)
 *
 * Project Home: 
 * http://code.google.com/p/jquery-ui-for-ipad-and-iphone/
-*/
-
-
-
-
-
-$(function() {
-
-       //
-
-       // Extend jQuery feature detection
-
-       //
-
-       $.extend($.support, {
-
-               touch: typeof Touch == "object"
-
-       });
-
-       
-
-       //
-
-       // Hook up touch events
-
-       //
-
-       if ($.support.touch) {
-
-               document.addEventListener("touchstart", iPadTouchHandler, false);
-
-               document.addEventListener("touchmove", iPadTouchHandler, false);
-
-               document.addEventListener("touchend", iPadTouchHandler, false);
-
-               document.addEventListener("touchcancel", iPadTouchHandler, false);
-
-       }
-
-});
-
-
-
-
-
-var lastTap = null;                    // Holds last tapped element (so we can compare for double tap)
-
-var tapValid = false;                  // Are we still in the .6 second window where a double tap can occur
-
-var tapTimeout = null;                 // The timeout reference
-
-
-
-function cancelTap() {
-
-       tapValid = false;
-
-}
-
-
-
-
-
-var rightClickPending = false; // Is a right click still feasible
-
-var rightClickEvent = null;            // the original event
-
-var holdTimeout = null;                        // timeout reference
-
-var cancelMouseUp = false;             // prevents a click from occuring as we want the context menu
-
-
-
-
-
-function cancelHold() {
-
-       if (rightClickPending) {
-
-               window.clearTimeout(holdTimeout);
-
-               rightClickPending = false;
-
-               rightClickEvent = null;
-
-       }
-
-}
-
-
-
-function startHold(event) {
-
-       if (rightClickPending)
-
-               return;
-
-
-
-       rightClickPending = true; // We could be performing a right click
-
-       rightClickEvent = (event.changedTouches)[0];
-
-       holdTimeout = window.setTimeout("doRightClick();", 800);
-
-}
-
-
-
-
-
-function doRightClick() {
-
-       rightClickPending = false;
-
-
-
-       //
-
-       // We need to mouse up (as we were down)
-
-       //
-
-       var first = rightClickEvent,
-
-               simulatedEvent = document.createEvent("MouseEvent");
-
-       simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                       false, false, false, false, 0, null);
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-       //
-
-       // emulate a right click
-
-       //
-
-       simulatedEvent = document.createEvent("MouseEvent");
-
-       simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                       false, false, false, false, 2, null);
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-       //
-
-       // Show a context menu
-
-       //
-
-       simulatedEvent = document.createEvent("MouseEvent");
-
-       simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5,
-
-                                  false, false, false, false, 2, null);
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-
-
-       //
-
-       // Note:: I don't mouse up the right click here however feel free to add if required
-
-       //
-
-
-
-
-
-       //cancelMouseUp = true; // XXXmang this was preventing swipe from working! make sure rest of code is okay with setting this false
-       cancelMouseUp = false;
-
-       rightClickEvent = null; // Release memory
-
-}
-
-
-
-
-
-//
-
-// mouse over event then mouse down
-
-//
-
-function iPadTouchStart(event) {
-
-       var touches = event.changedTouches,
-
-               first = touches[0],
-
-               type = "mouseover",
-
-               simulatedEvent = document.createEvent("MouseEvent");
-
-       //
-
-       // Mouse over first - I have live events attached on mouse over
-
-       //
-
-       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                            false, false, false, false, 0, null);
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-       type = "mousedown";
-
-       simulatedEvent = document.createEvent("MouseEvent");
-
-
-
-       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                            false, false, false, false, 0, null);
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-
-
-       if (!tapValid) {
-
-               lastTap = first.target;
-
-               tapValid = true;
-
-               tapTimeout = window.setTimeout("cancelTap();", 600);
-
-               startHold(event);
-
-       }
-
-       else {
-
-               window.clearTimeout(tapTimeout);
-
-
-
-               //
-
-               // If a double tap is still a possibility and the elements are the same
-
-               //      Then perform a double click
-
-               //
-
-               if (first.target == lastTap) {
-
-                       lastTap = null;
-
-                       tapValid = false;
-
-
-
-                       type = "click";
-
-                       simulatedEvent = document.createEvent("MouseEvent");
-
-
-
-                       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                               false, false, false, false, 0/*left*/, null);
-
-                       first.target.dispatchEvent(simulatedEvent);
-
-
-
-                       type = "dblclick";
-
-                       simulatedEvent = document.createEvent("MouseEvent");
-
-
-
-                       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                               false, false, false, false, 0/*left*/, null);
-
-                       first.target.dispatchEvent(simulatedEvent);
-
-               }
-
-               else {
-
-                       lastTap = first.target;
-
-                       tapValid = true;
-
-                       tapTimeout = window.setTimeout("cancelTap();", 600);
-
-                       startHold(event);
-
-               }
-
-       }
-
-}
-
-
-
-function iPadTouchHandler(event) {
-
-       var type = "",
-
-               button = 0; /*left*/
-
-
-
-       if (event.touches.length > 1)
-
-               return;
-
-
-
-       switch (event.type) {
-
-               case "touchstart":
-
-                       if ($(event.changedTouches[0].target).is("select")) {
-
-                               return;
-
-                       }
-
-                       iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/
-
-                       event.preventDefault();
-
-                       return false;
-
-                       break;
-
-
-
-               case "touchmove":
-
-                       cancelHold();
-
-                       type = "mousemove";
-
-                       event.preventDefault();
-
-                       break;
-
-
-
-               case "touchend":
-
-                       if (cancelMouseUp) {
-
-                               cancelMouseUp = false;
-
-                               event.preventDefault();
-
-                               return false;
-
-                       }
-
-                       cancelHold();
-
-                       type = "mouseup";
-
-                       break;
-
-
-
-               default:
-
-                       return;
-
-       }
-
-
-
-       var touches = event.changedTouches,
-
-               first = touches[0],
-
-               simulatedEvent = document.createEvent("MouseEvent");
-
-
-
-       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                            false, false, false, false, button, null);
-
-
-
-       first.target.dispatchEvent(simulatedEvent);
-
-
-
-       if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipads default behaviour (which we prevented)
-
-               simulatedEvent = document.createEvent("MouseEvent");            // This check avoids click being emulated on a double tap
-
-
-
-               simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,
-
-                            false, false, false, false, button, null);
-
-
-
-               first.target.dispatchEvent(simulatedEvent);
-
-       }
-
-}
-
-
-
-
-
+*/\r
+\r
+\r
+$(function() {\r
+       //\r
+       // Extend jQuery feature detection\r
+       //\r
+       $.extend($.support, {\r
+               touch: typeof Touch == "object"\r
+       });\r
+       \r
+       //\r
+       // Hook up touch events\r
+       //\r
+       if ($.support.touch) {\r
+               document.addEventListener("touchstart", iPadTouchHandler, false);\r
+               document.addEventListener("touchmove", iPadTouchHandler, false);\r
+               document.addEventListener("touchend", iPadTouchHandler, false);\r
+               document.addEventListener("touchcancel", iPadTouchHandler, false);\r
+       }\r
+});\r
+\r
+\r
+var lastTap = null;                    // Holds last tapped element (so we can compare for double tap)\r
+var tapValid = false;                  // Are we still in the .6 second window where a double tap can occur\r
+var tapTimeout = null;                 // The timeout reference\r
+\r
+function cancelTap() {\r
+       tapValid = false;\r
+}\r
+\r
+\r
+var rightClickPending = false; // Is a right click still feasible\r
+var rightClickEvent = null;            // the original event\r
+var holdTimeout = null;                        // timeout reference\r
+var cancelMouseUp = false;             // prevents a click from occuring as we want the context menu\r
+\r
+\r
+function cancelHold() {\r
+       if (rightClickPending) {\r
+               window.clearTimeout(holdTimeout);\r
+               rightClickPending = false;\r
+               rightClickEvent = null;\r
+       }\r
+}\r
+\r
+function startHold(event) {\r
+       if (rightClickPending)\r
+               return;\r
+\r
+       rightClickPending = true; // We could be performing a right click\r
+       rightClickEvent = (event.changedTouches)[0];\r
+       holdTimeout = window.setTimeout("doRightClick();", 800);\r
+}\r
+\r
+\r
+function doRightClick() {\r
+       rightClickPending = false;\r
+\r
+       //\r
+       // We need to mouse up (as we were down)\r
+       //\r
+       var first = rightClickEvent,\r
+               simulatedEvent = document.createEvent("MouseEvent");\r
+       simulatedEvent.initMouseEvent("mouseup", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                       false, false, false, false, 0, null);\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+       //\r
+       // emulate a right click\r
+       //\r
+       simulatedEvent = document.createEvent("MouseEvent");\r
+       simulatedEvent.initMouseEvent("mousedown", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                       false, false, false, false, 2, null);\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+       //\r
+       // Show a context menu\r
+       //\r
+       simulatedEvent = document.createEvent("MouseEvent");\r
+       simulatedEvent.initMouseEvent("contextmenu", true, true, window, 1, first.screenX + 50, first.screenY + 5, first.clientX + 50, first.clientY + 5,\r
+                                  false, false, false, false, 2, null);\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+\r
+       //\r
+       // Note:: I don't mouse up the right click here however feel free to add if required\r
+       //\r
+\r
+\r
+       cancelMouseUp = true;\r
+       rightClickEvent = null; // Release memory\r
+}\r
+\r
+\r
+//\r
+// mouse over event then mouse down\r
+//\r
+function iPadTouchStart(event) {\r
+       var touches = event.changedTouches,\r
+               first = touches[0],\r
+               type = "mouseover",\r
+               simulatedEvent = document.createEvent("MouseEvent");\r
+       //\r
+       // Mouse over first - I have live events attached on mouse over\r
+       //\r
+       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                            false, false, false, false, 0, null);\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+       type = "mousedown";\r
+       simulatedEvent = document.createEvent("MouseEvent");\r
+\r
+       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                            false, false, false, false, 0, null);\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+\r
+       if (!tapValid) {\r
+               lastTap = first.target;\r
+               tapValid = true;\r
+               tapTimeout = window.setTimeout("cancelTap();", 600);\r
+               startHold(event);\r
+       }\r
+       else {\r
+               window.clearTimeout(tapTimeout);\r
+\r
+               //\r
+               // If a double tap is still a possibility and the elements are the same\r
+               //      Then perform a double click\r
+               //\r
+               if (first.target == lastTap) {\r
+                       lastTap = null;\r
+                       tapValid = false;\r
+\r
+                       type = "click";\r
+                       simulatedEvent = document.createEvent("MouseEvent");\r
+\r
+                       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                               false, false, false, false, 0/*left*/, null);\r
+                       first.target.dispatchEvent(simulatedEvent);\r
+\r
+                       type = "dblclick";\r
+                       simulatedEvent = document.createEvent("MouseEvent");\r
+\r
+                       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                               false, false, false, false, 0/*left*/, null);\r
+                       first.target.dispatchEvent(simulatedEvent);\r
+               }\r
+               else {\r
+                       lastTap = first.target;\r
+                       tapValid = true;\r
+                       tapTimeout = window.setTimeout("cancelTap();", 600);\r
+                       startHold(event);\r
+               }\r
+       }\r
+}\r
+\r
+function iPadTouchHandler(event) {\r
+       var type = "",\r
+               button = 0; /*left*/\r
+\r
+       if (event.touches.length > 1)\r
+               return;\r
+\r
+       switch (event.type) {\r
+               case "touchstart":\r
+                       if ($(event.changedTouches[0].target).is("select")) {\r
+                               return;\r
+                       }\r
+                       iPadTouchStart(event); /*We need to trigger two events here to support one touch drag and drop*/\r
+                       event.preventDefault();\r
+                       return false;\r
+                       break;\r
+\r
+               case "touchmove":\r
+                       cancelHold();\r
+                       type = "mousemove";\r
+                       event.preventDefault();\r
+                       break;\r
+\r
+               case "touchend":\r
+                       if (cancelMouseUp) {\r
+                               cancelMouseUp = false;\r
+                               event.preventDefault();\r
+                               return false;\r
+                       }\r
+                       cancelHold();\r
+                       type = "mouseup";\r
+                       break;\r
+\r
+               default:\r
+                       return;\r
+       }\r
+\r
+       var touches = event.changedTouches,\r
+               first = touches[0],\r
+               simulatedEvent = document.createEvent("MouseEvent");\r
+\r
+       simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                            false, false, false, false, button, null);\r
+\r
+       first.target.dispatchEvent(simulatedEvent);\r
+\r
+       if (type == "mouseup" && tapValid && first.target == lastTap) { // This actually emulates the ipads default behaviour (which we prevented)\r
+               simulatedEvent = document.createEvent("MouseEvent");            // This check avoids click being emulated on a double tap\r
+\r
+               simulatedEvent.initMouseEvent("click", true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY,\r
+                            false, false, false, false, button, null);\r
+\r
+               first.target.dispatchEvent(simulatedEvent);\r
+       }\r
+}\r
+\r
+\r
diff --git a/BookReader/search.html b/BookReader/search.html
new file mode 100644 (file)
index 0000000..866cc35
--- /dev/null
@@ -0,0 +1,52 @@
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
+<html> 
+<head> 
+    <meta name="viewport" content="width=device-width, maximum-scale=1.0" /> 
+    <meta name="apple-mobile-web-app-capable" content="yes" /> 
+    <title>In the wake of the war canoe : a stirring record of forty years' successful labour, peril & adventure amongst the savage Indian tribes of the Pacific coast, and the piratical head-hunting Haidas of the Queen Charlotte Islands, B. C</title> 
+<!--[if lte IE 6]>
+    <meta http-equiv="refresh" content="2; URL=/bookreader/browserunsupported.php?id=wakewarcanoe00collrich">
+<![endif]--> 
+    <link rel="stylesheet" type="text/css" href="BookReader.css"> 
+    <script src="http://www.archive.org/includes/jquery-1.4.2.min.js" type="text/javascript"></script> 
+    <script type="text/javascript" src="jquery-ui-1.8.5.custom.min.js"></script> 
+    <script type="text/javascript" src="dragscrollable.js"></script> 
+    <script type="text/javascript" src="jquery.colorbox-min.js"></script> 
+    <script type="text/javascript" src="jquery.ui.ipad.js"></script> 
+     <!-- THIS ALLOWS BEAUTYTIPS TO WORK ON IE --> 
+        <!--[if lt IE 9]>
+        <script type="text/javascript" src="/includes/excanvas.compiled.js"></script>
+        <![endif]--> 
+    <script type="text/javascript" src="jquery.bt.min.js"></script> 
+    <script type="text/javascript" src="BookReader.js"></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> 
+</head> 
+<body style="background-color: ##939598;"> 
+<div id="BookReader">Internet Archive BookReader <noscript>requires JavaScript to be enabled.</noscript></div> 
+<script type="text/javascript"> 
+  // Set some config variables -- $$$ NB: Config object format has not been finalized
+  var brConfig = {};
+  brConfig["mode"] = 2;
+</script> 
+<!-- The script included below is dynamically generated JavaScript that includes the book metadata and page image access functions --> 
+<script type="text/javascript" src="http://ia700102.us.archive.org/~testflip/BookReader/BookReaderJSIA.php?id=wakewarcanoe00collrich&itemPath=/7/items/wakewarcanoe00collrich&server=ia700102.us.archive.org&subPrefix=wakewarcanoe00collrich"></script> 
+<script type="text/javascript"> 
+    // $$$ hack to workaround sizing bug when starting in two-up mode
+    $(document).ready(function() {
+        $(window).trigger('resize');
+    });
+    
+    // Usage stats
+    if(window.archive_analytics) { window.archive_analytics.values['bookreader'] = 'open'};
+</script> 
+