mirror of
https://github.com/webodf/WebODF.git
synced 2026-11-30 16:47:58 +01:00
* Reduced the number of getElementById calls for some often-used elements * Added canvasContainer.onscroll handling - which will call the onScroll of the viewer plugin, if present; for example for updating page numbers or updating the rendering (if we are using lazy loading) * Added a delayedRefresh() function which starts a timeout to run the onScroll() function for lazy rendering refresh, but unloads the previous timeout if delayedRefresh() is called again, so you can resize the window rapidly as much as you want and as long as you want and the rendering redraw will only happen 300 milliseconds after you stop doing that. (In case of ODF, this will still seem butter-smooth and continuously resizing because it's just CSS scaling, and no canvas redrawing since the onScroll of ODFViewerPlugin is not defined) * Added several small fixes suggested by Jos
69 lines
3.8 KiB
HTML
69 lines
3.8 KiB
HTML
<html dir="ltr" lang="en-US">
|
|
<head>
|
|
<link rel="stylesheet" type="text/css" href="viewer.css" media="screen"/>
|
|
<script src="webodf.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="ODFViewerPlugin.js" type="text/javascript" charset="utf-8"></script>
|
|
<script src="viewer.js" type="text/javascript" charset="utf-8"></script>
|
|
<script>
|
|
window.onload = function () {
|
|
viewer = new Viewer(new ODFViewerPlugin());
|
|
};
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id = "viewer">
|
|
<div id = "titlebar">
|
|
<div id = "documentName"></div>
|
|
</div>
|
|
<div id = "toolbarContainer">
|
|
<div id = "toolbar">
|
|
<div id = "toolbarLeft">
|
|
<div id = "navButtons" class = "splitToolbarButton">
|
|
<button id = "previous" class = "toolbarButton pageUp" title = "Previous Page"></button>
|
|
<div class="splitToolbarButtonSeparator"></div>
|
|
<button id = "next" class = "toolbarButton pageDown" title = "Next Page"></button>
|
|
</div>
|
|
<label id = "pageNumberLabel" class = "toolbarLabel" for = "pageNumber">Page:</label>
|
|
<input type = "number" id = "pageNumber" class = "toolbarField pageNumber"></input>
|
|
<span id = "numPages" class = "toolbarLabel"></span>
|
|
</div>
|
|
<div id = "toolbarMiddleContainer" class = "outerCenter">
|
|
<div id = "toolbarMiddle" class = "innerCenter">
|
|
<div id = 'zoomButtons' class = "splitToolbarButton">
|
|
<button id = "zoomOut" class = "toolbarButton zoomOut" title = "Zoom Out"></button>
|
|
<div class="splitToolbarButtonSeparator"></div>
|
|
<button id = "zoomIn" class = "toolbarButton zoomIn" title = "Zoom In"></button>
|
|
</div>
|
|
<span id="scaleSelectContainer" class="dropdownToolbarButton">
|
|
<select id="scaleSelect" title="Zoom" oncontextmenu="return false;">
|
|
<option id="pageAutoOption" value="auto" selected>Automatic</option>
|
|
<option id="pageActualOption" value="page-actual">Actual Size</option>
|
|
<option id="pageWidthOption" value="page-width">Full Width</option>
|
|
<option id="customScaleOption" value="custom"></option>
|
|
<option value="0.5">50%</option>
|
|
<option value="0.75">75%</option>
|
|
<option value="1">100%</option>
|
|
<option value="1.25">125%</option>
|
|
<option value="1.5">150%</option>
|
|
<option value="2">200%</option>
|
|
</select>
|
|
</span>
|
|
<div id = "sliderContainer">
|
|
<div id = "slider"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id = "toolbarRight">
|
|
<button id = "fullscreen" class = "toolbarButton fullscreen" title = "Fullscreen"></button>
|
|
<button id = "download" class = "toolbarButton download" title = "Download"></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id = "canvasContainer">
|
|
<div id = "canvas"></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|