[Pkg-javascript-commits] [pdf.js] 63/204: Bug 1054643 - [B2G][PDF Viewer]PDF Viewer title is shown as blob:...
David Prévot
taffit at moszumanska.debian.org
Sat Oct 25 18:50:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit f40fa1ac2a7888307dc2200d822b6a500adfb654
Author: Manuel Casas Barrado <manuel.casasbarrado at telefonica.com>
Date: Wed Sep 10 08:17:19 2014 +0200
Bug 1054643 - [B2G][PDF Viewer]PDF Viewer title is shown as blob:...
---
web/viewer.js | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/web/viewer.js b/web/viewer.js
index 7a76085..f6c99fa 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -633,7 +633,7 @@ var PDFView = {
},
// TODO(mack): This function signature should really be pdfViewOpen(url, args)
- open: function pdfViewOpen(url, scale, password,
+ open: function pdfViewOpen(file, scale, password,
pdfDataRangeTransport, args) {
if (this.pdfDocument) {
// Reload the preferences if a document was previously opened.
@@ -642,11 +642,14 @@ var PDFView = {
this.close();
var parameters = {password: password};
- if (typeof url === 'string') { // URL
- this.setTitleUsingUrl(url);
- parameters.url = url;
- } else if (url && 'byteLength' in url) { // ArrayBuffer
- parameters.data = url;
+ if (typeof file === 'string') { // URL
+ this.setTitleUsingUrl(file);
+ parameters.url = file;
+ } else if (file && 'byteLength' in file) { // ArrayBuffer
+ parameters.data = file;
+ } else if (file.url && file.originalUrl) {
+ this.setTitleUsingUrl(file.originalUrl);
+ parameters.url = file.url;
}
if (args) {
for (var prop in args) {
@@ -2521,9 +2524,10 @@ window.addEventListener('afterprint', function afterPrint(evt) {
//window.navigator.mozSetMessageHandler('activity', function(activity) {
// var blob = activity.source.data.blob;
// PDFJS.maxImageSize = 1024 * 1024;
+// var fileURL = activity.source.data.url;
//
// var url = URL.createObjectURL(blob);
-// PDFView.open(url);
+// PDFView.open({url : url, originalUrl: fileURL});
//
// var header = document.getElementById('header');
// header.addEventListener('action', function() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list