fix indentations and style nits
This commit is contained in:
parent
f08aafa72a
commit
34b6416017
@ -273,6 +273,6 @@ canvas {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#loading {
|
#loading {
|
||||||
margin:100px 0;
|
margin: 100px 0;
|
||||||
text-align:center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="loading">Loading... 0%</div>
|
<div id="loading">Loading... 0%</div>
|
||||||
<div id="viewer"></div>
|
<div id="viewer"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -111,14 +111,14 @@ var PDFView = {
|
|||||||
xhr.open('GET', url);
|
xhr.open('GET', url);
|
||||||
xhr.mozResponseType = xhr.responseType = 'arraybuffer';
|
xhr.mozResponseType = xhr.responseType = 'arraybuffer';
|
||||||
xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200;
|
xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200;
|
||||||
xhr.onprogress=PDFView.progressLevel;
|
xhr.onprogress = PDFView.progressLevel;
|
||||||
|
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState === 4 && xhr.status === xhr.expected) {
|
if (xhr.readyState === 4 && xhr.status === xhr.expected) {
|
||||||
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
|
var data = (xhr.mozResponseArrayBuffer || xhr.mozResponse ||
|
||||||
xhr.responseArrayBuffer || xhr.response);
|
xhr.responseArrayBuffer || xhr.response);
|
||||||
|
|
||||||
document.getElementById('loading').style.display="none";
|
document.getElementById('loading').style.display = "none";
|
||||||
PDFView.load(data, scale);
|
PDFView.load(data, scale);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -127,8 +127,8 @@ var PDFView = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
progressLevel: function(evt) {
|
progressLevel: function(evt) {
|
||||||
var p=Math.round((evt.loaded / evt.total)*100);
|
var p = Math.round((evt.loaded / evt.total) * 100);
|
||||||
document.getElementById('loading').innerHTML = 'Loading... '+p+'%';
|
document.getElementById('loading').innerHTML = 'Loading... ' + p + '%';
|
||||||
},
|
},
|
||||||
|
|
||||||
navigateTo: function(dest) {
|
navigateTo: function(dest) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user