Compare commits

..

No commits in common. "a99a3eee7a91f237559aaa8f5f5f18db004a5d72" and "47b348f72411d4450e7bb9fae72ee191cd278c03" have entirely different histories.

5 changed files with 20 additions and 51 deletions

View file

@ -59,7 +59,7 @@ Ox.PDFViewer = function(options, self) {
.attr({ .attr({
frameborder: 0, frameborder: 0,
height: self.options.height + 'px', height: self.options.height + 'px',
src: self.options.pdfjsURL + '?' + pandora.getVersion() + '&file=' + encodeURIComponent(self.options.url) + '#page=' + self.options.page, src: self.options.pdfjsURL + '?file=' + encodeURIComponent(self.options.url) + '#page=' + self.options.page,
width: self.options.width + 'px' width: self.options.width + 'px'
}) })
.onMessage(function(data, event) { .onMessage(function(data, event) {

View file

@ -253,7 +253,6 @@ appPanel
}); });
} }
}); });
window.pandora.getVersion = getPandoraVersion
} }
function loadPandoraFiles(callback) { function loadPandoraFiles(callback) {

View file

@ -33,9 +33,9 @@ See https://github.com/adobe-type-tools/cmap-resources
<script src="/static/oxjs/min/Ox.js"></script> <script src="/static/oxjs/min/Ox.js"></script>
<script src="embeds.js"></script> <script src="embeds.js"></script>
<link rel="stylesheet" href="pandora.css">
<link rel="stylesheet" href="viewer.css"> <link rel="stylesheet" href="viewer.css">
<link rel="stylesheet" href="pandora.css">
<script src="viewer.js"></script> <script src="viewer.js"></script>
</head> </head>

View file

@ -20,11 +20,9 @@
.verticalToolbarSeparator.hiddenMediumView, .verticalToolbarSeparator.hiddenMediumView,
#print, #print,
#secondaryPrint,
#openFile, #openFile,
#secondaryOpenFile,
#editorModeButtons { #editorModeButtons {
display: none !important; display: none;
} }
.page .crop-overlay { .page .crop-overlay {

View file

@ -29,35 +29,6 @@ embedPage.addEventListener("click", event => {
}); });
}) })
// secondary menu
div.innerHTML = `
<button id="secondaryCropFile" class="secondaryToolbarButton visibleMediumView cropFile" title="Crop" tabindex="50" data-l10n-id="crop">
<span data-l10n-id="crop_label">Crop</span>
</button>
`
var secondaryCropFile = div.querySelector("#secondaryCropFile")
document.querySelector('#secondaryToolbarButtonContainer').insertBefore(
secondaryCropFile,
document.querySelector('#secondaryToolbarButtonContainer').firstChild
)
div.innerHTML = `
<button id="secondaryEmbedPage" class="secondaryToolbarButton visibleMediumView embedPage" title="Embed" tabindex="50" data-l10n-id="embed">
<span data-l10n-id="embed_label">Embed</span>
</button>
`
var secondaryEmbedPage = div.querySelector("#secondaryEmbedPage")
document.querySelector('#secondaryToolbarButtonContainer').insertBefore(
secondaryEmbedPage,
document.querySelector('#secondaryToolbarButtonContainer').firstChild
)
secondaryEmbedPage.addEventListener("click", event => {
Ox.$parent.postMessage('embed', {
page: PDFViewerApplication.page
});
})
async function archiveAPI(action, data) { async function archiveAPI(action, data) {
var url = baseUrl + '/api/' var url = baseUrl + '/api/'
var key = JSON.stringify([action, data]) var key = JSON.stringify([action, data])
@ -209,22 +180,20 @@ const addToRecent = obj => {
} }
function initOverlay() { function initOverlay() {
document.querySelectorAll('#cropFile,.secondaryToolbarButton.cropFile').forEach(btn => { document.querySelector('#cropFile').addEventListener('click', event=> {
btn.addEventListener('click', event=> { if (cropInactive) {
if (cropInactive) { event.target.style.background = 'red'
event.target.style.background = 'red' cropInactive = false
cropInactive = false document.querySelectorAll('.crop-overlay.inactive').forEach(element => {
document.querySelectorAll('.crop-overlay.inactive').forEach(element => { element.classList.remove('inactive')
element.classList.remove('inactive') })
}) } else {
} else { event.target.style.background = ''
event.target.style.background = '' cropInactive = true
cropInactive = true document.querySelectorAll('.crop-overlay').forEach(element => {
document.querySelectorAll('.crop-overlay').forEach(element => { element.classList.add('inactive')
element.classList.add('inactive') })
}) }
}
})
}) })
var first = true var first = true
PDFViewerApplication.initializedPromise.then(function() { PDFViewerApplication.initializedPromise.then(function() {
@ -253,6 +222,9 @@ function initOverlay() {
div.appendChild(overlay) div.appendChild(overlay)
renderCropOverlay(overlay, documentId, page) renderCropOverlay(overlay, documentId, page)
}) })
PDFViewerApplication.pdfViewer.eventBus.on("pagechanging", function(event) {
console.log("pagechanging", event, event.pageNumber.toString())
})
}) })
} }