()
| 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>" + |
| 105 | (viewerPlugin ? ("<p>Using the <a href = \""+ pluginURL + "\" target=\"_blank\">" + pluginName + "</a> " + |
| 106 | "(<span id = \"pluginVersion\">" + pluginVersion + "</span>) " + |
| 107 | "plugin to show you this document.</p>") |
| 108 | : "") + |
| 109 | "<p>Version " + version + "</p>" + |
| 110 | "<p>Supported by <a href=\"https://nlnet.nl\" target=\"_blank\"><br><img src=\"images\/nlnet.png\" width=\"160\" height=\"60\" alt=\"NLnet Foundation\"></a></p>" + |
| 111 | "<p>Made by <a href=\"http://kogmbh.com\" target=\"_blank\"><br><img src=\"images\/kogmbh.png\" width=\"172\" height=\"40\" alt=\"KO GmbH\"></a></p>" + |
| 112 | "<button id = \"aboutDialogCloseButton\" class = \"toolbarButton textButton\">Close</button>"; |
| 113 | dialogOverlay.appendChild(aboutDialogCentererTable); |
| 114 | aboutDialogCentererTable.appendChild(aboutDialogCentererCell); |
| 115 | aboutDialogCentererCell.appendChild(aboutDialog); |
| 116 | |
| 117 | // Create button to open dialog that says "ViewerJS" |
| 118 | aboutButton = document.createElement('button'); |
| 119 | aboutButton.id = "about"; |
| 120 | aboutButton.className = "toolbarButton textButton about"; |
| 121 | aboutButton.title = "About"; |
| 122 | aboutButton.innerHTML = "ViewerJS" |
| 123 | toolbarRight.appendChild(aboutButton); |
| 124 | |
| 125 | // Attach events to the above |
| 126 | aboutButton.addEventListener('click', function () { |
| 127 | showAboutDialog(); |
| 128 | }); |
| 129 | document.getElementById('aboutDialogCloseButton').addEventListener('click', function () { |
| 130 | hideAboutDialog(); |
| 131 | }); |
| 132 | |
| 133 | } |
| 134 | |
| 135 | function showAboutDialog() { |
| 136 | dialogOverlay.style.display = "block"; |
no test coverage detected