MCPcopy Index your code
hub / github.com/webodf/ViewerJS / Viewer

Function Viewer

viewer.js:47–674  ·  view source on GitHub ↗
(viewerPlugin, parameters)

Source from the content-addressed store, hash-verified

45/*global document, window*/
46
47function Viewer(viewerPlugin, parameters) {
48 "use strict";
49
50 var self = this,
51 kScrollbarPadding = 40,
52 kMinScale = 0.25,
53 kMaxScale = 4.0,
54 kDefaultScaleDelta = 1.1,
55 kDefaultScale = 'auto',
56 presentationMode = false,
57 isFullScreen = false,
58 initialized = false,
59 url,
60 viewerElement = document.getElementById('viewer'),
61 canvasContainer = document.getElementById('canvasContainer'),
62 overlayNavigator = document.getElementById('overlayNavigator'),
63 titlebar = document.getElementById('titlebar'),
64 toolbar = document.getElementById('toolbarContainer'),
65 pageSwitcher = document.getElementById('toolbarLeft'),
66 zoomWidget = document.getElementById('toolbarMiddleContainer'),
67 scaleSelector = document.getElementById('scaleSelect'),
68 dialogOverlay = document.getElementById('dialogOverlay'),
69 toolbarRight = document.getElementById('toolbarRight'),
70 aboutDialog,
71 pages = [],
72 currentPage,
73 scaleChangeTimer,
74 touchTimer,
75 toolbarTouchTimer,
76 /**@const*/
77 UI_FADE_DURATION = 5000;
78
79 function isBlankedOut() {
80 return (blanked.style.display === 'block');
81 }
82
83 function initializeAboutInformation() {
84 var aboutDialogCentererTable, aboutDialogCentererCell, aboutButton, pluginName, pluginVersion, pluginURL,
85 version;
86
87 version = (String(typeof ViewerJS_version) !== "undefined" ? ViewerJS_version : "From Source");
88 if (viewerPlugin) {
89 pluginName = viewerPlugin.getPluginName();
90 pluginVersion = viewerPlugin.getPluginVersion();
91 pluginURL = viewerPlugin.getPluginURL();
92 }
93
94 // Create dialog
95 aboutDialogCentererTable = document.createElement('div');
96 aboutDialogCentererTable.id = "aboutDialogCentererTable";
97 aboutDialogCentererCell = document.createElement('div');
98 aboutDialogCentererCell.id = "aboutDialogCentererCell";
99 aboutDialog = document.createElement('div');
100 aboutDialog.id = "aboutDialog";
101 aboutDialog.innerHTML =
102 "<h1>ViewerJS</h1>" +
103 "<p>Open Source document viewer for webpages, built with HTML and JavaScript.</p>" +
104 "<p>Learn more and get your own copy on the <a href=\"http://viewerjs.org/\" target=\"_blank\">ViewerJS website</a>.</p>" +

Callers

nothing calls this directly

Calls 8

readZoomParameterFunction · 0.85
getPagesFunction · 0.85
readStartPageParameterFunction · 0.85
parseScaleFunction · 0.85
delayedRefreshFunction · 0.85
isBlankedOutFunction · 0.85
leaveBlankOutFunction · 0.85
initFunction · 0.70

Tested by

no test coverage detected