#603 unwanted function removed and translate changes
This commit is contained in:
@@ -180,38 +180,6 @@ class Editor extends EditorStartup {
|
||||
* @returns {void}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Allows one to override default SVGEdit `open`, `save`, and
|
||||
* `export` editor behaviors.
|
||||
* @function module:SVGthis.setCustomHandlers
|
||||
* @param {module:SVGthis.CustomHandler} opts Extension mechanisms may call `setCustomHandlers` with three functions: `opts.open`, `opts.save`, and `opts.exportImage`
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {PlainObject} opts
|
||||
* @returns {Promise<PlainObject>}
|
||||
*/
|
||||
setCustomHandlers(opts) {
|
||||
return this.ready(() => {
|
||||
if (opts.open) {
|
||||
this.svgCanvas.open = opts.open.bind(this);
|
||||
}
|
||||
if (opts.save) {
|
||||
this.showSaveWarning = false;
|
||||
this.svgCanvas.bind('saved', opts.save.bind(this));
|
||||
}
|
||||
if (opts.exportImage) {
|
||||
this.customExportImage = opts.exportImage.bind(this);
|
||||
this.svgCanvas.bind('exported', this.customExportImage); // canvg and our RGBColor will be available to the method
|
||||
}
|
||||
if (opts.exportPDF) {
|
||||
this.customExportPDF = opts.exportPDF.bind(this);
|
||||
this.svgCanvas.bind('exportedPDF', this.customExportPDF); // jsPDF and our RGBColor will be available to the method
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @function module:SVGthis.randomizeIds
|
||||
* @param {boolean} arg
|
||||
|
||||
@@ -163,13 +163,13 @@ export default {
|
||||
callback() {
|
||||
// eslint-disable-next-line no-unsanitized/property
|
||||
const buttonTemplate = `
|
||||
<se-menu-item id="tool_clear" label="${svgEditor.i18next.t('tools.new_doc')}" shortcut="N" src="${imgPath}/new.svg"></se-menu-item>`;
|
||||
<se-menu-item id="tool_clear" label="${svgEditor.i18next.t('opensave.new_doc')}" shortcut="N" src="${imgPath}/new.svg"></se-menu-item>`;
|
||||
svgCanvas.insertChildAtIndex($id('main_button'), buttonTemplate, 0);
|
||||
const openButtonTemplate = `<se-menu-item id="tool_open" label="${svgEditor.i18next.t('tools.open_doc')}" src="${imgPath}/open.svg"></se-menu-item>`;
|
||||
const openButtonTemplate = `<se-menu-item id="tool_open" label="${svgEditor.i18next.t('opensave.open_image_doc')}" src="${imgPath}/open.svg"></se-menu-item>`;
|
||||
svgCanvas.insertChildAtIndex($id('main_button'), openButtonTemplate, 1);
|
||||
const saveButtonTemplate = `<se-menu-item id="tool_save" label="${svgEditor.i18next.t('tools.save_doc')}" shortcut="S" src="${imgPath}/saveImg.svg"></se-menu-item>`;
|
||||
const saveButtonTemplate = `<se-menu-item id="tool_save" label="${svgEditor.i18next.t('opensave.save_doc')}" shortcut="S" src="${imgPath}/saveImg.svg"></se-menu-item>`;
|
||||
svgCanvas.insertChildAtIndex($id('main_button'), saveButtonTemplate, 2);
|
||||
const saveAsButtonTemplate = `<se-menu-item id="tool_save_as" label="${svgEditor.i18next.t('tools.save_as_doc')}" src="${imgPath}/saveImg.svg"></se-menu-item>`;
|
||||
const saveAsButtonTemplate = `<se-menu-item id="tool_save_as" label="${svgEditor.i18next.t('opensave.save_as_doc')}" src="${imgPath}/saveImg.svg"></se-menu-item>`;
|
||||
svgCanvas.insertChildAtIndex($id('main_button'), saveAsButtonTemplate, 3);
|
||||
// handler
|
||||
$id("tool_clear").addEventListener("click", clickClear.bind(this));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
tools: {
|
||||
opensave: {
|
||||
new_doc: 'New Image',
|
||||
open_doc: 'Open SVG',
|
||||
open_image_doc: 'Open SVG',
|
||||
save_doc: 'Save SVG',
|
||||
save_as_doc: 'Save as SVG'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
tools: {
|
||||
opensave: {
|
||||
new_doc: 'Nouvelle image',
|
||||
open_doc: 'Ouvrir le SVG',
|
||||
open_image_doc: 'Ouvrir le SVG',
|
||||
save_doc: 'Enregistrer l\'image',
|
||||
save_as_doc: 'Enregistrer en tant qu\'image'
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
export default {
|
||||
tools: {
|
||||
opensave: {
|
||||
new_doc: '新图片',
|
||||
open_doc: '打开 SVG',
|
||||
open_image_doc: '打开 SVG',
|
||||
save_doc: '保存图像',
|
||||
save_as_doc: '另存为图像'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user