Browse Source

Fix some typos in comments and variable names.

Fix some nits in debugger.js.
gigaherz 13 years ago
parent
commit
eaffcfa920
  1. 14
      web/debugger.js
  2. 8
      web/viewer.js

14
web/debugger.js

@ -44,7 +44,7 @@ var FontInspector = (function FontInspectorClosure() {
} }
} }
return { return {
// Poperties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'FontInspector', id: 'FontInspector',
name: 'Font Inspector', name: 'Font Inspector',
panel: null, panel: null,
@ -140,7 +140,7 @@ var StepperManager = (function StepperManagerClosure() {
var stepperChooser = null; var stepperChooser = null;
var breakPoints = {}; var breakPoints = {};
return { return {
// Poperties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'Stepper', id: 'Stepper',
name: 'Stepper', name: 'Stepper',
panel: null, panel: null,
@ -207,7 +207,7 @@ var StepperManager = (function StepperManagerClosure() {
var Stepper = (function StepperClosure() { var Stepper = (function StepperClosure() {
function Stepper(panel, pageIndex, initialBreakPoints) { function Stepper(panel, pageIndex, initialBreakPoints) {
this.panel = panel; this.panel = panel;
this.len; this.len = 0;
this.breakPoint = 0; this.breakPoint = 0;
this.nextBreakPoint = null; this.nextBreakPoint = null;
this.pageIndex = pageIndex; this.pageIndex = pageIndex;
@ -236,6 +236,7 @@ var Stepper = (function StepperClosure() {
headerRow.appendChild(c('th', 'fn')); headerRow.appendChild(c('th', 'fn'));
headerRow.appendChild(c('th', 'args')); headerRow.appendChild(c('th', 'args'));
var self = this;
for (var i = 0; i < IRQueue.fnArray.length; i++) { for (var i = 0; i < IRQueue.fnArray.length; i++) {
var line = c('tr'); var line = c('tr');
line.className = 'line'; line.className = 'line';
@ -249,7 +250,6 @@ var Stepper = (function StepperClosure() {
cbox.type = 'checkbox'; cbox.type = 'checkbox';
cbox.className = 'points'; cbox.className = 'points';
cbox.checked = checked; cbox.checked = checked;
var self = this;
cbox.onclick = (function(x) { cbox.onclick = (function(x) {
return function() { return function() {
if (this.checked) if (this.checked)
@ -298,7 +298,7 @@ var Stepper = (function StepperClosure() {
callback(); callback();
break; break;
} }
} };
dom.addEventListener('keydown', listener, false); dom.addEventListener('keydown', listener, false);
self.goTo(idx); self.goTo(idx);
}, },
@ -331,7 +331,7 @@ var Stats = (function Stats() {
return false; return false;
} }
return { return {
// Poperties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'Stats', id: 'Stats',
name: 'Stats', name: 'Stats',
panel: null, panel: null,
@ -429,12 +429,12 @@ var PDFBug = (function PDFBugClosure() {
// Initialize all the debugging tools. // Initialize all the debugging tools.
var tools = this.tools; var tools = this.tools;
var self = this;
for (var i = 0; i < tools.length; ++i) { for (var i = 0; i < tools.length; ++i) {
var tool = tools[i]; var tool = tools[i];
var panel = document.createElement('div'); var panel = document.createElement('div');
var panelButton = document.createElement('button'); var panelButton = document.createElement('button');
panelButton.textContent = tool.name; panelButton.textContent = tool.name;
var self = this;
panelButton.addEventListener('click', (function(selected) { panelButton.addEventListener('click', (function(selected) {
return function(event) { return function(event) {
event.preventDefault(); event.preventDefault();

8
web/viewer.js

@ -431,7 +431,7 @@ var PDFView = {
// } // }
// ); // );
// }, // },
// noData // Error ocurred try downloading with just the url. // noData // Error occurred try downloading with just the url.
// ); // );
//#endif //#endif
}, },
@ -798,14 +798,14 @@ var PDFView = {
search: function pdfViewStartSearch() { search: function pdfViewStartSearch() {
// Limit this function to run every <SEARCH_TIMEOUT>ms. // Limit this function to run every <SEARCH_TIMEOUT>ms.
var SEARCH_TIMEOUT = 250; var SEARCH_TIMEOUT = 250;
var lastSeach = this.lastSearch; var lastSearch = this.lastSearch;
var now = Date.now(); var now = Date.now();
if (lastSeach && (now - lastSeach) < SEARCH_TIMEOUT) { if (lastSearch && (now - lastSearch) < SEARCH_TIMEOUT) {
if (!this.searchTimer) { if (!this.searchTimer) {
this.searchTimer = setTimeout(function resumeSearch() { this.searchTimer = setTimeout(function resumeSearch() {
PDFView.search(); PDFView.search();
}, },
SEARCH_TIMEOUT - (now - lastSeach) SEARCH_TIMEOUT - (now - lastSearch)
); );
} }
return; return;

Loading…
Cancel
Save