- Enhancement (svgIcons): Fix JSDoc param def; add alt options

- Accessibility: Begin work, add aria-label to some buttons and
    form controls; add `role=main`; `<img alt>`; `<iframe title>`
- i18n: Add `lang` attribute
- Refactoring: lbs, simplify i18nized element retrieval call
- Docs: Some JSDoc descriptions, JSDoc spacing, fix svgIcons param
    def; add todo
- Testing: Avoid reporting meta-viewport (have own zooming
    controls and difficult to fix)
This commit is contained in:
Brett Zamir
2019-04-03 12:49:48 +08:00
parent 69ea647286
commit 056f4f197c
36 changed files with 968 additions and 382 deletions

View File

@@ -1,3 +1,4 @@
export default {
saved: 'Saved! Return to Item View!'
saved: 'Saved! Return to Item View!',
hiddenframe: 'Moinsave frame to store hidden values'
};

View File

@@ -0,0 +1,4 @@
export default {
uploading: 'Uploading...',
hiddenframe: 'Opensave frame to store hidden values'
};

View File

@@ -0,0 +1,4 @@
export default {
uploading: '正在上传...',
hiddenframe: 'Opensave frame to store hidden values'
};

View File

@@ -1,3 +1,4 @@
export default {
saved: '已保存! 返回视图!'
saved: '已保存! 返回视图!',
hiddenframe: 'Moinsave frame to store hidden values'
};

View File

@@ -1,3 +0,0 @@
export default {
uploading: 'Uploading...'
};

View File

@@ -1,3 +0,0 @@
export default {
uploading: '正在上传...'
};

View File

@@ -20,7 +20,10 @@ export default {
// Create upload target (hidden iframe)
// Hiding by size instead of display to avoid FF console errors
// with `getBBox` in browser.js `supportsPathBBox_`)
/* const target = */ $('<iframe name="output_frame" style="width: 0; height: 0;" src="#"/>').appendTo('body');
/* const target = */ $(
`<iframe name="output_frame" title="${strings.hiddenframe}"
style="width: 0; height: 0;" src="#"/>`
).appendTo('body');
svgEditor.setCustomHandlers({
async save (win, data) {

View File

@@ -61,7 +61,10 @@ export default {
// Hiding by size instead of display to avoid FF console errors
// with `getBBox` in browser.js `supportsPathBBox_`)
$('<iframe name="output_frame" style="width: 0; height: 0;" src="#"/>').appendTo('body');
$(
`<iframe name="output_frame" title="${strings.hiddenframe}"
style="width: 0; height: 0;" src="#"/>`
).appendTo('body');
svgEditor.setCustomHandlers({
save (win, data) {
const svg = '<?xml version="1.0" encoding="UTF-8"?>\n' + data, // Firefox doesn't seem to know it is UTF-8 (no matter whether we use or skip the clientDownload code) despite the Content-Disposition header containing UTF-8, but adding the encoding works