Skip to content

Commit

Permalink
🎨 aria label
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Sep 9, 2023
1 parent 658e68d commit b0653df
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 8 deletions.
3 changes: 3 additions & 0 deletions app/appearance/icons/ant/icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/appearance/icons/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@
<body>
<h2>SiYuan</h2>
<div class="fn__clear">
<div>
<svg>
<use xlink:href="#iconAttr"></use>
</svg>
iconAttr
</div>
<div>
<svg>
<use xlink:href="#iconPaste"></use>
Expand Down
3 changes: 3 additions & 0 deletions app/appearance/icons/material/icon.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions app/src/layout/Wnd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export class Wnd {
<ul class="fn__flex layout-tab-bar"></ul>
<ul class="layout-tab-bar layout-tab-bar--readonly fn__flex-1">
<li class="item item--readonly">
<span data-type="new" class="block__icon block__icon--show" title="${window.siyuan.languages.newFile}"><svg><use xlink:href="#iconAdd"></use></svg></span>
<span data-type="new" class="block__icon block__icon--show ariaLabel" aria-label="${window.siyuan.languages.newFile}"><svg><use xlink:href="#iconAdd"></use></svg></span>
<span class="fn__flex-1"></span>
<span data-type="more" data-menu="true" class="block__icon block__icon--show" title="${window.siyuan.languages.more}"><svg><use xlink:href="#iconDown"></use></svg></span>
<span data-type="more" data-menu="true" class="block__icon block__icon--show ariaLabel" aria-label="${window.siyuan.languages.switchTab}"><svg><use xlink:href="#iconDown"></use></svg></span>
</li>
</ul>
</div>
Expand Down
1 change: 1 addition & 0 deletions app/src/menus/navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ export const initFileMenu = (app: App, notebookId: string, pathString: string, l
}));
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.attr,
icon: "iconAttr",
click() {
fetchPost("/api/block/getDocInfo", {
id
Expand Down
11 changes: 6 additions & 5 deletions app/src/protyle/breadcrumb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ export class Breadcrumb {
'<div class="protyle-breadcrumb__bar"></div>'}
<span class="protyle-breadcrumb__space"></span>
<button class="protyle-breadcrumb__icon fn__none" data-type="exit-focus">${window.siyuan.languages.exitFocus}</button>
<button class="block__icon block__icon--show fn__flex-center" data-type="readonly"><svg><use xlink:href="#iconUnlock"></use></svg></button>
<button class="block__icon block__icon--show fn__flex-center ariaLabel" aria-label="${window.siyuan.languages.editReadonly}" data-type="readonly"><svg><use xlink:href="#iconUnlock"></use></svg></button>
<span class="fn__space"></span>
<button class="block__icon block__icon--show fn__flex-center" data-type="a" data-position="right" aria-label="${window.siyuan.languages.gutterTip2}"><svg><use xlink:href="#iconFile"></use></svg></button>
<button class="block__icon block__icon--show fn__flex-center ariaLabel" data-type="doc" aria-label="${window.siyuan.languages.gutterTip2}"><svg><use xlink:href="#iconFile"></use></svg></button>
<span class="fn__space"></span>
<button class="block__icon block__icon--show fn__flex-center" data-type="more"><svg><use xlink:href="#iconMore"></use></svg></button>
<button class="block__icon block__icon--show fn__flex-center fn__none" style="margin-left: 8px" data-type="context" aria-label="${window.siyuan.languages.context}"><svg><use xlink:href="#iconAlignCenter"></use></svg></button>`;
<button class="block__icon block__icon--show fn__flex-center ariaLabel" data-type="more" aria-label="${window.siyuan.languages.more}"><svg><use xlink:href="#iconMore"></use></svg></button>
<button class="block__icon block__icon--show fn__flex-center fn__none ariaLabel" style="margin-left: 8px" data-type="context" aria-label="${window.siyuan.languages.context}"><svg><use xlink:href="#iconAlignCenter"></use></svg></button>`;

this.element = element.firstElementChild as HTMLElement;
element.addEventListener("click", (event) => {
Expand Down Expand Up @@ -83,7 +83,7 @@ export class Breadcrumb {
event.preventDefault();
event.stopPropagation();
break;
} else if (type === "a") {
} else if (type === "doc") {
if (window.siyuan.shiftIsPressed) {
fetchPost("/api/block/getDocInfo", {
id: protyle.block.rootID
Expand Down Expand Up @@ -475,6 +475,7 @@ export class Breadcrumb {
const isCustomFullWidth = protyle.wysiwyg.element.getAttribute(Constants.CUSTOM_SY_FULLWIDTH);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.fullWidth,
icon: "iconDock",
type: "submenu",
submenu: [{
iconHTML: "",
Expand Down
1 change: 1 addition & 0 deletions app/src/protyle/gutter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1475,6 +1475,7 @@ export class Gutter {
if (!protyle.disabled) {
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.attr,
icon: "iconAttr",
accelerator: window.siyuan.config.keymap.editor.general.attr.custom + "/" + updateHotkeyTip("⇧Click"),
click() {
openAttr(nodeElement);
Expand Down
1 change: 1 addition & 0 deletions app/src/protyle/header/openTitleMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export const openTitleMenu = (protyle: IProtyle, position: {
}
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.attr,
icon: "iconAttr",
accelerator: window.siyuan.config.keymap.editor.general.attr.custom + "/" + updateHotkeyTip("⇧Click"),
click() {
openFileAttr(response.data.ial);
Expand Down
2 changes: 1 addition & 1 deletion app/src/protyle/render/av/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
});
});
menu.addItem({
icon: "iconList",
icon: "iconAttr",
label: window.siyuan.languages.attr,
type: "submenu",
submenu: editAttrSubmenu
Expand Down

0 comments on commit b0653df

Please sign in to comment.