From: Vincent Vanwaelscappel Date: Wed, 4 Oct 2017 14:11:24 +0000 (+0200) Subject: Rename icon in sprite | wip #1719 @1.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b96ef826dd17f552ae83729d666b11f2135531ce;p=fluidbook-html5.git Rename icon in sprite | wip #1719 @1.5 --- diff --git a/images/interface.svg b/images/interface.svg index 5ab96c9a..8539c7d8 100644 --- a/images/interface.svg +++ b/images/interface.svg @@ -12,80 +12,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index c5812f82..13e2e4d0 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -65,21 +65,24 @@ FluidbookHelp.prototype = { } var icon = $(this).find('.nav-icon:visible:first'); // Must get first visible icon so "toggle" icons work - var offset = icon.offset(); - var left; - - if ($this.fluidbook.l10n.dir == 'ltr') { - left = offset.left + (icon.outerWidth() / 2); - } else { - left = (ww - offset.left - (icon.outerWidth() / 2)) * -1; - } - - var c = 'nav'; - if ($(this).parents("#afterSearch").length > 0) { - c = 'afterSearch'; - } - help += '
' + text + '
'; - h -= 25; + if(icon.length>0) { + var offset = icon.offset(); + + var left; + + if ($this.fluidbook.l10n.dir == 'ltr') { + left = offset.left + (icon.outerWidth() / 2); + } else { + left = (ww - offset.left - (icon.outerWidth() / 2)) * -1; + } + + var c = 'nav'; + if ($(this).parents("#afterSearch").length > 0) { + c = 'afterSearch'; + } + help += '
' + text + '
'; + h -= 25; + } }); // $("#horizontalNav").transform({ // scale: [scale, scale] diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 28f3d406..e6591d9d 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -169,8 +169,8 @@ FluidbookNav.prototype = { res += getSpriteIcon(name); // Special case for icons that have an additional state - if (name == 'interface-fullscreen') { - res += getSpriteIcon('interface-fullscreen-exit'); + if (name == 'nav-fullscreen') { + res += getSpriteIcon('nav-fullscreen-exit'); } } @@ -353,23 +353,23 @@ FluidbookNav.prototype = { return false; }) } else if (icon == 'index') { - link = this.addLink(navType, 'interface-index', '#/index', 'index', 'overview', 'overview'); + link = this.addLink(navType, 'nav-index', '#/index', 'index', 'overview', 'overview'); } else if (icon == 'chapters') { if (this.fluidbook.datas.displayChaptersIcon) { if (this.fluidbook.datas.chaptersPage != '') { - link = this.addLink(navType, 'interface-chapters', '#/page/' + this.fluidbook.datas.chaptersPage, 'chapters', 'chapters', 'chapters'); + link = this.addLink(navType, 'nav-chapters', '#/page/' + this.fluidbook.datas.chaptersPage, 'chapters', 'chapters', 'chapters'); } else if (this.fluidbook.datas.chapters.length > 0) { // NOTE: Currently the MMenu breaks when the non-cascading chapter UL HTML is inserted so it will // be opened in a popup for now. Todo: fix this so it works as a sub panel of it's own if (navType == 'menu' && this.fluidbook.datas.chaptersCascade) { - link = this.addLink(navType, 'interface-chapters', '', 'chapters', 'chapters', 'chapters'); + link = this.addLink(navType, 'nav-chapters', '', 'chapters', 'chapters', 'chapters'); // Get HTML for submenus (appended later) this.chaptersMenuHTML = this.makeChapterLists(this.fluidbook.datas.chapters); } else { - link = this.addLink(navType, 'interface-chapters', '#/chapters', 'chapters', 'chapters', 'chapters'); + link = this.addLink(navType, 'nav-chapters', '#/chapters', 'chapters', 'chapters', 'chapters'); } } } @@ -381,7 +381,7 @@ FluidbookNav.prototype = { if (navType == 'horizontalNav') { if (this.fluidbook.datas.share) { - link = this.addLink(navType, 'interface-share', '#/share', 'share', 'share', 'share'); + link = this.addLink(navType, 'nav-share', '#/share', 'share', 'share', 'share'); } } else if (navType == 'menu') { @@ -393,17 +393,17 @@ FluidbookNav.prototype = { } } else if (icon == 'bookmark' && this.fluidbook.datas.bookmark) { - link = this.addLink(navType, 'interface-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks', 'bookmarks'); + link = this.addLink(navType, 'nav-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks', 'bookmarks'); } else if (icon == 'pdf' && this.fluidbook.datas.pdf) { - link = this.addLink(navType, 'interface-download', '#', 'download', 'download', 'download'); + link = this.addLink(navType, 'nav-download', '#', 'download', 'download', 'download'); } else if (icon == 'print' && this.fluidbook.datas.print) { - link = this.addLink(navType, 'interface-print', '#', 'print', 'print', 'print'); + link = this.addLink(navType, 'nav-print', '#', 'print', 'print', 'print'); } else if (icon == 'lang' && this.fluidbook.l10n.multilangEnabled) { // Note: the "!" at the beginning of the title/help parameters means that we don't want these strings translated - link = this.addLink(navType, 'interface-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language'); + link = this.addLink(navType, 'nav-locales', '#/locales', 'locales', '!' + this.fluidbook.l10n.getCurrentLanguageName(), '!Select Language'); } else if (icon == 'archives') { if (this.fluidbook.datas.archivesLink != '') { @@ -413,20 +413,20 @@ FluidbookNav.prototype = { } } else if (icon == 'help') { - link = this.addLink(navType, 'interface-help', '#', 'help', 'help', 'help'); + link = this.addLink(navType, 'nav-help', '#', 'help', 'help', 'help'); } else if (icon == 'zoom' && !this.fluidbook.support.isMobile) { link = this.addLink(navType, 'nav-zoomin', '#', 'zoomin', 'zoom in', 'zoom in'); link = this.addLink(navType, 'nav-zoomout', '#', 'zoomout', 'zoom out', 'zoom out'); } else if (icon == 'fullscreen' && Modernizr.fullscreen && !DATAS.phonegap) { - link = this.addLink(navType, 'interface-' + icon, '#', icon, 'full screen', 'switch between fullscreen and normal'); + link = this.addLink(navType, 'nav-' + icon, '#', icon, 'full screen', 'switch between fullscreen and normal'); } else if (icon == 'search') { // Only the horizontal icon menu has the search icon, which opens the main menu if (this.fluidbook.datas.search && navType == 'horizontalNav') { - link = this.addLink(navType, 'interface-search', '#', 'searchIcon', 'search', 'search'); + link = this.addLink(navType, 'nav-search', '#', 'searchIcon', 'search', 'search'); } } else if (icon == 'extra') { @@ -641,7 +641,7 @@ FluidbookNav.prototype = { var $this = this; var res = '
'; res += ''; - res += this.getLink('interface-search', '#', 'submitSearch'); + res += this.getLink('nav-search', '#', 'submitSearch'); res += '
'; res += ''; res += ''; diff --git a/js/libs/fluidbook/fluidbook.share.js b/js/libs/fluidbook/fluidbook.share.js index 73c1f3ca..2d9352c5 100644 --- a/js/libs/fluidbook/fluidbook.share.js +++ b/js/libs/fluidbook/fluidbook.share.js @@ -59,7 +59,7 @@ FluidbookShare.prototype = { for (var shareType in shareLinks) { if (shareLinks.hasOwnProperty(shareType)) { // Ensure we don't get inherited properties shareHTML += '