});
},
+
// The results nav bar provides navigation between results without needing the menu to be open
// When it is active, the rest of the interface is hidden
initResultsNav: function () {
}
$('body').removeClass(this.resultsActiveClass);
- }, nextResultsPage: function () {
+ },
+
+ nextResultsPage: function () {
var currentIndex = this.resultNavPages.indexOf(fluidbook.currentPage);
var nextIndex = currentIndex + 1;
this.updateResultsNav(nextPage);
this.fluidbook.setCurrentPage(nextPage);
- }, previousResultsPage: function () {
+ },
+
+ previousResultsPage: function () {
var currentIndex = this.resultNavPages.indexOf(fluidbook.currentPage);
var prevIndex = currentIndex - 1;
this._loadLib(function () {
$this._getHints(q, callback);
});
- }, find: function (q, callback) {
+ },
+ find: function (q, callback) {
var $this = this;
this._loadLib(function () {
$this._find(q, callback);
});
- }, _loadLib: function (callback) {
+ },
+ _loadLib: function (callback) {
if (this.indexLoaded) {
return callback();
}
} else {
callback();
}
- }, _getHints: function (q, callback) {
+ },
+ _getHints: function (q, callback) {
var words = this.normalizeQuery(q, true);
q = words.pop();
var res = [];
sortHints: function (a, b) {
return b[1] - a[1];
- }, kill: function () {
+ },
+ kill: function () {
- }, normalizeQuery: function (q, split) {
+ },
+ normalizeQuery: function (q, split) {
q = this.noAccents(q);
+ q = q.trim();
+ q = q.replace(/\s+/g, ' ');
q = q.toLowerCase();
if (split) {
return q.split(' ');
}
return q;
-
- }, noAccents: function (source) {
+ },
+ noAccents: function (source) {
source = source.replace(/[àáâãäå]/g, "a");
source = source.replace(/[ÀÁÂÃÄÅ]/g, "A");
source = source.replace(/[èéêë]/g, "e");
source = source.replace(/[œ]/g, "oe");
source = source.replace(/[Œ]/g, "OE");
return source;
- }, setHighlightTerms: function (terms) {
+ },
+ setHighlightTerms: function (terms) {
if (!this.highlightEnabled || window.HIGHLIGHTS === undefined) {
return;
}
this.highlights.push(h);
}
}
- }, clearHighlights: function () {
+ },
+ clearHighlights: function () {
$("#searchHighlights").html('');
for (var p in this.plugins) {
var plugin = this.plugins[p];
plugin.clearHighlights();
}
- }, highlightSearchTerms: function (pageNr) {
+ },
+ highlightSearchTerms: function (pageNr) {
if (!this.highlightEnabled) {
console.warn('hightlight disabled');
return;