feat(viewer): #90 toolbar groupes aussi pour les fichiers texte non markdown
[pop-out][Bookmark] | [Editer][Source][.ext][Pretty] | [Copier] | [Partager] - TOC ancre uniquement au markdown (plus de bouton TOC sur .sh/.py/...) - PDF/Export deja ancres au markdown: groupe export = [Copier] seul sur texte - tests toolbar-order mis a jour (conditions is_markdown sur nav/export)
This commit is contained in:
@@ -882,10 +882,14 @@ export function renderFile(data) {
|
||||
// Separateur visuel entre les groupes d'actions (#90)
|
||||
const actionSep = () => el("span", { class: "action-sep" });
|
||||
// Ordre des boutons par groupes fonctionnels (#90) :
|
||||
// [TOC][pop-out][Bookmark] | [Editer][Source][.md][Forge] | [Copier][PDF][Export] | [Partager]
|
||||
// Boutons non affiches selon le type de fichier (Pretty, PDF/Export hors
|
||||
// markdown, ...) restent ancres a leur groupe ; spacer de groupe vide retire.
|
||||
const navBtns = [tocBtn, openNewWindowBtn, bookmarkBtn];
|
||||
// markdown : [TOC][pop-out][Bookmark] | [Editer][Source][.md][Forge] | [Copier][PDF][Export] | [Partager]
|
||||
// texte autre : [pop-out][Bookmark] | [Editer][Source][.ext][Pretty] | [Copier] | [Partager]
|
||||
// Boutons non applicables au type de fichier (TOC hors markdown, Pretty hors
|
||||
// texte, PDF/Export hors markdown, ...) restent ancres a leur groupe ;
|
||||
// spacer de groupe vide retire.
|
||||
const navBtns = [];
|
||||
if (data.is_markdown) navBtns.push(tocBtn);
|
||||
navBtns.push(openNewWindowBtn, bookmarkBtn);
|
||||
const editBtns = [];
|
||||
if (!data.unsupported) editBtns.push(editBtn);
|
||||
editBtns.push(sourceBtn);
|
||||
|
||||
Reference in New Issue
Block a user