mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Globalize rl.loadScript()
This commit is contained in:
parent
0106751e64
commit
cd734c7d5d
3 changed files with 14 additions and 15 deletions
|
|
@ -55,17 +55,13 @@ export const
|
||||||
leftmargin: (value, node) => node.style.marginLeft = pInt(value) + 'px',
|
leftmargin: (value, node) => node.style.marginLeft = pInt(value) + 'px',
|
||||||
bottommargin: (value, node) => node.style.marginBottom = pInt(value) + 'px',
|
bottommargin: (value, node) => node.style.marginBottom = pInt(value) + 'px',
|
||||||
rightmargin: (value, node) => node.style.marginRight = pInt(value) + 'px'
|
rightmargin: (value, node) => node.style.marginRight = pInt(value) + 'px'
|
||||||
};
|
},
|
||||||
|
|
||||||
// if (static::Config()->Get('labs', 'strict_html_parser', true))
|
|
||||||
let
|
|
||||||
value,
|
|
||||||
allowedAttributes = [
|
allowedAttributes = [
|
||||||
// defaults
|
// defaults
|
||||||
'name',
|
'name',
|
||||||
'dir', 'lang', 'style', 'title',
|
'dir', 'lang', 'style', 'title',
|
||||||
'background', 'bgcolor', 'alt', 'height', 'width', 'src', 'href',
|
'background', 'bgcolor', 'alt', 'height', 'width', 'src', 'href',
|
||||||
'border', 'bordercolor', 'charset', 'direction', 'language',
|
'border', 'bordercolor', 'charset', 'direction',
|
||||||
// a
|
// a
|
||||||
'download', 'hreflang',
|
'download', 'hreflang',
|
||||||
// body
|
// body
|
||||||
|
|
@ -178,6 +174,8 @@ export const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let value;
|
||||||
|
|
||||||
if ('TABLE' === name) {
|
if ('TABLE' === name) {
|
||||||
if (hasAttribute('width')) {
|
if (hasAttribute('width')) {
|
||||||
oStyle.width = getAttribute('width');
|
oStyle.width = getAttribute('width');
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { doc, createElement, SettingsCapa, SettingsGet } from 'Common/Globals';
|
import { SettingsCapa, SettingsGet } from 'Common/Globals';
|
||||||
import { staticLink } from 'Common/Links';
|
import { staticLink } from 'Common/Links';
|
||||||
|
|
||||||
//import { showScreenPopup } from 'Knoin/Knoin';
|
//import { showScreenPopup } from 'Knoin/Knoin';
|
||||||
|
|
@ -22,13 +22,12 @@ export const
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
if (SettingsCapa('OpenPGP') && window.crypto && crypto.getRandomValues) {
|
if (SettingsCapa('OpenPGP') && window.crypto && crypto.getRandomValues) {
|
||||||
const script = createElement('script', {src:staticLink('js/min/openpgp.min.js')});
|
rl.loadScript(staticLink('js/min/openpgp.min.js'))
|
||||||
script.onload = () => this.loadKeyrings();
|
.then(() => this.loadKeyrings())
|
||||||
script.onerror = () => {
|
.catch(e => {
|
||||||
this.loadKeyrings();
|
this.loadKeyrings();
|
||||||
console.error(script.src);
|
console.error(e);
|
||||||
};
|
});
|
||||||
doc.head.append(script);
|
|
||||||
} else {
|
} else {
|
||||||
this.loadKeyrings();
|
this.loadKeyrings();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,9 @@ win.rl = {
|
||||||
setData: appData => {
|
setData: appData => {
|
||||||
RL_APP_DATA = appData;
|
RL_APP_DATA = appData;
|
||||||
rl.app.refresh();
|
rl.app.refresh();
|
||||||
}
|
},
|
||||||
|
|
||||||
|
loadScript: loadScript
|
||||||
};
|
};
|
||||||
|
|
||||||
loadScript(`./?/${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`)
|
loadScript(`./?/${admin ? 'Admin' : ''}AppData/0/${Math.random().toString().slice(2)}/`)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue