Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		
						commit
						2c496b6710
					
				@ -147,8 +147,7 @@ PdfDataListener.prototype = {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    this.data.set(chunk, this.loaded);
 | 
					    this.data.set(chunk, this.loaded);
 | 
				
			||||||
    this.loaded = willBeLoaded;
 | 
					    this.loaded = willBeLoaded;
 | 
				
			||||||
    if (this.length >= 0)
 | 
					    this.onprogress(this.loaded, this.length >= 0 ? this.length : void(0));
 | 
				
			||||||
      this.onprogress(this.loaded, this.length);
 | 
					 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  getData: function PdfDataListener_getData() {
 | 
					  getData: function PdfDataListener_getData() {
 | 
				
			||||||
    var data = this.data;
 | 
					    var data = this.data;
 | 
				
			||||||
 | 
				
			|||||||
@ -574,8 +574,13 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
      var flags = properties.flags;
 | 
					      var flags = properties.flags;
 | 
				
			||||||
      var differences = [];
 | 
					      var differences = [];
 | 
				
			||||||
      var baseEncoding = !!(flags & FontFlags.Symbolic) ?
 | 
					      var baseEncoding = Encodings.StandardEncoding;
 | 
				
			||||||
                         Encodings.symbolsEncoding : Encodings.StandardEncoding;
 | 
					      // The Symbolic attribute can be misused for regular fonts
 | 
				
			||||||
 | 
					      // Heuristic: we have to check if the font is a standard one also
 | 
				
			||||||
 | 
					      if (!!(flags & FontFlags.Symbolic)) {
 | 
				
			||||||
 | 
					        baseEncoding = !properties.file ? Encodings.symbolsEncoding :
 | 
				
			||||||
 | 
					                                          Encodings.MacRomanEncoding;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
      var hasEncoding = dict.has('Encoding');
 | 
					      var hasEncoding = dict.has('Encoding');
 | 
				
			||||||
      if (hasEncoding) {
 | 
					      if (hasEncoding) {
 | 
				
			||||||
        var encoding = dict.get('Encoding');
 | 
					        var encoding = dict.get('Encoding');
 | 
				
			||||||
 | 
				
			|||||||
@ -135,12 +135,10 @@ var WorkerMessageHandler = {
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
          url: source.url,
 | 
					          url: source.url,
 | 
				
			||||||
          progress: function getPDFProgress(evt) {
 | 
					          progress: function getPDFProgress(evt) {
 | 
				
			||||||
            if (evt.lengthComputable) {
 | 
					            handler.send('DocProgress', {
 | 
				
			||||||
              handler.send('DocProgress', {
 | 
					              loaded: evt.loaded,
 | 
				
			||||||
                loaded: evt.loaded,
 | 
					              total: evt.lengthComputable ? evt.total : void(0)
 | 
				
			||||||
                total: evt.total
 | 
					            });
 | 
				
			||||||
              });
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
          error: function getPDFError(e) {
 | 
					          error: function getPDFError(e) {
 | 
				
			||||||
            handler.send('DocError', 'Unexpected server response of ' +
 | 
					            handler.send('DocError', 'Unexpected server response of ' +
 | 
				
			||||||
 | 
				
			|||||||
@ -1025,6 +1025,28 @@ canvas {
 | 
				
			|||||||
  border-bottom-right-radius: 2px;
 | 
					  border-bottom-right-radius: 2px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#loadingBar .progress.indeterminate {
 | 
				
			||||||
 | 
					  width: 100%;
 | 
				
			||||||
 | 
					  height: 25px;
 | 
				
			||||||
 | 
					  background-image: -moz-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040);
 | 
				
			||||||
 | 
					  background-image: -webkit-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040);
 | 
				
			||||||
 | 
					  background-image: -ms-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040);
 | 
				
			||||||
 | 
					  background-image: -o-linear-gradient( 30deg, #404040, #404040 15%, #898989, #404040 85%, #404040);
 | 
				
			||||||
 | 
					  background-size: 75px 25px;
 | 
				
			||||||
 | 
					  -moz-animation: progressIndeterminate 1s linear infinite;
 | 
				
			||||||
 | 
					  -webkit-animation: progressIndeterminate 1s linear infinite;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@-moz-keyframes progressIndeterminate {
 | 
				
			||||||
 | 
					  from { background-position: 0px 0px; }
 | 
				
			||||||
 | 
					  to { background-position: 75px 0px; }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@-webkit-keyframes progressIndeterminate {
 | 
				
			||||||
 | 
					  from { background-position: 0px 0px; }
 | 
				
			||||||
 | 
					  to { background-position: 75px 0px; }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.textLayer {
 | 
					.textLayer {
 | 
				
			||||||
  position: absolute;
 | 
					  position: absolute;
 | 
				
			||||||
  left: 0;
 | 
					  left: 0;
 | 
				
			||||||
 | 
				
			|||||||
@ -60,7 +60,6 @@ var ProgressBar = (function ProgressBarClosure() {
 | 
				
			|||||||
    this.height = opts.height || 100;
 | 
					    this.height = opts.height || 100;
 | 
				
			||||||
    this.width = opts.width || 100;
 | 
					    this.width = opts.width || 100;
 | 
				
			||||||
    this.units = opts.units || '%';
 | 
					    this.units = opts.units || '%';
 | 
				
			||||||
    this.percent = opts.percent || 0;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Initialize heights
 | 
					    // Initialize heights
 | 
				
			||||||
    this.div.style.height = this.height + this.units;
 | 
					    this.div.style.height = this.height + this.units;
 | 
				
			||||||
@ -69,10 +68,18 @@ var ProgressBar = (function ProgressBarClosure() {
 | 
				
			|||||||
  ProgressBar.prototype = {
 | 
					  ProgressBar.prototype = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    updateBar: function ProgressBar_updateBar() {
 | 
					    updateBar: function ProgressBar_updateBar() {
 | 
				
			||||||
 | 
					      if (this._indeterminate) {
 | 
				
			||||||
 | 
					        this.div.classList.add('indeterminate');
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      var progressSize = this.width * this._percent / 100;
 | 
					      var progressSize = this.width * this._percent / 100;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (this._percent > 95)
 | 
					      if (this._percent > 95)
 | 
				
			||||||
        this.div.classList.add('full');
 | 
					        this.div.classList.add('full');
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        this.div.classList.remove('full');
 | 
				
			||||||
 | 
					      this.div.classList.remove('indeterminate');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      this.div.style.width = progressSize + this.units;
 | 
					      this.div.style.width = progressSize + this.units;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@ -82,6 +89,7 @@ var ProgressBar = (function ProgressBarClosure() {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set percent(val) {
 | 
					    set percent(val) {
 | 
				
			||||||
 | 
					      this._indeterminate = isNaN(val);
 | 
				
			||||||
      this._percent = clamp(val, 0, 100);
 | 
					      this._percent = clamp(val, 0, 100);
 | 
				
			||||||
      this.updateBar();
 | 
					      this.updateBar();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -572,6 +580,10 @@ var PDFView = {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    var loadingBox = document.getElementById('loadingBox');
 | 
				
			||||||
 | 
					    loadingBox.setAttribute('hidden', 'true');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
//#if !(FIREFOX || MOZCENTRAL)
 | 
					//#if !(FIREFOX || MOZCENTRAL)
 | 
				
			||||||
    var errorWrapper = document.getElementById('errorWrapper');
 | 
					    var errorWrapper = document.getElementById('errorWrapper');
 | 
				
			||||||
    errorWrapper.removeAttribute('hidden');
 | 
					    errorWrapper.removeAttribute('hidden');
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user