mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Refactors PDFLinkService.
# Conflicts: # web/viewer.js
This commit is contained in:
parent
73545fbb92
commit
0ef6212b64
7 changed files with 389 additions and 246 deletions
|
@ -179,6 +179,21 @@ function watchScroll(viewAreaElement, callback) {
|
|||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to parse query string (e.g. ?param1=value&parm2=...).
|
||||
*/
|
||||
function parseQueryString(query) {
|
||||
var parts = query.split('&');
|
||||
var params = {};
|
||||
for (var i = 0, ii = parts.length; i < ii; ++i) {
|
||||
var param = parts[i].split('=');
|
||||
var key = param[0].toLowerCase();
|
||||
var value = param.length > 1 ? param[1] : null;
|
||||
params[decodeURIComponent(key)] = decodeURIComponent(value);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use binary search to find the index of the first item in a given array which
|
||||
* passes a given condition. The items are expected to be sorted in the sense
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue