From: Stephen Cameron Date: Tue, 19 Sep 2017 12:54:32 +0000 (+0200) Subject: Merge branch 'master' into burgermenu X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f2b6ccac099ac4144d7482c36df0c6f425ccb1ad;p=fluidbook-html5.git Merge branch 'master' into burgermenu # Conflicts: # js/libs/fluidbook/fluidbook.js # js/libs/fluidbook/fluidbook.menu.js # js/libs/fluidbook/fluidbook.nav.js --- f2b6ccac099ac4144d7482c36df0c6f425ccb1ad diff --cc js/libs/fluidbook/fluidbook.js index 581afd1e,06ebb9b5..581f6fe3 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@@ -32,7 -32,6 +32,7 @@@ Fluidbook.prototype = this.service = new FluidbookService(this, datas.id); this.support = new FluidbookSupport(this); this.loader = new FluidbookLoader(this); - this.index = new FluidbookIndex(this); ++ this.index = new FluidbookIndex(this); // ToDo: check this? this.search = new FluidbookSearch(this); this.pad = new FluidbookPad(this); this.links = new FluidbookLinks(this); @@@ -832,78 -755,10 +833,35 @@@ this.search.kill(); }, hideSearchHints: function () { - this.killLastSearchHint(); - $("#searchHints").html(''); - $("#searchHints").hide(); + // this.killLastSearchHint(); + // $("#searchHints").html(''); + // $("#searchHints").hide(); + this.menuSearchHints.html('').hide(); // Clear and hide all hints + }, + + hideSearchResults: function () { + this.menuSearchResults.html('').hide(); + }, + + // Check if a search is active in the interface + isSearchActive: function () { + + if (!this.datas.search) { + return false; // Search feature disabled on this Fluidbook + } + + return ($('#q').val().length > 0); }, + + // Clear search query and close search related menu items + closeSearch: function () { + $('#q').val(''); // Clear search field + this.hideSearchHints(); + this.hideSearchResults(); + this.showMenuItems(); // Show menu items that were hidden previously + }, + - getLocationToShare: function () { - if (this.datas.phonegap) { - return this.datas.offlineLink; - } else { - var l = window.location.toString(); - var e = l.split("#"); - return e[0]; - } - }, - sendEmail: function () { - window.location = 'mailto:?subject=' + encodeURIComponent(this.datas.title) + '&body=' + encodeURIComponent(this.datas.title + ' : ' + this.getLocationToShare()); - this.stats.track(5); - }, - sendTwitter: function () { - this.service.open('twitterShare', { - url: this.getLocationToShare(), - post: this.datas.twitter_description.replace('%title%', this.datas.title) - }, 'width=650,height=400'); - this.stats.track(13); - }, - sendFacebook: function () { - this.service.open('facebookShare', { - url: this.getLocationToShare() - }, 'width=650,height=400'); - this.stats.track(12); - }, - sendGoogleplus: function () { - this.service.open('googleplusShare', { - url: this.getLocationToShare() - }, 'width=650,height=400'); - this.stats.track(12); - }, - sendLinkedin: function () { - this.service.open('linkedinShare', { - url: this.getLocationToShare() - }, 'width=650,height=400'); - this.stats.track(12); - }, - sendViadeo: function () { - this.service.open('viadeoShare', { - url: this.getLocationToShare() - }, 'width=650,height=400'); - this.stats.track(12); - }, ++ print: function () { var $this = this; var pdf; diff --cc js/libs/fluidbook/fluidbook.menu.js index d6352db2,0c981ac4..72a00c25 --- a/js/libs/fluidbook/fluidbook.menu.js +++ b/js/libs/fluidbook/fluidbook.menu.js @@@ -295,11 -295,9 +296,11 @@@ FluidbookMenu.prototype = view += '
'; view += '