Document properties

This commit is contained in:
Tim van der Meij 2014-01-22 00:07:07 +01:00
parent c6d201b13b
commit 5f7ded4ff6
10 changed files with 385 additions and 18 deletions

View File

@ -62,6 +62,26 @@ hand_tool_enable_label=Enable hand tool
hand_tool_disable.title=Disable hand tool hand_tool_disable.title=Disable hand tool
hand_tool_disable_label=Disable hand tool hand_tool_disable_label=Disable hand tool
# Document properties dialog box
document_properties.title=Document Properties
document_properties_label=Document Properties
document_properties_file_name=File name:
document_properties_file_size=File size:
document_properties_kb={{size_kb}} KB
document_properties_mb={{size_mb}} MB
document_properties_title=Title:
document_properties_author=Author:
document_properties_subject=Subject:
document_properties_keywords=Keywords:
document_properties_creation_date=Creation Date:
document_properties_modification_date=Modification Date:
document_properties_date_string={{date}}, {{time}}
document_properties_creator=Creator:
document_properties_producer=PDF Producer:
document_properties_version=PDF Version:
document_properties_page_count=Page Count:
document_properties_close=Close
# Tooltips and alt text for side panel toolbar buttons # Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are # (the _label strings are alt text for the buttons, the .title strings are
# tooltips) # tooltips)

View File

@ -62,6 +62,26 @@ hand_tool_enable_label=Handcursor inschakelen
hand_tool_disable.title=Handcursor uitschakelen hand_tool_disable.title=Handcursor uitschakelen
hand_tool_disable_label=Handcursor uitschakelen hand_tool_disable_label=Handcursor uitschakelen
# Document properties dialog box
document_properties.title=Documenteigenschappen
document_properties_label=Documenteigenschappen
document_properties_file_name=Bestandsnaam:
document_properties_file_size=Bestandsgrootte:
document_properties_kb={{size_kb}} KB
document_properties_mb={{size_mb}} MB
document_properties_title=Titel:
document_properties_author=Auteur:
document_properties_subject=Onderwerp:
document_properties_keywords=Trefwoorden:
document_properties_creation_date=Aanmaakdatum:
document_properties_modification_date=Wijzigingsdatum:
document_properties_date_string={{date}}, {{time}}
document_properties_creator=Toepassing:
document_properties_producer=PDF-producent:
document_properties_version=PDF-versie:
document_properties_page_count=Aantal pagina's:
document_properties_close=Sluiten
# Tooltips and alt text for side panel toolbar buttons # Tooltips and alt text for side panel toolbar buttons
# (the _label strings are alt text for the buttons, the .title strings are # (the _label strings are alt text for the buttons, the .title strings are
# tooltips) # tooltips)

View File

@ -925,10 +925,14 @@ var WorkerTransport = (function WorkerTransportClosure() {
}, },
dataLoaded: function WorkerTransport_dataLoaded() { dataLoaded: function WorkerTransport_dataLoaded() {
if (this.dataLoadedPromise) {
return this.dataLoadedPromise;
}
var promise = new PDFJS.LegacyPromise(); var promise = new PDFJS.LegacyPromise();
this.messageHandler.send('DataLoaded', null, function(args) { this.messageHandler.send('DataLoaded', null, function(args) {
promise.resolve(args); promise.resolve(args);
}); });
this.dataLoadedPromise = promise;
return promise; return promise;
}, },

179
web/document_properties.js Normal file
View File

@ -0,0 +1,179 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PDFView, mozL10n */
'use strict';
var DocumentProperties = {
overlayContainer: null,
fileSize: '',
visible: false,
// Document property fields (in the viewer).
fileNameField: null,
fileSizeField: null,
titleField: null,
authorField: null,
subjectField: null,
keywordsField: null,
creationDateField: null,
modificationDateField: null,
creatorField: null,
producerField: null,
versionField: null,
pageCountField: null,
initialize: function documentPropertiesInitialize(options) {
this.overlayContainer = options.overlayContainer;
// Set the document property fields.
this.fileNameField = options.fileNameField;
this.fileSizeField = options.fileSizeField;
this.titleField = options.titleField;
this.authorField = options.authorField;
this.subjectField = options.subjectField;
this.keywordsField = options.keywordsField;
this.creationDateField = options.creationDateField;
this.modificationDateField = options.modificationDateField;
this.creatorField = options.creatorField;
this.producerField = options.producerField;
this.versionField = options.versionField;
this.pageCountField = options.pageCountField;
// Bind the event listener for the Close button.
if (options.closeButton) {
options.closeButton.addEventListener('click', this.hide.bind(this));
}
},
getProperties: function documentPropertiesGetProperties() {
var self = this;
// Get the file size.
PDFView.pdfDocument.dataLoaded().then(function(data) {
self.setFileSize(data.length);
});
// Get the other document properties.
PDFView.pdfDocument.getMetadata().then(function(data) {
var fields = [
{ field: self.fileNameField, content: PDFView.url },
{ field: self.fileSizeField, content: self.fileSize },
{ field: self.titleField, content: data.info.Title },
{ field: self.authorField, content: data.info.Author },
{ field: self.subjectField, content: data.info.Subject },
{ field: self.keywordsField, content: data.info.Keywords },
{ field: self.creationDateField,
content: self.parseDate(data.info.CreationDate) },
{ field: self.modificationDateField,
content: self.parseDate(data.info.ModDate) },
{ field: self.creatorField, content: data.info.Creator },
{ field: self.producerField, content: data.info.Producer },
{ field: self.versionField, content: data.info.PDFFormatVersion },
{ field: self.pageCountField, content: PDFView.pdfDocument.numPages }
];
// Show the properties in the dialog.
for (var item in fields) {
var element = fields[item];
if (element.field && element.content !== undefined &&
element.content !== '') {
element.field.textContent = element.content;
}
}
});
},
setFileSize: function documentPropertiesSetFileSize(fileSize) {
var kb = Math.round(fileSize / 1024);
if (kb < 1024) {
this.fileSize = mozL10n.get('document_properties_kb',
{size_kb: kb}, '{{size_kb}} KB');
} else {
var mb = Math.round((kb / 1024) * 100) / 100;
this.fileSize = mozL10n.get('document_properties_mb',
{size_mb: mb}, '{{size_mb}} MB');
}
},
show: function documentPropertiesShow() {
if (this.visible) {
return;
}
this.visible = true;
this.overlayContainer.classList.remove('hidden');
this.overlayContainer.lastElementChild.classList.remove('hidden');
this.getProperties();
},
hide: function documentPropertiesClose() {
if (!this.visible) {
return;
}
this.visible = false;
this.overlayContainer.classList.add('hidden');
this.overlayContainer.lastElementChild.classList.add('hidden');
},
parseDate: function documentPropertiesParseDate(inputDate) {
// This is implemented according to the PDF specification (see
// http://www.gnupdf.org/Date for an overview), but note that
// Adobe Reader doesn't handle changing the date to universal time
// and doesn't use the user's time zone (they're effectively ignoring
// the HH' and mm' parts of the date string).
var dateToParse = inputDate;
if (dateToParse === undefined) {
return '';
}
// Remove the D: prefix if it is available.
if (dateToParse.substring(0,2) === 'D:') {
dateToParse = dateToParse.substring(2);
}
// Get all elements from the PDF date string.
// JavaScript's Date object expects the month to be between
// 0 and 11 instead of 1 and 12, so we're correcting for this.
var year = parseInt(dateToParse.substring(0,4), 10);
var month = parseInt(dateToParse.substring(4,6), 10) - 1;
var day = parseInt(dateToParse.substring(6,8), 10);
var hours = parseInt(dateToParse.substring(8,10), 10);
var minutes = parseInt(dateToParse.substring(10,12), 10);
var seconds = parseInt(dateToParse.substring(12,14), 10);
var utRel = dateToParse.substring(14,15);
var offsetHours = parseInt(dateToParse.substring(15,17), 10);
var offsetMinutes = parseInt(dateToParse.substring(18,20), 10);
// As per spec, utRel = 'Z' means equal to universal time.
// The other cases ('-' and '+') have to be handled here.
if (utRel == '-') {
hours += offsetHours;
minutes += offsetMinutes;
} else if (utRel == '+') {
hours -= offsetHours;
minutes += offsetMinutes;
}
// Return the new date format from the user's locale.
var date = new Date(Date.UTC(year, month, day, hours, minutes, seconds));
var dateString = date.toLocaleDateString();
var timeString = date.toLocaleTimeString();
return mozL10n.get('document_properties_date_string',
{date: dateString, time: timeString},
'{{date}}, {{time}}');
}
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -62,6 +62,7 @@ var PasswordPrompt = {
} }
this.visible = true; this.visible = true;
this.overlayContainer.classList.remove('hidden'); this.overlayContainer.classList.remove('hidden');
this.overlayContainer.firstElementChild.classList.remove('hidden');
this.passwordField.focus(); this.passwordField.focus();
var promptString = mozL10n.get('password_label', null, var promptString = mozL10n.get('password_label', null,
@ -82,6 +83,7 @@ var PasswordPrompt = {
this.visible = false; this.visible = false;
this.passwordField.value = ''; this.passwordField.value = '';
this.overlayContainer.classList.add('hidden'); this.overlayContainer.classList.add('hidden');
this.overlayContainer.firstElementChild.classList.add('hidden');
}, },
verifyPassword: function passwordPromptVerifyPassword() { verifyPassword: function passwordPromptVerifyPassword() {

View File

@ -26,6 +26,7 @@ var SecondaryToolbar = {
initialize: function secondaryToolbarInitialize(options) { initialize: function secondaryToolbarInitialize(options) {
this.toolbar = options.toolbar; this.toolbar = options.toolbar;
this.presentationMode = options.presentationMode; this.presentationMode = options.presentationMode;
this.documentProperties = options.documentProperties;
this.buttonContainer = this.toolbar.firstElementChild; this.buttonContainer = this.toolbar.firstElementChild;
// Define the toolbar buttons. // Define the toolbar buttons.
@ -39,6 +40,7 @@ var SecondaryToolbar = {
this.lastPage = options.lastPage; this.lastPage = options.lastPage;
this.pageRotateCw = options.pageRotateCw; this.pageRotateCw = options.pageRotateCw;
this.pageRotateCcw = options.pageRotateCcw; this.pageRotateCcw = options.pageRotateCcw;
this.documentPropertiesButton = options.documentPropertiesButton;
// Attach the event listeners. // Attach the event listeners.
var elements = [ var elements = [
@ -55,7 +57,9 @@ var SecondaryToolbar = {
{ element: this.firstPage, handler: this.firstPageClick }, { element: this.firstPage, handler: this.firstPageClick },
{ element: this.lastPage, handler: this.lastPageClick }, { element: this.lastPage, handler: this.lastPageClick },
{ element: this.pageRotateCw, handler: this.pageRotateCwClick }, { element: this.pageRotateCw, handler: this.pageRotateCwClick },
{ element: this.pageRotateCcw, handler: this.pageRotateCcwClick } { element: this.pageRotateCcw, handler: this.pageRotateCcwClick },
{ element: this.documentPropertiesButton,
handler: this.documentPropertiesClick }
]; ];
for (var item in elements) { for (var item in elements) {
@ -74,17 +78,17 @@ var SecondaryToolbar = {
openFileClick: function secondaryToolbarOpenFileClick(evt) { openFileClick: function secondaryToolbarOpenFileClick(evt) {
document.getElementById('fileInput').click(); document.getElementById('fileInput').click();
this.close(evt.target); this.close();
}, },
printClick: function secondaryToolbarPrintClick(evt) { printClick: function secondaryToolbarPrintClick(evt) {
window.print(); window.print();
this.close(evt.target); this.close();
}, },
downloadClick: function secondaryToolbarDownloadClick(evt) { downloadClick: function secondaryToolbarDownloadClick(evt) {
PDFView.download(); PDFView.download();
this.close(evt.target); this.close();
}, },
viewBookmarkClick: function secondaryToolbarViewBookmarkClick(evt) { viewBookmarkClick: function secondaryToolbarViewBookmarkClick(evt) {
@ -109,6 +113,11 @@ var SecondaryToolbar = {
PDFView.rotatePages(-90); PDFView.rotatePages(-90);
}, },
documentPropertiesClick: function secondaryToolbarDocumentPropsClick(evt) {
this.documentProperties.show();
this.close();
},
// Misc. functions for interacting with the toolbar. // Misc. functions for interacting with the toolbar.
setMaxHeight: function secondaryToolbarSetMaxHeight(container) { setMaxHeight: function secondaryToolbarSetMaxHeight(container) {
if (!container || !this.buttonContainer) { if (!container || !this.buttonContainer) {

View File

@ -585,7 +585,7 @@ html[dir='rtl'] .splitToolbarButton > .toolbarButton {
.splitToolbarButton > .toolbarButton:hover, .splitToolbarButton > .toolbarButton:hover,
.splitToolbarButton > .toolbarButton:focus, .splitToolbarButton > .toolbarButton:focus,
.dropdownToolbarButton:hover, .dropdownToolbarButton:hover,
.promptButton:hover, .overlayButton:hover,
.toolbarButton.textButton:hover, .toolbarButton.textButton:hover,
.toolbarButton.textButton:focus { .toolbarButton.textButton:focus {
background-color: hsla(0,0%,0%,.2); background-color: hsla(0,0%,0%,.2);
@ -642,7 +642,7 @@ html[dir='rtl'] .splitToolbarButtonSeparator {
.toolbarButton, .toolbarButton,
.dropdownToolbarButton, .dropdownToolbarButton,
.promptButton, .overlayButton,
.secondaryToolbarButton { .secondaryToolbarButton {
min-width: 16px; min-width: 16px;
padding: 2px 6px 0; padding: 2px 6px 0;
@ -665,12 +665,12 @@ html[dir='rtl'] .splitToolbarButtonSeparator {
} }
html[dir='ltr'] .toolbarButton, html[dir='ltr'] .toolbarButton,
html[dir='ltr'] .promptButton, html[dir='ltr'] .overlayButton,
html[dir='ltr'] .dropdownToolbarButton { html[dir='ltr'] .dropdownToolbarButton {
margin: 3px 2px 4px 0; margin: 3px 2px 4px 0;
} }
html[dir='rtl'] .toolbarButton, html[dir='rtl'] .toolbarButton,
html[dir='rtl'] .promptButton, html[dir='rtl'] .overlayButton,
html[dir='rtl'] .dropdownToolbarButton { html[dir='rtl'] .dropdownToolbarButton {
margin: 3px 0 4px 2px; margin: 3px 0 4px 2px;
} }
@ -678,7 +678,7 @@ html[dir='rtl'] .dropdownToolbarButton {
.toolbarButton:hover, .toolbarButton:hover,
.toolbarButton:focus, .toolbarButton:focus,
.dropdownToolbarButton, .dropdownToolbarButton,
.promptButton, .overlayButton,
.secondaryToolbarButton:hover, .secondaryToolbarButton:hover,
.secondaryToolbarButton:focus { .secondaryToolbarButton:focus {
background-color: hsla(0,0%,0%,.12); background-color: hsla(0,0%,0%,.12);
@ -692,7 +692,7 @@ html[dir='rtl'] .dropdownToolbarButton {
} }
.toolbarButton:hover:active, .toolbarButton:hover:active,
.promptButton:hover:active, .overlayButton:hover:active,
.dropdownToolbarButton:hover:active, .dropdownToolbarButton:hover:active,
.secondaryToolbarButton:hover:active { .secondaryToolbarButton:hover:active {
background-color: hsla(0,0%,0%,.2); background-color: hsla(0,0%,0%,.2);
@ -766,7 +766,7 @@ html[dir='rtl'] .dropdownToolbarButton {
background: hsl(0,0%,24%); background: hsl(0,0%,24%);
} }
.promptButton { .overlayButton {
margin: 3px 2px 4px 5px !important; margin: 3px 2px 4px 5px !important;
line-height: 16px; line-height: 16px;
padding: 2px 6px 3px 6px; padding: 2px 6px 3px 6px;
@ -1004,6 +1004,10 @@ html[dir="rtl"] .secondaryToolbarButton > span {
content: url(images/secondaryToolbarButton-handTool.png); content: url(images/secondaryToolbarButton-handTool.png);
} }
.secondaryToolbarButton.documentProperties::before {
content: url(images/secondaryToolbarButton-documentProperties.png);
}
.verticalToolbarSeparator { .verticalToolbarSeparator {
display: block; display: block;
padding: 8px 0; padding: 8px 0;
@ -1431,6 +1435,63 @@ canvas {
border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42); border-color: hsla(0,0%,0%,.32) hsla(0,0%,0%,.38) hsla(0,0%,0%,.42);
} }
#documentPropertiesContainer {
display: table-cell;
vertical-align: middle;
text-align: center;
}
#documentPropertiesContainer > * {
display: inline-block;
padding: 15px;
border-spacing: 4px;
max-width: 350px;
max-height: 350px;
color: hsl(0,0%,85%);
font-size: 12px;
line-height: 14px;
text-align: left;
cursor: default;
background-color: #474747; /* fallback */
background-image: url(images/texture.png),
linear-gradient(hsla(0,0%,32%,.99), hsla(0,0%,27%,.95));
box-shadow: inset 1px 0 0 hsla(0,0%,100%,.08),
inset 0 1px 1px hsla(0,0%,0%,.15),
inset 0 -1px 0 hsla(0,0%,100%,.05),
0 1px 0 hsla(0,0%,0%,.15),
0 1px 1px hsla(0,0%,0%,.1);
}
#documentPropertiesContainer .separator {
display: block;
margin: 4px 0 4px 0;
height: 1px;
width: 100%;
background-color: hsla(0,0%,0%,.5);
box-shadow: 0 0 0 1px hsla(0,0%,100%,.08);
}
#documentPropertiesContainer .row {
display: table-row;
}
html[dir='ltr'] #documentPropertiesContainer .row > * {
display: table-cell;
min-width: 100px;
}
html[dir='rtl'] #documentPropertiesContainer .row > * {
display: table-cell;
min-width: 100px;
text-align: right;
}
#documentPropertiesContainer .buttonRow {
margin-top: 10px;
text-align: center;
vertical-align: middle;
}
.clearBoth { .clearBoth {
clear: both; clear: both;
} }

View File

@ -77,6 +77,7 @@ limitations under the License.
<script type="text/javascript" src="presentation_mode.js"></script> <script type="text/javascript" src="presentation_mode.js"></script>
<script type="text/javascript" src="grab_to_pan.js"></script> <script type="text/javascript" src="grab_to_pan.js"></script>
<script type="text/javascript" src="hand_tool.js"></script> <script type="text/javascript" src="hand_tool.js"></script>
<script type="text/javascript" src="document_properties.js"></script>
<!--#endif--> <!--#endif-->
<script type="text/javascript" src="debugger.js"></script> <script type="text/javascript" src="debugger.js"></script>
@ -171,6 +172,12 @@ limitations under the License.
<button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="27" data-l10n-id="hand_tool_enable"> <button id="toggleHandTool" class="secondaryToolbarButton handTool" title="Enable hand tool" tabindex="27" data-l10n-id="hand_tool_enable">
<span data-l10n-id="hand_tool_enable_label">Enable hand tool</span> <span data-l10n-id="hand_tool_enable_label">Enable hand tool</span>
</button> </button>
<div class="horizontalToolbarSeparator"></div>
<button id="documentProperties" class="secondaryToolbarButton documentProperties" title="Document Properties" tabindex="28" data-l10n-id="document_properties">
<span data-l10n-id="document_properties_label">Document Properties</span>
</button>
</div> </div>
</div> <!-- secondaryToolbar --> </div> <!-- secondaryToolbar -->
@ -299,7 +306,7 @@ limitations under the License.
</div> <!-- mainContainer --> </div> <!-- mainContainer -->
<div id="overlayContainer" class="hidden"> <div id="overlayContainer" class="hidden">
<div id="promptContainer"> <div id="promptContainer" class="hidden">
<div id="passwordContainer" class="prompt doorHanger"> <div id="passwordContainer" class="prompt doorHanger">
<div class="row"> <div class="row">
<p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p> <p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
@ -307,13 +314,58 @@ limitations under the License.
<div class="row"> <div class="row">
<input type="password" id="password" class="toolbarField" /> <input type="password" id="password" class="toolbarField" />
</div> </div>
<div class="buttonRow">
<button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>
<button id="passwordSubmit" class="overlayButton"><span data-l10n-id="password_ok">OK</span></button>
</div>
</div>
</div>
<div id="documentPropertiesContainer" class="hidden">
<div class="doorHanger">
<div class="row"> <div class="row">
<button id="passwordCancel" class="promptButton"><span data-l10n-id="password_cancel">Cancel</span></button> <span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p>
<button id="passwordSubmit" class="promptButton"><span data-l10n-id="password_ok">OK</span></button> </div>
</div> <div class="row">
<span data-l10n-id="document_properties_file_size">File size:</span> <p id="fileSizeField">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_title">Title:</span> <p id="titleField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_author">Author:</span> <p id="authorField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_subject">Subject:</span> <p id="subjectField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_keywords">Keywords:</span> <p id="keywordsField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_creation_date">Creation Date:</span> <p id="creationDateField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_modification_date">Modification Date:</span> <p id="modificationDateField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_creator">Creator:</span> <p id="creatorField">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_producer">PDF Producer:</span> <p id="producerField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_version">PDF Version:</span> <p id="versionField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
</div>
<div class="buttonRow">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div> </div>
</div> </div>
</div> </div>
</div> <!-- overlayContainer -->
</div> <!-- outerContainer --> </div> <!-- outerContainer -->
<div id="printContainer"></div> <div id="printContainer"></div>

View File

@ -19,7 +19,7 @@
getFileName, scrollIntoView, getPDFFileNameFromURL, PDFHistory, getFileName, scrollIntoView, getPDFFileNameFromURL, PDFHistory,
Preferences, ViewHistory, PageView, ThumbnailView, Preferences, ViewHistory, PageView, ThumbnailView,
noContextMenuHandler, SecondaryToolbar, PasswordPrompt, noContextMenuHandler, SecondaryToolbar, PasswordPrompt,
PresentationMode, HandTool, Promise */ PresentationMode, HandTool, Promise, DocumentProperties */
'use strict'; 'use strict';
@ -90,6 +90,7 @@ var currentPageNumber = 1;
//#include password_prompt.js //#include password_prompt.js
//#include presentation_mode.js //#include presentation_mode.js
//#include hand_tool.js //#include hand_tool.js
//#include document_properties.js
var PDFView = { var PDFView = {
pages: [], pages: [],
@ -162,7 +163,9 @@ var PDFView = {
firstPage: document.getElementById('firstPage'), firstPage: document.getElementById('firstPage'),
lastPage: document.getElementById('lastPage'), lastPage: document.getElementById('lastPage'),
pageRotateCw: document.getElementById('pageRotateCw'), pageRotateCw: document.getElementById('pageRotateCw'),
pageRotateCcw: document.getElementById('pageRotateCcw') pageRotateCcw: document.getElementById('pageRotateCcw'),
documentProperties: DocumentProperties,
documentPropertiesButton: document.getElementById('documentProperties')
}); });
PasswordPrompt.initialize({ PasswordPrompt.initialize({
@ -182,6 +185,23 @@ var PDFView = {
pageRotateCcw: document.getElementById('contextPageRotateCcw') pageRotateCcw: document.getElementById('contextPageRotateCcw')
}); });
DocumentProperties.initialize({
overlayContainer: document.getElementById('overlayContainer'),
closeButton: document.getElementById('documentPropertiesClose'),
fileNameField: document.getElementById('fileNameField'),
fileSizeField: document.getElementById('fileSizeField'),
titleField: document.getElementById('titleField'),
authorField: document.getElementById('authorField'),
subjectField: document.getElementById('subjectField'),
keywordsField: document.getElementById('keywordsField'),
creationDateField: document.getElementById('creationDateField'),
modificationDateField: document.getElementById('modificationDateField'),
creatorField: document.getElementById('creatorField'),
producerField: document.getElementById('producerField'),
versionField: document.getElementById('versionField'),
pageCountField: document.getElementById('pageCountField')
});
this.initialized = true; this.initialized = true;
container.addEventListener('scroll', function() { container.addEventListener('scroll', function() {
self.lastScroll = Date.now(); self.lastScroll = Date.now();