mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Removes B2G preprocessing directives.
This commit is contained in:
parent
1b847df2f3
commit
f3c3b1fc2d
9 changed files with 12 additions and 91 deletions
|
@ -31,11 +31,6 @@ var DEFAULT_PREFERENCES = {
|
|||
disableStream: false,
|
||||
disableAutoFetch: false,
|
||||
disableFontFace: false,
|
||||
//#if B2G
|
||||
//disableTextLayer: true,
|
||||
//useOnlyCssZoom: true
|
||||
//#else
|
||||
disableTextLayer: false,
|
||||
useOnlyCssZoom: false
|
||||
//#endif
|
||||
};
|
||||
|
|
|
@ -160,24 +160,6 @@ var Preferences = {
|
|||
}
|
||||
};
|
||||
|
||||
//#if B2G
|
||||
//Preferences._writeToStorage = function (prefObj) {
|
||||
// return new Promise(function (resolve) {
|
||||
// asyncStorage.setItem('pdfjs.preferences', JSON.stringify(prefObj),
|
||||
// resolve);
|
||||
// });
|
||||
//};
|
||||
//
|
||||
//Preferences._readFromStorage = function (prefObj) {
|
||||
// return new Promise(function (resolve) {
|
||||
// asyncStorage.getItem('pdfjs.preferences', function (prefStr) {
|
||||
// var readPrefs = JSON.parse(prefStr);
|
||||
// resolve(readPrefs);
|
||||
// });
|
||||
// });
|
||||
//};
|
||||
//#endif
|
||||
|
||||
//#if CHROME
|
||||
//Preferences._writeToStorage = function (prefObj) {
|
||||
// return new Promise(function (resolve) {
|
||||
|
@ -221,7 +203,7 @@ var Preferences = {
|
|||
//};
|
||||
//#endif
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G || CHROME)
|
||||
//#if !(FIREFOX || MOZCENTRAL || CHROME)
|
||||
Preferences._writeToStorage = function (prefObj) {
|
||||
return new Promise(function (resolve) {
|
||||
localStorage.setItem('pdfjs.preferences', JSON.stringify(prefObj));
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
* The way that the view parameters are stored depends on how PDF.js is built,
|
||||
* for 'node make <flag>' the following cases exist:
|
||||
* - FIREFOX or MOZCENTRAL - uses sessionStorage.
|
||||
* - B2G - uses asyncStorage.
|
||||
* - GENERIC or CHROME - uses localStorage, if it is available.
|
||||
*/
|
||||
var ViewHistory = (function ViewHistoryClosure() {
|
||||
|
@ -64,16 +63,12 @@ var ViewHistory = (function ViewHistoryClosure() {
|
|||
return new Promise(function (resolve) {
|
||||
var databaseStr = JSON.stringify(this.database);
|
||||
|
||||
//#if B2G
|
||||
// asyncStorage.setItem('database', databaseStr, resolve);
|
||||
//#endif
|
||||
|
||||
//#if FIREFOX || MOZCENTRAL
|
||||
// sessionStorage.setItem('pdfjsHistory', databaseStr);
|
||||
// resolve();
|
||||
//#endif
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G)
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
localStorage.setItem('database', databaseStr);
|
||||
resolve();
|
||||
//#endif
|
||||
|
@ -82,15 +77,11 @@ var ViewHistory = (function ViewHistoryClosure() {
|
|||
|
||||
_readFromStorage: function ViewHistory_readFromStorage() {
|
||||
return new Promise(function (resolve) {
|
||||
//#if B2G
|
||||
// asyncStorage.getItem('database', resolve);
|
||||
//#endif
|
||||
|
||||
//#if FIREFOX || MOZCENTRAL
|
||||
// resolve(sessionStorage.getItem('pdfjsHistory'));
|
||||
//#endif
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G)
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
resolve(localStorage.getItem('database'));
|
||||
//#endif
|
||||
});
|
||||
|
|
|
@ -36,13 +36,9 @@ var SCALE_SELECT_CONTAINER_PADDING = 8;
|
|||
var SCALE_SELECT_PADDING = 22;
|
||||
var PAGE_NUMBER_LOADING_INDICATOR = 'visiblePageIsLoading';
|
||||
var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;
|
||||
//#if B2G
|
||||
//PDFJS.useOnlyCssZoom = true;
|
||||
//PDFJS.disableTextLayer = true;
|
||||
//#endif
|
||||
|
||||
PDFJS.imageResourcesPath = './images/';
|
||||
//#if (FIREFOX || MOZCENTRAL || B2G || GENERIC || CHROME)
|
||||
//#if (FIREFOX || MOZCENTRAL || GENERIC || CHROME)
|
||||
//PDFJS.workerSrc = '../build/pdf.worker.js';
|
||||
//#endif
|
||||
//#if !PRODUCTION
|
||||
|
@ -58,18 +54,13 @@ var mozL10n = document.mozL10n || document.webL10n;
|
|||
//#include ui_utils.js
|
||||
//#include preferences.js
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G)
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
//#include mozPrintCallback_polyfill.js
|
||||
//#endif
|
||||
|
||||
//#if GENERIC || CHROME
|
||||
//#include download_manager.js
|
||||
//#endif
|
||||
//#if B2G
|
||||
//var DownloadManager = (function DownloadManagerClosure() {
|
||||
// return function DownloadManager() {};
|
||||
//})();
|
||||
//#endif
|
||||
|
||||
//#if FIREFOX || MOZCENTRAL
|
||||
//#include firefoxcom.js
|
||||
|
@ -475,9 +466,6 @@ var PDFViewerApplication = {
|
|||
return;
|
||||
}
|
||||
document.title = title;
|
||||
//#if B2G
|
||||
// document.getElementById('activityTitle').textContent = title;
|
||||
//#endif
|
||||
},
|
||||
|
||||
close: function pdfViewClose() {
|
||||
|
@ -560,10 +548,6 @@ var PDFViewerApplication = {
|
|||
loadingErrorMessage = mozL10n.get('unexpected_response_error', null,
|
||||
'Unexpected server response.');
|
||||
}
|
||||
//#if B2G
|
||||
// window.alert(loadingErrorMessage);
|
||||
// return window.close();
|
||||
//#endif
|
||||
|
||||
var moreInfo = {
|
||||
message: message
|
||||
|
@ -757,7 +741,7 @@ var PDFViewerApplication = {
|
|||
var id = this.documentFingerprint = pdfDocument.fingerprint;
|
||||
var store = this.store = new ViewHistory(id);
|
||||
|
||||
//#if (GENERIC || B2G)
|
||||
//#if GENERIC
|
||||
var baseDocumentUrl = null;
|
||||
//#endif
|
||||
//#if (FIREFOX || MOZCENTRAL)
|
||||
|
@ -1253,7 +1237,7 @@ function webViewerLoad(evt) {
|
|||
}
|
||||
|
||||
function webViewerInitialized() {
|
||||
//#if (GENERIC || B2G)
|
||||
//#if GENERIC
|
||||
var queryString = document.location.search.substring(1);
|
||||
var params = parseQueryString(queryString);
|
||||
var file = 'file' in params ? params.file : DEFAULT_URL;
|
||||
|
@ -2106,24 +2090,3 @@ window.addEventListener('afterprint', function afterPrint(evt) {
|
|||
window.requestAnimationFrame(resolve);
|
||||
});
|
||||
})();
|
||||
|
||||
//#if B2G
|
||||
//window.navigator.mozSetMessageHandler('activity', function(activity) {
|
||||
// var blob = activity.source.data.blob;
|
||||
// PDFJS.maxImageSize = 1024 * 1024;
|
||||
// var fileURL = activity.source.data.url ||
|
||||
// activity.source.data.filename ||
|
||||
// " "; // if no url or filename, use a non-empty string
|
||||
//
|
||||
// var url = URL.createObjectURL(blob);
|
||||
// // We need to delay opening until all HTML is loaded.
|
||||
// PDFViewerApplication.animationStartedPromise.then(function () {
|
||||
// PDFViewerApplication.open({url : url, originalUrl: fileURL});
|
||||
//
|
||||
// var header = document.getElementById('header');
|
||||
// header.addEventListener('action', function() {
|
||||
// activity.postResult('close');
|
||||
// });
|
||||
// });
|
||||
//});
|
||||
//#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue