%PDF-1.4 %Óëéá 1 0 obj <> endobj 3 0 obj <> endobj 4 0 obj <
| Server IP : 212.252.79.165 / Your IP : 216.73.217.172 [ Web Server : Apache System : Linux 212-252-79-165.cprapid.com 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64 User : cehaburo ( 1001) PHP Version : 8.1.33 Disable Function : exec,passthru,shell_exec,system Domains : 48 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /home/cehaburo/www/pdfjs/doc/scripts/ |
Upload File : |
window.SearcherDisplay = (function($) {
/**
* This class provides support for displaying quick search text results to users.
*/
function SearcherDisplay() { }
SearcherDisplay.prototype.init = function() {
this._displayQuickSearch();
};
/**
* This method creates the quick text search entry in navigation menu and wires all required events.
*/
SearcherDisplay.prototype._displayQuickSearch = function() {
var quickSearch = $(document.createElement("iframe")),
body = $("body"),
self = this;
quickSearch.attr("src", "quicksearch.html");
quickSearch.css("width", "0px");
quickSearch.css("height", "0px");
body.append(quickSearch);
$(window).on("message", function(msg) {
var msgData = msg.originalEvent.data;
if (msgData.msgid != "docstrap.quicksearch.done") {
return;
}
var results = msgData.results || [];
self._displaySearchResults(results);
});
function startSearch() {
var searchTerms = $('#search-input').prop("value");
if (searchTerms) {
quickSearch[0].contentWindow.postMessage({
"searchTerms": searchTerms,
"msgid": "docstrap.quicksearch.start"
}, "*");
}
}
$('#search-input').on('keyup', function(evt) {
if (evt.keyCode != 13) {
return;
}
startSearch();
return false;
});
$('#search-submit').on('click', function() {
startSearch();
return false;
});
};
/**
* This method displays the quick text search results in a modal dialog.
*/
SearcherDisplay.prototype._displaySearchResults = function(results) {
var resultsHolder = $($("#searchResults").find(".modal-body")),
fragment = document.createDocumentFragment(),
resultsList = document.createElement("ul");
resultsHolder.empty();
for (var idx = 0; idx < results.length; idx++) {
var result = results[idx],
item = document.createElement("li"),
link = document.createElement("a");
link.href = result.id;
link.innerHTML = result.title;
item.appendChild(link)
resultsList.appendChild(item);
}
fragment.appendChild(resultsList);
resultsHolder.append(fragment);
$("#searchResults").modal({"show": true});
};
return new SearcherDisplay();
})($);