From c987ef3af161796a59655916a54b200de77c667f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Franchet?= Date: Mon, 18 Sep 2023 22:49:19 +0200 Subject: [PATCH] Tabs not readable on small phones #180 --- Batman/data/rules/lang/rules.en.json | 2 + Batman/data/rules/lang/rules.fr.json | 2 + Batman/engine/Version.json | 2 +- Batman/engine/general/nav.css | 53 +++++++++++++++---- Batman/engine/general/nav.js | 47 +++++++++------- Batman/engine/rules/lang/rules.fr.js | 1 + Batman/engine/rules/rules.js | 4 +- Batman/engine/studio/studio_item.js | 2 +- Conan/data/rules/lang/rules.en.json | 3 ++ Conan/data/rules/lang/rules.fr.json | 3 ++ Conan/data/rules/lang/rules.it.json | 3 ++ Conan/encyclopedia/equipments/equipments.js | 2 +- .../equipments/lang/equipments.en.js | 3 +- .../equipments/lang/equipments.fr.js | 3 +- .../equipments/lang/equipments.it.js | 3 +- Conan/encyclopedia/heroes/heroes.js | 2 +- Conan/encyclopedia/models/lang/models.en.js | 3 +- Conan/encyclopedia/models/lang/models.fr.js | 3 +- Conan/encyclopedia/models/lang/models.it.js | 3 +- Conan/encyclopedia/models/models.js | 2 +- Conan/encyclopedia/spells/lang/spells.it.js | 1 + Conan/encyclopedia/spells/spells.js | 2 +- Conan/encyclopedia/tiles/lang/tiles.it.js | 1 + Conan/encyclopedia/tiles/tiles.js | 2 +- Conan/encyclopedia/tokens/tokens.js | 2 +- Conan/engine/Version.json | 2 +- Conan/engine/general/nav.css | 53 +++++++++++++++---- Conan/engine/general/nav.js | 47 +++++++++------- Conan/engine/rules/lang/rules.fr.js | 1 + Conan/engine/rules/rules.js | 4 +- Conan/engine/studio/studio_item.js | 2 +- .../card_equipment/lang/card_equipment.en.js | 3 +- .../card_equipment/lang/card_equipment.fr.js | 3 +- .../card_equipment/lang/card_equipment.it.js | 3 +- Conan/studio/card_spell/lang/card_spell.it.js | 1 + Conan/studio/tile/lang/tile.it.js | 1 + 36 files changed, 199 insertions(+), 75 deletions(-) diff --git a/Batman/data/rules/lang/rules.en.json b/Batman/data/rules/lang/rules.en.json index 3e7bf416..39d851bf 100644 --- a/Batman/data/rules/lang/rules.en.json +++ b/Batman/data/rules/lang/rules.en.json @@ -2,6 +2,7 @@ "list": { "corebox": { "title": "Rulebook", + "shorttitle": "Rule", "download": "https://the-overlord.net/index.php?/files/file/91-batman-gotham-city-chronicles-rulebook-coreboxes/", "pages": 46 }, @@ -22,6 +23,7 @@ }, "narrows": { "title": "Narrows Chronicles", + "shorttitle": "Narrows Chronic.", "download": "https://the-overlord.net/index.php?/files/file/98-batman-gotham-city-chronicles-narrows-chronicles-booklet/", "pages": 1 } diff --git a/Batman/data/rules/lang/rules.fr.json b/Batman/data/rules/lang/rules.fr.json index 5218927a..b55c3daa 100644 --- a/Batman/data/rules/lang/rules.fr.json +++ b/Batman/data/rules/lang/rules.fr.json @@ -2,6 +2,7 @@ "list": { "corebox": { "title": "Livre des règles", + "shorttitle": "Règles", "download": "https://the-overlord.com/index.php?/files/file/147-batman-gotham-city-chronicles-livret-de-r%C3%A8gles-bo%C3%AEtes-de-base/", "pages": 46 }, @@ -22,6 +23,7 @@ }, "narrows": { "title": "Narrows Chronicles", + "shorttitle": "Narrows Chronic.", "download": "https://the-overlord.com/index.php?/files/file/159-batman-gotham-city-chronicles-livret-narrows-chronicles/", "pages": 1 } diff --git a/Batman/engine/Version.json b/Batman/engine/Version.json index 9b7f3c01..551e7be9 100644 --- a/Batman/engine/Version.json +++ b/Batman/engine/Version.json @@ -1,3 +1,3 @@ { - "version": "0.24.12" + "version": "0.24.13" } \ No newline at end of file diff --git a/Batman/engine/general/nav.css b/Batman/engine/general/nav.css index ba767669..c92b60bf 100644 --- a/Batman/engine/general/nav.css +++ b/Batman/engine/general/nav.css @@ -373,6 +373,9 @@ } +.nav-menu .l, .nav-menu.short .s { display: unset; } +.nav-menu .s, .nav-menu.short .l { display: none; } + .nav-menu a { font-size: calc(var(--primary-size) * 1rem); white-space: nowrap; @@ -389,31 +392,63 @@ font-size: calc(var(--primary-size) * 0.925rem); } .nav-menu.size7 a { - font-size: calc(var(--primary-size) * 0.9rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } .nav-menu.size6 a { font-size: calc(var(--primary-size) * 0.875rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size5 a wbr { display: unset; } .nav-menu.size5 a { - font-size: calc(var(--primary-size) * 0.925rem); line-height: calc(var(--primary-line-height) * 1.1875rem); white-space: unset; } -.nav-menu.size5 a wbr { display: unset; } +.nav-menu.size4 a wbr { display: none; } .nav-menu.size4 a { - font-size: calc(var(--primary-size) * 0.9rem); + font-size: calc(var(--primary-size) * 0.85rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size3 a wbr { display: unset; } .nav-menu.size3 a { - font-size: calc(var(--primary-size) * 0.875rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } +.nav-menu.size2 a wbr { display: none; } .nav-menu.size2 a { - font-size: calc(var(--primary-size) * 0.85rem); + font-size: calc(var(--primary-size) * 0.825rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size1 a wbr { display: unset; } .nav-menu.size1 a { - font-size: calc(var(--primary-size) * 0.825rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; +} +.nav-menu.size0 a wbr { display: none; } +.nav-menu.size0 a { + font-size: calc(var(--primary-size) * 0.8rem); + line-height: 39px; + white-space: nowrap; +} +.nav-menu.size-1 a wbr { display: unset; } +.nav-menu.size-1 a { + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; +} +.nav-menu.size-2 a wbr { display: none; } +.nav-menu.size-2 a { + font-size: calc(var(--primary-size) * 0.775rem); + line-height: 39px; + white-space: nowrap; +} +.nav-menu.size-3 a wbr { display: unset; } +.nav-menu.size-3 a { + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } - - diff --git a/Batman/engine/general/nav.js b/Batman/engine/general/nav.js index d70338bd..ed5506ac 100644 --- a/Batman/engine/general/nav.js +++ b/Batman/engine/general/nav.js @@ -253,7 +253,7 @@ Nav = { var tb = $(".header .toolbar") var maxWidth = $(".header").width() - tb.width(); - var maxHeight = 60; + var maxHeight = 40; for (var i = 0; i < sizes.length; i++) { @@ -512,11 +512,10 @@ Nav = { { var slider = $(s); - var sizes = ["size10", "size9", "size8", "size7", "size6", "size5", "size4", "size3", "size2", "size1"]; + var sizes = ["size10", "size9", "size8", "size7", "size6", "size5", "size4", "size3", "size2", "size1", "size0", "size-1", "size-2", "size-3"]; slider.removeClass(sizes.join(" ")); - var tabs = slider.find("a"); var maxWidth = tabs.width(); @@ -526,23 +525,35 @@ Nav = { $(button).width(tabs.offset().left); } - for (var i = 0; i < sizes.length; i++) + var tooSmall; + slider.addClass("normal").removeClass("short"); + resize("span.l"); + if (tooSmall) { - var tooSmall = false; - tabs.each(function(tindex, t) { - if ($("span", t).width() > maxWidth) + slider.removeClass(sizes.join(" ")); + slider.addClass("short").removeClass("normal"); + resize("span.s"); + } + function resize(selector) + { + for (var i = 0; i < sizes.length; i++) + { + tooSmall = false; + tabs.each(function(tindex, t) { + if ($(selector, t).width() > maxWidth) + { + tooSmall = true; + return false; + } + }); + if (tooSmall) { - tooSmall = true; - return false; + slider.addClass(sizes[i]); + } + else + { + break; } - }); - if (tooSmall) - { - slider.addClass(sizes[i]); - } - else - { - break; } } }, @@ -553,7 +564,7 @@ Nav = { var subzone = ""; for (var i in tabs) { - subcode += "" + tabs[i].label + ""; + subcode += "" + tabs[i].label + "" + (tabs[i].shortLabel || tabs[i].label) + ""; subzone += "
"; } diff --git a/Batman/engine/rules/lang/rules.fr.js b/Batman/engine/rules/lang/rules.fr.js index 25596280..e334fe22 100644 --- a/Batman/engine/rules/lang/rules.fr.js +++ b/Batman/engine/rules/lang/rules.fr.js @@ -1,6 +1,7 @@ Rules._i18n = { 'menu': "Règles", 'skills': "Compétences", + 'shortskills': "Comp.", 'clarification': "Clarification :", 'viewer-search': "Recherche dans le document", diff --git a/Batman/engine/rules/rules.js b/Batman/engine/rules/rules.js index 4cc798ad..0f3191ad 100644 --- a/Batman/engine/rules/rules.js +++ b/Batman/engine/rules/rules.js @@ -9,6 +9,7 @@ var Rules = { Rules._rules = [{ label: Rules._i18n.skills, + shortLabel: Rules._i18n.shortskills, id: "skills", download: Encyclopedia.skills.link }]; @@ -17,7 +18,8 @@ var Rules = { if (About._hasExpansion(Encyclopedia.rules.list[i].origins) || window.About && About.getPreference("rules-showmine") === "false") { Rules._rules.push({ - label: Encyclopedia.rules.list[i].title, + label: Encyclopedia.rules.list[i].title, + shortLabel: Encyclopedia.rules.list[i].shorttitle, id: Encyclopedia.rules.list[i].id, download: Encyclopedia.rules.list[i].download, pages: Encyclopedia.rules.list[i].pages diff --git a/Batman/engine/studio/studio_item.js b/Batman/engine/studio/studio_item.js index b91cd334..2acb0ea4 100644 --- a/Batman/engine/studio/studio_item.js +++ b/Batman/engine/studio/studio_item.js @@ -10,7 +10,7 @@ var StudioItem = { _itemHeight: 300, preinit: function() { - Studio._slides.push({ label: this._i18n.tab, id: this.name, onShow: this.onShow.bind(this), onHide: this.onHide.bind(this) }); + Studio._slides.push({ label: this._i18n.tab, shortLabel: this._i18n.shorttab, id: this.name, onShow: this.onShow.bind(this), onHide: this.onHide.bind(this) }); }, init: function() { diff --git a/Conan/data/rules/lang/rules.en.json b/Conan/data/rules/lang/rules.en.json index 37872451..104fc14a 100644 --- a/Conan/data/rules/lang/rules.en.json +++ b/Conan/data/rules/lang/rules.en.json @@ -2,16 +2,19 @@ "list": { "heroes": { "title": "Heroes's book", + "shorttitle": "Heroes", "download": "http://www.monolithedition.com/download/rules/CONAN_Heroesrulebook_V2_US_SD.pdf", "pages": 24 }, "overlord": { "title": "Overlord's book", + "shorttitle": "Overlord", "download": "http://www.monolithedition.com/download/rules/CONAN_King_Overlordbook_V2_US_SD.pdf", "pages": 14 }, "tomeofskelos": { "title": "Tome of Skelos", + "shorttitle": "Skelos", "download": "https://the-overlord.net/index.php?/files/file/174-tome-of-skelos-final-version-of-the-solocoop-rules/", "pages": 11 } diff --git a/Conan/data/rules/lang/rules.fr.json b/Conan/data/rules/lang/rules.fr.json index 55bc1a0b..7ae90b64 100644 --- a/Conan/data/rules/lang/rules.fr.json +++ b/Conan/data/rules/lang/rules.fr.json @@ -2,16 +2,19 @@ "list": { "heroes": { "title": "Livre des héros", + "shorttitle": "Héros", "download": "https://the-overlord.com/index.php?/files/file/2-livret-de-r%C3%A8gles-des-h%C3%A9ros/", "pages": 24 }, "overlord": { "title": "Livre de l'Overlord", + "shorttitle": "Overlord", "download": "https://the-overlord.com/index.php?/files/file/3-livret-de-r%C3%A8gles-de-l%E2%80%99overlord/", "pages": 14 }, "tomeofskelos": { "title": "Tome de Skelos", + "shorttitle": "Skelos", "download": "https://the-overlord.com/index.php?/files/file/232-livre-de-skelos-r%C3%A8gle-solocoop-version-finale/", "pages": 12 } diff --git a/Conan/data/rules/lang/rules.it.json b/Conan/data/rules/lang/rules.it.json index 56d4c0c5..2488eaf3 100644 --- a/Conan/data/rules/lang/rules.it.json +++ b/Conan/data/rules/lang/rules.it.json @@ -2,16 +2,19 @@ "list": { "heroes": { "title": "Libro degli Eroi", + "shorttitle": "Eroi", "download": "https://the-overlord.net/index.php?/files/file/156-conan-heroesrulebook-v21-ita/", "pages": 24 }, "overlord": { "title": "Libro dell'Overlord", + "shorttitle": "Overlord", "download": "https://the-overlord.net/index.php?/files/file/157-conan_king_overlordbook_v21_ita_txt/", "pages": 14 }, "tomeofskelos": { "title": "Libro di Skelos", + "shorttitle": "Skelos", "download": "https://the-overlord.net/index.php?/files/file/173-tome-of-skelos-italian-translation-final-version-of-the-solocoop-rules/", "pages": 12 } diff --git a/Conan/encyclopedia/equipments/equipments.js b/Conan/encyclopedia/equipments/equipments.js index f99b4ecb..620175a9 100644 --- a/Conan/encyclopedia/equipments/equipments.js +++ b/Conan/encyclopedia/equipments/equipments.js @@ -1,7 +1,7 @@ var EncyclopediaEquipments = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaEquipments._i18n.tab, id: "encyclopedia-equipment", onShow: EncyclopediaEquipments.onShow, onHide: EncyclopediaEquipments.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaEquipments._i18n.tab, shortLabel: EncyclopediaEquipments._i18n.shorttab, id: "encyclopedia-equipment", onShow: EncyclopediaEquipments.onShow, onHide: EncyclopediaEquipments.onHide }); EncyclopediaEquipments._facets = Utils.mergeObject([ { diff --git a/Conan/encyclopedia/equipments/lang/equipments.en.js b/Conan/encyclopedia/equipments/lang/equipments.en.js index d480a8db..0cbc3a81 100644 --- a/Conan/encyclopedia/equipments/lang/equipments.en.js +++ b/Conan/encyclopedia/equipments/lang/equipments.en.js @@ -1,5 +1,6 @@ EncyclopediaEquipments._i18n = { - 'tab': "Equipments", + 'tab': "Equipments", + 'shorttab': "Equip.", 'transfertToStudio': "Copy the card into the studio", 'transfertOK': "The card was copied to the equipment cards studio", 'transfertConfirm': "Do you want to copy the card into the studio in order to edit it or print it?", diff --git a/Conan/encyclopedia/equipments/lang/equipments.fr.js b/Conan/encyclopedia/equipments/lang/equipments.fr.js index f0b99f9f..302ba333 100644 --- a/Conan/encyclopedia/equipments/lang/equipments.fr.js +++ b/Conan/encyclopedia/equipments/lang/equipments.fr.js @@ -1,5 +1,6 @@ EncyclopediaEquipments._i18n = { - 'tab': "Equipements", + 'tab': "Equipements", + 'shorttab': "Equip.", 'transfertToStudio': "Copier la carte dans le studio", 'transfertOK': "La carte a été copiée dans le studio des cartes d'équipements", 'transfertConfirm': "Voulez-vous copier la carte dans le studio pour pouvoir la modifier ou l'imprimer ?", diff --git a/Conan/encyclopedia/equipments/lang/equipments.it.js b/Conan/encyclopedia/equipments/lang/equipments.it.js index 71d64c3b..1dcb0dca 100644 --- a/Conan/encyclopedia/equipments/lang/equipments.it.js +++ b/Conan/encyclopedia/equipments/lang/equipments.it.js @@ -1,5 +1,6 @@ EncyclopediaEquipments._i18n = { - 'tab': "Equipaggiamento", + 'tab': "Equipaggiamento", + 'shorttab': "Equip.", 'transfertToStudio': "Copia la carta nello Studio", 'transfertOK': "La carta è stata copiata nelle carte equipaggiamento dello Studio.", 'transfertConfirm': "Vuoi copiare la carta nello Studio per modificarla o stamparla?", diff --git a/Conan/encyclopedia/heroes/heroes.js b/Conan/encyclopedia/heroes/heroes.js index 97cd5287..05b7786a 100644 --- a/Conan/encyclopedia/heroes/heroes.js +++ b/Conan/encyclopedia/heroes/heroes.js @@ -1,7 +1,7 @@ var EncyclopediaHeroes = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaHeroes._i18n.tab, id: "encyclopedia-heroes", onShow: EncyclopediaHeroes.onShow, onHide: EncyclopediaHeroes.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaHeroes._i18n.tab, shortLabel: EncyclopediaHeroes._i18n.shorttab, id: "encyclopedia-heroes", onShow: EncyclopediaHeroes.onShow, onHide: EncyclopediaHeroes.onHide }); EncyclopediaHeroes._facets = Utils.mergeObject([ diff --git a/Conan/encyclopedia/models/lang/models.en.js b/Conan/encyclopedia/models/lang/models.en.js index 9fa97b61..09893891 100644 --- a/Conan/encyclopedia/models/lang/models.en.js +++ b/Conan/encyclopedia/models/lang/models.en.js @@ -1,5 +1,6 @@ EncyclopediaModels._i18n = { - 'tab': "Miniatures", + 'tab': "Miniatures", + 'shorttab': "Minis", 'from': "Available in:", 'fromAnd': "
and", 'model': "miniature", diff --git a/Conan/encyclopedia/models/lang/models.fr.js b/Conan/encyclopedia/models/lang/models.fr.js index 62326712..37adb00a 100644 --- a/Conan/encyclopedia/models/lang/models.fr.js +++ b/Conan/encyclopedia/models/lang/models.fr.js @@ -1,5 +1,6 @@ EncyclopediaModels._i18n = { - 'tab': "Figurines", + 'tab': "Figurines", + 'shorttab': "Figs", 'from': "Disponible dans :", 'fromAnd': "
et", 'model': "figurine", diff --git a/Conan/encyclopedia/models/lang/models.it.js b/Conan/encyclopedia/models/lang/models.it.js index 574f878f..e2c5c20e 100644 --- a/Conan/encyclopedia/models/lang/models.it.js +++ b/Conan/encyclopedia/models/lang/models.it.js @@ -1,5 +1,6 @@ EncyclopediaModels._i18n = { - 'tab': "Miniature", + 'tab': "Miniature", + 'shorttab': "Mini", 'from': "Disponibile in:", 'fromAnd': "
e", 'model': "miniatura", diff --git a/Conan/encyclopedia/models/models.js b/Conan/encyclopedia/models/models.js index 2e24411c..8685207b 100644 --- a/Conan/encyclopedia/models/models.js +++ b/Conan/encyclopedia/models/models.js @@ -1,7 +1,7 @@ var EncyclopediaModels = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaModels._i18n.tab, id: "encyclopedia-models", onShow: EncyclopediaModels.onShow, onHide: EncyclopediaModels.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaModels._i18n.tab, shortLabel: EncyclopediaModels._i18n.shorttab, id: "encyclopedia-models", onShow: EncyclopediaModels.onShow, onHide: EncyclopediaModels.onHide }); EncyclopediaModels._facets = Utils.mergeObject([ { diff --git a/Conan/encyclopedia/spells/lang/spells.it.js b/Conan/encyclopedia/spells/lang/spells.it.js index 31c0f782..c9f07f63 100644 --- a/Conan/encyclopedia/spells/lang/spells.it.js +++ b/Conan/encyclopedia/spells/lang/spells.it.js @@ -1,5 +1,6 @@ EncyclopediaSpells._i18n = { 'tab': "Incantesimi", + 'shorttab': "Incant.", 'transfertToStudio': "Copia la carta nello Studio", 'transfertOK': "La carta è stata copiata nello Studio", 'transfertConfirm': "Vuoi copiare la carta nello Studio per modificarla o stamparla?", diff --git a/Conan/encyclopedia/spells/spells.js b/Conan/encyclopedia/spells/spells.js index f68eef25..e1bcd68c 100644 --- a/Conan/encyclopedia/spells/spells.js +++ b/Conan/encyclopedia/spells/spells.js @@ -1,7 +1,7 @@ var EncyclopediaSpells = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaSpells._i18n.tab, id: "encyclopedia-spell", onShow: EncyclopediaSpells.onShow, onHide: EncyclopediaSpells.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaSpells._i18n.tab, shortLabel: EncyclopediaSpells._i18n.shorttab, id: "encyclopedia-spell", onShow: EncyclopediaSpells.onShow, onHide: EncyclopediaSpells.onHide }); EncyclopediaSpells._facets = Utils.mergeObject([ { diff --git a/Conan/encyclopedia/tiles/lang/tiles.it.js b/Conan/encyclopedia/tiles/lang/tiles.it.js index 794ac4a0..9050b41e 100644 --- a/Conan/encyclopedia/tiles/lang/tiles.it.js +++ b/Conan/encyclopedia/tiles/lang/tiles.it.js @@ -1,5 +1,6 @@ EncyclopediaTiles._i18n = { 'tab': "Tessere", + 'shorttab': "Tess.", 'transfertToStudio': "Copia la carta nello Studio", 'transfertOK': "La carta è stata copiata nello Studio", 'transfertConfirm': "Vuoi copiare la carta nello Studio per modificarla o stamparla?", diff --git a/Conan/encyclopedia/tiles/tiles.js b/Conan/encyclopedia/tiles/tiles.js index 5c11e672..ac70e47a 100644 --- a/Conan/encyclopedia/tiles/tiles.js +++ b/Conan/encyclopedia/tiles/tiles.js @@ -1,7 +1,7 @@ var EncyclopediaTiles = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaTiles._i18n.tab, id: "encyclopedia-tile", onShow: EncyclopediaTiles.onShow, onHide: EncyclopediaTiles.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaTiles._i18n.tab, shortLabel: EncyclopediaTiles._i18n.shorttab, id: "encyclopedia-tile", onShow: EncyclopediaTiles.onShow, onHide: EncyclopediaTiles.onHide }); EncyclopediaTiles._facets = Utils.mergeObject([ { diff --git a/Conan/encyclopedia/tokens/tokens.js b/Conan/encyclopedia/tokens/tokens.js index ca686aa4..790fb450 100644 --- a/Conan/encyclopedia/tokens/tokens.js +++ b/Conan/encyclopedia/tokens/tokens.js @@ -1,7 +1,7 @@ var EncyclopediaTokens = { preinit: function() { - Encyclopedia._slides.push({ label: EncyclopediaTokens._i18n.tab, id: "encyclopedia-token", onShow: EncyclopediaTokens.onShow, onHide: EncyclopediaTokens.onHide }); + Encyclopedia._slides.push({ label: EncyclopediaTokens._i18n.tab, shortLabel: EncyclopediaTokens._i18n.shorttab, id: "encyclopedia-token", onShow: EncyclopediaTokens.onShow, onHide: EncyclopediaTokens.onHide }); EncyclopediaTokens._facets = Utils.mergeObject([ { diff --git a/Conan/engine/Version.json b/Conan/engine/Version.json index 9b7f3c01..551e7be9 100644 --- a/Conan/engine/Version.json +++ b/Conan/engine/Version.json @@ -1,3 +1,3 @@ { - "version": "0.24.12" + "version": "0.24.13" } \ No newline at end of file diff --git a/Conan/engine/general/nav.css b/Conan/engine/general/nav.css index ba767669..c92b60bf 100644 --- a/Conan/engine/general/nav.css +++ b/Conan/engine/general/nav.css @@ -373,6 +373,9 @@ } +.nav-menu .l, .nav-menu.short .s { display: unset; } +.nav-menu .s, .nav-menu.short .l { display: none; } + .nav-menu a { font-size: calc(var(--primary-size) * 1rem); white-space: nowrap; @@ -389,31 +392,63 @@ font-size: calc(var(--primary-size) * 0.925rem); } .nav-menu.size7 a { - font-size: calc(var(--primary-size) * 0.9rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } .nav-menu.size6 a { font-size: calc(var(--primary-size) * 0.875rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size5 a wbr { display: unset; } .nav-menu.size5 a { - font-size: calc(var(--primary-size) * 0.925rem); line-height: calc(var(--primary-line-height) * 1.1875rem); white-space: unset; } -.nav-menu.size5 a wbr { display: unset; } +.nav-menu.size4 a wbr { display: none; } .nav-menu.size4 a { - font-size: calc(var(--primary-size) * 0.9rem); + font-size: calc(var(--primary-size) * 0.85rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size3 a wbr { display: unset; } .nav-menu.size3 a { - font-size: calc(var(--primary-size) * 0.875rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } +.nav-menu.size2 a wbr { display: none; } .nav-menu.size2 a { - font-size: calc(var(--primary-size) * 0.85rem); + font-size: calc(var(--primary-size) * 0.825rem); + line-height: 39px; + white-space: nowrap; } +.nav-menu.size1 a wbr { display: unset; } .nav-menu.size1 a { - font-size: calc(var(--primary-size) * 0.825rem); + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; +} +.nav-menu.size0 a wbr { display: none; } +.nav-menu.size0 a { + font-size: calc(var(--primary-size) * 0.8rem); + line-height: 39px; + white-space: nowrap; +} +.nav-menu.size-1 a wbr { display: unset; } +.nav-menu.size-1 a { + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; +} +.nav-menu.size-2 a wbr { display: none; } +.nav-menu.size-2 a { + font-size: calc(var(--primary-size) * 0.775rem); + line-height: 39px; + white-space: nowrap; +} +.nav-menu.size-3 a wbr { display: unset; } +.nav-menu.size-3 a { + line-height: calc(var(--primary-line-height) * 1.1875rem); + white-space: unset; } - - diff --git a/Conan/engine/general/nav.js b/Conan/engine/general/nav.js index d70338bd..ed5506ac 100644 --- a/Conan/engine/general/nav.js +++ b/Conan/engine/general/nav.js @@ -253,7 +253,7 @@ Nav = { var tb = $(".header .toolbar") var maxWidth = $(".header").width() - tb.width(); - var maxHeight = 60; + var maxHeight = 40; for (var i = 0; i < sizes.length; i++) { @@ -512,11 +512,10 @@ Nav = { { var slider = $(s); - var sizes = ["size10", "size9", "size8", "size7", "size6", "size5", "size4", "size3", "size2", "size1"]; + var sizes = ["size10", "size9", "size8", "size7", "size6", "size5", "size4", "size3", "size2", "size1", "size0", "size-1", "size-2", "size-3"]; slider.removeClass(sizes.join(" ")); - var tabs = slider.find("a"); var maxWidth = tabs.width(); @@ -526,23 +525,35 @@ Nav = { $(button).width(tabs.offset().left); } - for (var i = 0; i < sizes.length; i++) + var tooSmall; + slider.addClass("normal").removeClass("short"); + resize("span.l"); + if (tooSmall) { - var tooSmall = false; - tabs.each(function(tindex, t) { - if ($("span", t).width() > maxWidth) + slider.removeClass(sizes.join(" ")); + slider.addClass("short").removeClass("normal"); + resize("span.s"); + } + function resize(selector) + { + for (var i = 0; i < sizes.length; i++) + { + tooSmall = false; + tabs.each(function(tindex, t) { + if ($(selector, t).width() > maxWidth) + { + tooSmall = true; + return false; + } + }); + if (tooSmall) { - tooSmall = true; - return false; + slider.addClass(sizes[i]); + } + else + { + break; } - }); - if (tooSmall) - { - slider.addClass(sizes[i]); - } - else - { - break; } } }, @@ -553,7 +564,7 @@ Nav = { var subzone = ""; for (var i in tabs) { - subcode += "" + tabs[i].label + ""; + subcode += "" + tabs[i].label + "" + (tabs[i].shortLabel || tabs[i].label) + ""; subzone += "
"; } diff --git a/Conan/engine/rules/lang/rules.fr.js b/Conan/engine/rules/lang/rules.fr.js index 25596280..e334fe22 100644 --- a/Conan/engine/rules/lang/rules.fr.js +++ b/Conan/engine/rules/lang/rules.fr.js @@ -1,6 +1,7 @@ Rules._i18n = { 'menu': "Règles", 'skills': "Compétences", + 'shortskills': "Comp.", 'clarification': "Clarification :", 'viewer-search': "Recherche dans le document", diff --git a/Conan/engine/rules/rules.js b/Conan/engine/rules/rules.js index 4cc798ad..0f3191ad 100644 --- a/Conan/engine/rules/rules.js +++ b/Conan/engine/rules/rules.js @@ -9,6 +9,7 @@ var Rules = { Rules._rules = [{ label: Rules._i18n.skills, + shortLabel: Rules._i18n.shortskills, id: "skills", download: Encyclopedia.skills.link }]; @@ -17,7 +18,8 @@ var Rules = { if (About._hasExpansion(Encyclopedia.rules.list[i].origins) || window.About && About.getPreference("rules-showmine") === "false") { Rules._rules.push({ - label: Encyclopedia.rules.list[i].title, + label: Encyclopedia.rules.list[i].title, + shortLabel: Encyclopedia.rules.list[i].shorttitle, id: Encyclopedia.rules.list[i].id, download: Encyclopedia.rules.list[i].download, pages: Encyclopedia.rules.list[i].pages diff --git a/Conan/engine/studio/studio_item.js b/Conan/engine/studio/studio_item.js index b91cd334..2acb0ea4 100644 --- a/Conan/engine/studio/studio_item.js +++ b/Conan/engine/studio/studio_item.js @@ -10,7 +10,7 @@ var StudioItem = { _itemHeight: 300, preinit: function() { - Studio._slides.push({ label: this._i18n.tab, id: this.name, onShow: this.onShow.bind(this), onHide: this.onHide.bind(this) }); + Studio._slides.push({ label: this._i18n.tab, shortLabel: this._i18n.shorttab, id: this.name, onShow: this.onShow.bind(this), onHide: this.onHide.bind(this) }); }, init: function() { diff --git a/Conan/studio/card_equipment/lang/card_equipment.en.js b/Conan/studio/card_equipment/lang/card_equipment.en.js index cea61ba1..01f362f4 100644 --- a/Conan/studio/card_equipment/lang/card_equipment.en.js +++ b/Conan/studio/card_equipment/lang/card_equipment.en.js @@ -1,5 +1,6 @@ CardEquipment._i18n = { - 'tab': "Equipments", + 'tab': "Equipments", + 'shorttab': "Equip.", 'nocard': "You have no card for the moment", 'nocard2': "

Click on the + button to create one", 'newcard': "Create an equipment", diff --git a/Conan/studio/card_equipment/lang/card_equipment.fr.js b/Conan/studio/card_equipment/lang/card_equipment.fr.js index 212d3ef9..9f4a53ec 100644 --- a/Conan/studio/card_equipment/lang/card_equipment.fr.js +++ b/Conan/studio/card_equipment/lang/card_equipment.fr.js @@ -1,5 +1,6 @@ CardEquipment._i18n = { - 'tab': "Équipements", + 'tab': "Équipements", + 'shorttab': "Équip.", 'nocard': "Vous n'avez aucune carte d'équipement pour le moment", 'nocard2': "

Cliquez sur le bouton + pour en creer une", 'newcard': "Créer un équipement", diff --git a/Conan/studio/card_equipment/lang/card_equipment.it.js b/Conan/studio/card_equipment/lang/card_equipment.it.js index bc7aa071..e8207396 100644 --- a/Conan/studio/card_equipment/lang/card_equipment.it.js +++ b/Conan/studio/card_equipment/lang/card_equipment.it.js @@ -1,5 +1,6 @@ CardEquipment._i18n = { - 'tab': "Equipaggiamento", + 'tab': "Equipaggiamento", + 'shorttab': "Equip.", 'nocard': "Al momento non hai carte", 'nocard2': "

Clicca su + per crearne una", 'newcard': "Crea una carta equipaggiamento", diff --git a/Conan/studio/card_spell/lang/card_spell.it.js b/Conan/studio/card_spell/lang/card_spell.it.js index 08374015..ef61f72f 100644 --- a/Conan/studio/card_spell/lang/card_spell.it.js +++ b/Conan/studio/card_spell/lang/card_spell.it.js @@ -1,5 +1,6 @@ CardSpell._i18n = { 'tab': "Incantesimi", + 'shorttab': "Incant.", 'nocard': "Al momento non hai carte", 'nocard2': "

Clicca su + per crearne una", 'newcard': "Crea una carta incantesimo", diff --git a/Conan/studio/tile/lang/tile.it.js b/Conan/studio/tile/lang/tile.it.js index 140db79c..d2b4a9e3 100644 --- a/Conan/studio/tile/lang/tile.it.js +++ b/Conan/studio/tile/lang/tile.it.js @@ -1,5 +1,6 @@ Tile._i18n = { 'tab': "Tessere", + 'shorttab': "Tess.", 'nocard': "Non hai tessere al momento", 'nocard2': "

CLicca su + per crearne una", 'newcard': "Crea una tessera",