Removes B2G preprocessing directives.
This commit is contained in:
parent
1b847df2f3
commit
f3c3b1fc2d
6
make.js
6
make.js
@ -70,7 +70,6 @@ var DEFINES = {
|
||||
GENERIC: false,
|
||||
FIREFOX: false,
|
||||
MOZCENTRAL: false,
|
||||
B2G: false,
|
||||
CHROME: false,
|
||||
MINIFIED: false,
|
||||
SINGLE_FILE: false,
|
||||
@ -985,8 +984,7 @@ target.b2g = function() {
|
||||
echo();
|
||||
echo('### Building B2G (Firefox OS App)');
|
||||
var B2G_BUILD_CONTENT_DIR = B2G_BUILD_DIR + '/content/';
|
||||
var defines = builder.merge(DEFINES, { B2G: true });
|
||||
target.bundle({ defines: defines });
|
||||
target.bundle();
|
||||
|
||||
// Clear out everything in the b2g build directory
|
||||
cd(ROOT_DIR);
|
||||
@ -999,7 +997,7 @@ target.b2g = function() {
|
||||
mkdir('-p', B2G_BUILD_CONTENT_DIR + '/pdfjs-components/cmaps');
|
||||
|
||||
var setup = {
|
||||
defines: defines,
|
||||
defines: DEFINES,
|
||||
copy: [
|
||||
['extensions/b2g/images', B2G_BUILD_CONTENT_DIR + '/web'],
|
||||
['extensions/b2g/viewer.html', B2G_BUILD_CONTENT_DIR + '/web'],
|
||||
|
@ -287,11 +287,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
|
||||
} else {
|
||||
|
||||
var getXhr = function getXhr() {
|
||||
//#if B2G
|
||||
// return new XMLHttpRequest({ mozSystem: true });
|
||||
//#else
|
||||
return new XMLHttpRequest();
|
||||
//#endif
|
||||
};
|
||||
this.networkManager = new NetworkManager(this.url, {
|
||||
getXhr: getXhr,
|
||||
|
@ -35,7 +35,7 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
|
||||
}
|
||||
|
||||
var alwaysUseUint32ArrayView = false;
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G || CHROME)
|
||||
//#if !(FIREFOX || MOZCENTRAL || CHROME)
|
||||
// old webkits have issues with non-aligned arrays
|
||||
try {
|
||||
new Uint32Array(new Uint8Array(5).buffer, 0, 1);
|
||||
|
@ -50,11 +50,7 @@ var NetworkManager = (function NetworkManagerClosure() {
|
||||
this.withCredentials = args.withCredentials || false;
|
||||
this.getXhr = args.getXhr ||
|
||||
function NetworkManager_getXhr() {
|
||||
//#if B2G
|
||||
// return new XMLHttpRequest({ mozSystem: true });
|
||||
//#else
|
||||
return new XMLHttpRequest();
|
||||
//#endif
|
||||
};
|
||||
|
||||
this.currXhrId = 0;
|
||||
|
@ -503,8 +503,8 @@ Object.defineProperty(PDFJS, 'isLittleEndian', {
|
||||
}
|
||||
});
|
||||
|
||||
//#if !(FIREFOX || MOZCENTRAL || B2G || CHROME)
|
||||
//// Lazy test if the userAgant support CanvasTypedArrays
|
||||
//#if !(FIREFOX || MOZCENTRAL || CHROME)
|
||||
//// Lazy test if the userAgent support CanvasTypedArrays
|
||||
function hasCanvasTypedArrays() {
|
||||
var canvas = document.createElement('canvas');
|
||||
canvas.width = canvas.height = 1;
|
||||
|
@ -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…
x
Reference in New Issue
Block a user