Merge pull request #5691 from Snuffleupagus/viewer-shadow

Use the |shadow| function from src/shared/util.js in viewer.js
This commit is contained in:
Tim van der Meij 2015-02-02 22:59:19 +01:00
commit ccf05c7a41
2 changed files with 15 additions and 37 deletions

View File

@ -325,6 +325,7 @@ function shadow(obj, prop, value) {
writable: false });
return value;
}
PDFJS.shadow = shadow;
var PasswordResponses = PDFJS.PasswordResponses = {
NEED_PASSWORD: 1,

View File

@ -299,12 +299,8 @@ var PDFViewerApplication = {
get supportsPrinting() {
var canvas = document.createElement('canvas');
var value = 'mozPrintCallback' in canvas;
// shadow
Object.defineProperty(this, 'supportsPrinting', { value: value,
enumerable: true,
configurable: true,
writable: false });
return value;
return PDFJS.shadow(this, 'supportsPrinting', value);
},
get supportsFullscreen() {
@ -319,59 +315,40 @@ var PDFViewerApplication = {
support = false;
}
Object.defineProperty(this, 'supportsFullscreen', { value: support,
enumerable: true,
configurable: true,
writable: false });
return support;
return PDFJS.shadow(this, 'supportsFullscreen', support);
},
get supportsIntegratedFind() {
var support = false;
//#if !(FIREFOX || MOZCENTRAL)
//#else
//#if (FIREFOX || MOZCENTRAL)
// support = FirefoxCom.requestSync('supportsIntegratedFind');
//#endif
Object.defineProperty(this, 'supportsIntegratedFind', { value: support,
enumerable: true,
configurable: true,
writable: false });
return support;
return PDFJS.shadow(this, 'supportsIntegratedFind', support);
},
get supportsDocumentFonts() {
var support = true;
//#if !(FIREFOX || MOZCENTRAL)
//#else
//#if (FIREFOX || MOZCENTRAL)
// support = FirefoxCom.requestSync('supportsDocumentFonts');
//#endif
Object.defineProperty(this, 'supportsDocumentFonts', { value: support,
enumerable: true,
configurable: true,
writable: false });
return support;
return PDFJS.shadow(this, 'supportsDocumentFonts', support);
},
get supportsDocumentColors() {
var support = true;
//#if !(FIREFOX || MOZCENTRAL)
//#else
//#if (FIREFOX || MOZCENTRAL)
// support = FirefoxCom.requestSync('supportsDocumentColors');
//#endif
Object.defineProperty(this, 'supportsDocumentColors', { value: support,
enumerable: true,
configurable: true,
writable: false });
return support;
return PDFJS.shadow(this, 'supportsDocumentColors', support);
},
get loadingBar() {
var bar = new ProgressBar('#loadingBar', {});
Object.defineProperty(this, 'loadingBar', { value: bar,
enumerable: true,
configurable: true,
writable: false });
return bar;
return PDFJS.shadow(this, 'loadingBar', bar);
},
//#if (FIREFOX || MOZCENTRAL)