#105 addextension jquery removed changes

master
Agriya Dev5 2021-06-01 18:23:56 +05:30
parent e310b41020
commit c7a1588a89
3 changed files with 5 additions and 6 deletions

View File

@ -722,7 +722,7 @@ class EditorStartup {
// eslint-disable-next-line no-unsanitized/method
const imported = await import(`./extensions/${encodeURIComponent(extname)}/${encodeURIComponent(extname)}.js`);
const { name = extname, init: initfn } = imported.default;
return this.addExtension(name, (initfn && initfn.bind(this)), { $, langParam: 'en' }); /** @todo change to current lng */
return this.addExtension(name, (initfn && initfn.bind(this)), { langParam: 'en' }); /** @todo change to current lng */
} catch (err) {
// Todo: Add config to alert any errors
console.error('Extension failed to load: ' + extname + '; ', err);
@ -746,7 +746,7 @@ class EditorStartup {
// eslint-disable-next-line no-unsanitized/method
const imported = await import(encodeURI(extPathName));
const { name, init: initfn } = imported.default;
return this.addExtension(name, (initfn && initfn.bind(this)), { $ });
return this.addExtension(name, (initfn && initfn.bind(this)), {});
} catch (err) {
// Todo: Add config to alert any errors
console.error('Extension failed to load: ' + extPathName + '; ', err);

View File

@ -23,7 +23,7 @@ const loadExtensionTranslation = async function (lang) {
export default {
name: 'server_opensave',
async init ({ $, decode64, encode64 }) {
async init ({ decode64, encode64 }) {
const svgEditor = this;
const strings = await loadExtensionTranslation(svgEditor.configObj.pref('lang'));
const {
@ -262,7 +262,7 @@ export default {
form.submit();
rebuildInput(form);
await $.process_cancel(strings.uploading);
// await $.process_cancel(strings.uploading);
cancelled = true;
if($id("dialog_box") != null) $id("dialog_box").style.display = 'none';
}

View File

@ -854,7 +854,7 @@ class SvgCanvas {
* if extension of supplied name already exists
* @returns {Promise<void>} Resolves to `undefined`
*/
this.addExtension = async function (name, extInitFunc, { $: jq, importLocale }) {
this.addExtension = async function (name, extInitFunc, { importLocale }) {
if (typeof extInitFunc !== 'function') {
throw new TypeError('Function argument expected for `svgcanvas.addExtension`');
}
@ -875,7 +875,6 @@ class SvgCanvas {
* @see {@link module:svgcanvas.PrivateMethods} source for the other methods/properties
*/
const argObj = canvas.mergeDeep(canvas.getPrivateMethods(), {
$: jq,
importLocale,
svgroot,
svgcontent,