Merge pull request #8339 from Snuffleupagus/es6-ViewHistory
Convert the `ViewHistory` to an ES6 class, and re-factor it to make it properly asynchronous
This commit is contained in:
		
						commit
						19af5952c0
					
				
							
								
								
									
										121
									
								
								web/app.js
									
									
									
									
									
								
							
							
						
						
									
										121
									
								
								web/app.js
									
									
									
									
									
								
							@ -882,7 +882,7 @@ var PDFViewerApplication = {
 | 
				
			|||||||
    var pdfThumbnailViewer = this.pdfThumbnailViewer;
 | 
					    var pdfThumbnailViewer = this.pdfThumbnailViewer;
 | 
				
			||||||
    pdfThumbnailViewer.setDocument(pdfDocument);
 | 
					    pdfThumbnailViewer.setDocument(pdfDocument);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    firstPagePromise.then(function(pdfPage) {
 | 
					    firstPagePromise.then((pdfPage) => {
 | 
				
			||||||
      downloadedPromise.then(function () {
 | 
					      downloadedPromise.then(function () {
 | 
				
			||||||
        self.eventBus.dispatch('documentload', {source: self});
 | 
					        self.eventBus.dispatch('documentload', {source: self});
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
@ -905,58 +905,65 @@ var PDFViewerApplication = {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var initialParams = {
 | 
					      var initialParams = {
 | 
				
			||||||
        destination: self.initialDestination,
 | 
					        destination: this.initialDestination,
 | 
				
			||||||
        bookmark: self.initialBookmark,
 | 
					        bookmark: this.initialBookmark,
 | 
				
			||||||
        hash: null,
 | 
					        hash: null,
 | 
				
			||||||
      };
 | 
					      };
 | 
				
			||||||
 | 
					      var storedHash = this.viewerPrefs['defaultZoomValue'] ?
 | 
				
			||||||
 | 
					        ('zoom=' + this.viewerPrefs['defaultZoomValue']) : null;
 | 
				
			||||||
 | 
					      var sidebarView = this.viewerPrefs['sidebarViewOnLoad'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      store.initializedPromise.then(function resolved() {
 | 
					      new Promise((resolve, reject) => {
 | 
				
			||||||
        var storedHash = null, sidebarView = null;
 | 
					        if (!this.viewerPrefs['showPreviousViewOnLoad']) {
 | 
				
			||||||
        if (self.viewerPrefs['showPreviousViewOnLoad'] &&
 | 
					          resolve();
 | 
				
			||||||
            store.get('exists', false)) {
 | 
					          return;
 | 
				
			||||||
          var pageNum = store.get('page', '1');
 | 
					 | 
				
			||||||
          var zoom = self.viewerPrefs['defaultZoomValue'] ||
 | 
					 | 
				
			||||||
                     store.get('zoom', DEFAULT_SCALE_VALUE);
 | 
					 | 
				
			||||||
          var left = store.get('scrollLeft', '0');
 | 
					 | 
				
			||||||
          var top = store.get('scrollTop', '0');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          storedHash = 'page=' + pageNum + '&zoom=' + zoom + ',' +
 | 
					 | 
				
			||||||
                       left + ',' + top;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          sidebarView = store.get('sidebarView', SidebarView.NONE);
 | 
					 | 
				
			||||||
        } else if (self.viewerPrefs['defaultZoomValue']) {
 | 
					 | 
				
			||||||
          storedHash = 'page=1&zoom=' + self.viewerPrefs['defaultZoomValue'];
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        self.setInitialView(storedHash,
 | 
					        store.getMultiple({
 | 
				
			||||||
          { scale: scale, sidebarView: sidebarView });
 | 
					          exists: false,
 | 
				
			||||||
 | 
					          page: '1',
 | 
				
			||||||
 | 
					          zoom: DEFAULT_SCALE_VALUE,
 | 
				
			||||||
 | 
					          scrollLeft: '0',
 | 
				
			||||||
 | 
					          scrollTop: '0',
 | 
				
			||||||
 | 
					          sidebarView: SidebarView.NONE,
 | 
				
			||||||
 | 
					        }).then((values) => {
 | 
				
			||||||
 | 
					          if (!values.exists) {
 | 
				
			||||||
 | 
					            resolve();
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					          storedHash = 'page=' + values.page +
 | 
				
			||||||
 | 
					            '&zoom=' + (this.viewerPrefs['defaultZoomValue'] || values.zoom) +
 | 
				
			||||||
 | 
					            ',' + values.scrollLeft + ',' + values.scrollTop;
 | 
				
			||||||
 | 
					          sidebarView = this.viewerPrefs['sidebarViewOnLoad'] ||
 | 
				
			||||||
 | 
					                        (values.sidebarView | 0);
 | 
				
			||||||
 | 
					          resolve();
 | 
				
			||||||
 | 
					        }).catch(function() {
 | 
				
			||||||
 | 
					          resolve();
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					      }).then(() => {
 | 
				
			||||||
 | 
					        this.setInitialView(storedHash, { sidebarView, scale, });
 | 
				
			||||||
        initialParams.hash = storedHash;
 | 
					        initialParams.hash = storedHash;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Make all navigation keys work on document load,
 | 
					        // Make all navigation keys work on document load,
 | 
				
			||||||
        // unless the viewer is embedded in a web page.
 | 
					        // unless the viewer is embedded in a web page.
 | 
				
			||||||
        if (!self.isViewerEmbedded) {
 | 
					        if (!this.isViewerEmbedded) {
 | 
				
			||||||
          self.pdfViewer.focus();
 | 
					          this.pdfViewer.focus();
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      }, function rejected(reason) {
 | 
					        return pagesPromise;
 | 
				
			||||||
        console.error(reason);
 | 
					      }).then(() => {
 | 
				
			||||||
        self.setInitialView(null, { scale: scale });
 | 
					        // For documents with different page sizes, once all pages are resolved,
 | 
				
			||||||
      });
 | 
					        // ensure that the correct location becomes visible on load.
 | 
				
			||||||
 | 
					 | 
				
			||||||
      // For documents with different page sizes,
 | 
					 | 
				
			||||||
      // ensure that the correct location becomes visible on load.
 | 
					 | 
				
			||||||
      pagesPromise.then(function resolved() {
 | 
					 | 
				
			||||||
        if (!initialParams.destination && !initialParams.bookmark &&
 | 
					        if (!initialParams.destination && !initialParams.bookmark &&
 | 
				
			||||||
            !initialParams.hash) {
 | 
					            !initialParams.hash) {
 | 
				
			||||||
          return;
 | 
					          return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (self.hasEqualPageSizes) {
 | 
					        if (this.hasEqualPageSizes) {
 | 
				
			||||||
          return;
 | 
					          return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        self.initialDestination = initialParams.destination;
 | 
					        this.initialDestination = initialParams.destination;
 | 
				
			||||||
        self.initialBookmark = initialParams.bookmark;
 | 
					        this.initialBookmark = initialParams.bookmark;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.pdfViewer.currentScaleValue = self.pdfViewer.currentScaleValue;
 | 
					        this.pdfViewer.currentScaleValue = this.pdfViewer.currentScaleValue;
 | 
				
			||||||
        self.setInitialView(initialParams.hash);
 | 
					        this.setInitialView(initialParams.hash);
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1085,14 +1092,11 @@ var PDFViewerApplication = {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  setInitialView: function pdfViewSetInitialView(storedHash, options) {
 | 
					  setInitialView(storedHash, options = {}) {
 | 
				
			||||||
    var scale = options && options.scale;
 | 
					    var { scale = 0, sidebarView = SidebarView.NONE, } = options;
 | 
				
			||||||
    var sidebarView = options && options.sidebarView;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    this.isInitialViewSet = true;
 | 
					    this.isInitialViewSet = true;
 | 
				
			||||||
 | 
					    this.pdfSidebar.setInitialView(sidebarView);
 | 
				
			||||||
    this.pdfSidebar.setInitialView(this.viewerPrefs['sidebarViewOnLoad'] ||
 | 
					 | 
				
			||||||
                                   (sidebarView | 0));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (this.initialDestination) {
 | 
					    if (this.initialDestination) {
 | 
				
			||||||
      this.pdfLinkService.navigateTo(this.initialDestination);
 | 
					      this.pdfLinkService.navigateTo(this.initialDestination);
 | 
				
			||||||
@ -1645,33 +1649,28 @@ function webViewerPresentationModeChanged(e) {
 | 
				
			|||||||
    active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL;
 | 
					    active ? PresentationModeState.FULLSCREEN : PresentationModeState.NORMAL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function webViewerSidebarViewChanged(e) {
 | 
					function webViewerSidebarViewChanged(evt) {
 | 
				
			||||||
  PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled =
 | 
					  PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled =
 | 
				
			||||||
    PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;
 | 
					    PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  var store = PDFViewerApplication.store;
 | 
					  var store = PDFViewerApplication.store;
 | 
				
			||||||
  if (!store || !PDFViewerApplication.isInitialViewSet) {
 | 
					  if (store && PDFViewerApplication.isInitialViewSet) {
 | 
				
			||||||
    // Only update the storage when the document has been loaded *and* rendered.
 | 
					    // Only update the storage when the document has been loaded *and* rendered.
 | 
				
			||||||
    return;
 | 
					    store.set('sidebarView', evt.view).catch(function() { });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  store.initializedPromise.then(function() {
 | 
					 | 
				
			||||||
    store.set('sidebarView', e.view).catch(function() {});
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
function webViewerUpdateViewarea(e) {
 | 
					function webViewerUpdateViewarea(evt) {
 | 
				
			||||||
  var location = e.location, store = PDFViewerApplication.store;
 | 
					  var location = evt.location, store = PDFViewerApplication.store;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (store) {
 | 
					  if (store && PDFViewerApplication.isInitialViewSet) {
 | 
				
			||||||
    store.initializedPromise.then(function() {
 | 
					    store.setMultiple({
 | 
				
			||||||
      store.setMultiple({
 | 
					      'exists': true,
 | 
				
			||||||
        'exists': true,
 | 
					      'page': location.pageNumber,
 | 
				
			||||||
        'page': location.pageNumber,
 | 
					      'zoom': location.scale,
 | 
				
			||||||
        'zoom': location.scale,
 | 
					      'scrollLeft': location.left,
 | 
				
			||||||
        'scrollLeft': location.left,
 | 
					      'scrollTop': location.top,
 | 
				
			||||||
        'scrollTop': location.top,
 | 
					    }).catch(function() { /* unable to write to storage */ });
 | 
				
			||||||
      }).catch(function() { /* unable to write to storage */ });
 | 
					 | 
				
			||||||
    });
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  var href =
 | 
					  var href =
 | 
				
			||||||
    PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams);
 | 
					    PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams);
 | 
				
			||||||
 | 
				
			|||||||
@ -13,7 +13,7 @@
 | 
				
			|||||||
 * limitations under the License.
 | 
					 * limitations under the License.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
 | 
					const DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * View History - This is a utility for saving various view parameters for
 | 
					 * View History - This is a utility for saving various view parameters for
 | 
				
			||||||
@ -24,15 +24,12 @@ var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;
 | 
				
			|||||||
 *  - FIREFOX or MOZCENTRAL - uses sessionStorage.
 | 
					 *  - FIREFOX or MOZCENTRAL - uses sessionStorage.
 | 
				
			||||||
 *  - GENERIC or CHROME     - uses localStorage, if it is available.
 | 
					 *  - GENERIC or CHROME     - uses localStorage, if it is available.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
var ViewHistory = (function ViewHistoryClosure() {
 | 
					class ViewHistory {
 | 
				
			||||||
  function ViewHistory(fingerprint, cacheSize) {
 | 
					  constructor(fingerprint, cacheSize = DEFAULT_VIEW_HISTORY_CACHE_SIZE) {
 | 
				
			||||||
    this.fingerprint = fingerprint;
 | 
					    this.fingerprint = fingerprint;
 | 
				
			||||||
    this.cacheSize = cacheSize || DEFAULT_VIEW_HISTORY_CACHE_SIZE;
 | 
					    this.cacheSize = cacheSize;
 | 
				
			||||||
    this.isInitializedPromiseResolved = false;
 | 
					 | 
				
			||||||
    this.initializedPromise =
 | 
					 | 
				
			||||||
        this._readFromStorage().then(function (databaseStr) {
 | 
					 | 
				
			||||||
      this.isInitializedPromiseResolved = true;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    this._initializedPromise = this._readFromStorage().then((databaseStr) => {
 | 
				
			||||||
      var database = JSON.parse(databaseStr || '{}');
 | 
					      var database = JSON.parse(databaseStr || '{}');
 | 
				
			||||||
      if (!('files' in database)) {
 | 
					      if (!('files' in database)) {
 | 
				
			||||||
        database.files = [];
 | 
					        database.files = [];
 | 
				
			||||||
@ -53,82 +50,87 @@ var ViewHistory = (function ViewHistoryClosure() {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
      this.file = database.files[index];
 | 
					      this.file = database.files[index];
 | 
				
			||||||
      this.database = database;
 | 
					      this.database = database;
 | 
				
			||||||
    }.bind(this));
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ViewHistory.prototype = {
 | 
					  _writeToStorage() {
 | 
				
			||||||
    _writeToStorage: function ViewHistory_writeToStorage() {
 | 
					    return new Promise((resolve) => {
 | 
				
			||||||
      return new Promise(function (resolve) {
 | 
					      var databaseStr = JSON.stringify(this.database);
 | 
				
			||||||
        var databaseStr = JSON.stringify(this.database);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (typeof PDFJSDev !== 'undefined' &&
 | 
					      if (typeof PDFJSDev !== 'undefined' &&
 | 
				
			||||||
            PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
 | 
					          PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
 | 
				
			||||||
          sessionStorage.setItem('pdfjs.history', databaseStr);
 | 
					        sessionStorage.setItem('pdfjs.history', databaseStr);
 | 
				
			||||||
        } else {
 | 
					      } else {
 | 
				
			||||||
          localStorage.setItem('pdfjs.history', databaseStr);
 | 
					        localStorage.setItem('pdfjs.history', databaseStr);
 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        resolve();
 | 
					 | 
				
			||||||
      }.bind(this));
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    _readFromStorage: function ViewHistory_readFromStorage() {
 | 
					 | 
				
			||||||
      return new Promise(function (resolve) {
 | 
					 | 
				
			||||||
        if (typeof PDFJSDev !== 'undefined' &&
 | 
					 | 
				
			||||||
            PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
 | 
					 | 
				
			||||||
          resolve(sessionStorage.getItem('pdfjs.history'));
 | 
					 | 
				
			||||||
        } else {
 | 
					 | 
				
			||||||
          var value = localStorage.getItem('pdfjs.history');
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          // TODO: Remove this key-name conversion after a suitable time-frame.
 | 
					 | 
				
			||||||
          // Note that we only remove the old 'database' entry if it looks like
 | 
					 | 
				
			||||||
          // it was created by PDF.js. to avoid removing someone else's data.
 | 
					 | 
				
			||||||
          if (!value) {
 | 
					 | 
				
			||||||
            var databaseStr = localStorage.getItem('database');
 | 
					 | 
				
			||||||
            if (databaseStr) {
 | 
					 | 
				
			||||||
              try {
 | 
					 | 
				
			||||||
                var database = JSON.parse(databaseStr);
 | 
					 | 
				
			||||||
                if (typeof database.files[0].fingerprint === 'string') {
 | 
					 | 
				
			||||||
                  localStorage.setItem('pdfjs.history', databaseStr);
 | 
					 | 
				
			||||||
                  localStorage.removeItem('database');
 | 
					 | 
				
			||||||
                  value = databaseStr;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
              } catch (ex) { }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
          resolve(value);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
      });
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    set: function ViewHistory_set(name, val) {
 | 
					 | 
				
			||||||
      if (!this.isInitializedPromiseResolved) {
 | 
					 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					      resolve();
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  _readFromStorage() {
 | 
				
			||||||
 | 
					    return new Promise(function(resolve) {
 | 
				
			||||||
 | 
					      if (typeof PDFJSDev !== 'undefined' &&
 | 
				
			||||||
 | 
					          PDFJSDev.test('FIREFOX || MOZCENTRAL')) {
 | 
				
			||||||
 | 
					        resolve(sessionStorage.getItem('pdfjs.history'));
 | 
				
			||||||
 | 
					      } else {
 | 
				
			||||||
 | 
					        var value = localStorage.getItem('pdfjs.history');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // TODO: Remove this key-name conversion after a suitable time-frame.
 | 
				
			||||||
 | 
					        // Note that we only remove the old 'database' entry if it looks like
 | 
				
			||||||
 | 
					        // it was created by PDF.js, to avoid removing someone else's data.
 | 
				
			||||||
 | 
					        if (!value) {
 | 
				
			||||||
 | 
					          var databaseStr = localStorage.getItem('database');
 | 
				
			||||||
 | 
					          if (databaseStr) {
 | 
				
			||||||
 | 
					            try {
 | 
				
			||||||
 | 
					              var database = JSON.parse(databaseStr);
 | 
				
			||||||
 | 
					              if (typeof database.files[0].fingerprint === 'string') {
 | 
				
			||||||
 | 
					                localStorage.setItem('pdfjs.history', databaseStr);
 | 
				
			||||||
 | 
					                localStorage.removeItem('database');
 | 
				
			||||||
 | 
					                value = databaseStr;
 | 
				
			||||||
 | 
					              }
 | 
				
			||||||
 | 
					            } catch (ex) { }
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        resolve(value);
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  set(name, val) {
 | 
				
			||||||
 | 
					    return this._initializedPromise.then(() => {
 | 
				
			||||||
      this.file[name] = val;
 | 
					      this.file[name] = val;
 | 
				
			||||||
      return this._writeToStorage();
 | 
					      return this._writeToStorage();
 | 
				
			||||||
    },
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    setMultiple: function ViewHistory_setMultiple(properties) {
 | 
					  setMultiple(properties) {
 | 
				
			||||||
      if (!this.isInitializedPromiseResolved) {
 | 
					    return this._initializedPromise.then(() => {
 | 
				
			||||||
        return;
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
      for (var name in properties) {
 | 
					      for (var name in properties) {
 | 
				
			||||||
        this.file[name] = properties[name];
 | 
					        this.file[name] = properties[name];
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return this._writeToStorage();
 | 
					      return this._writeToStorage();
 | 
				
			||||||
    },
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    get: function ViewHistory_get(name, defaultValue) {
 | 
					  get(name, defaultValue) {
 | 
				
			||||||
      if (!this.isInitializedPromiseResolved) {
 | 
					    return this._initializedPromise.then(() => {
 | 
				
			||||||
        return defaultValue;
 | 
					      var val = this.file[name];
 | 
				
			||||||
 | 
					      return val !== undefined ? val : defaultValue;
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  getMultiple(properties) {
 | 
				
			||||||
 | 
					    return this._initializedPromise.then(() => {
 | 
				
			||||||
 | 
					      var values = Object.create(null);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      for (var name in properties) {
 | 
				
			||||||
 | 
					        var val = this.file[name];
 | 
				
			||||||
 | 
					        values[name] = val !== undefined ? val : properties[name];
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return this.file[name] || defaultValue;
 | 
					      return values;
 | 
				
			||||||
    }
 | 
					    });
 | 
				
			||||||
  };
 | 
					  }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
  return ViewHistory;
 | 
					 | 
				
			||||||
})();
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
export {
 | 
					export {
 | 
				
			||||||
  ViewHistory,
 | 
					  ViewHistory,
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user