mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
This commit is contained in:
parent
2d429297ad
commit
9b94265844
1 changed files with 15 additions and 4 deletions
19
dev/External/SquireUI.js
vendored
19
dev/External/SquireUI.js
vendored
|
@ -15,6 +15,7 @@ const doc = document,
|
||||||
ctrlKey = /Mac OS X/.test( navigator.userAgent ) ? '⌘ + ' : 'Ctrl + ',
|
ctrlKey = /Mac OS X/.test( navigator.userAgent ) ? '⌘ + ' : 'Ctrl + ',
|
||||||
|
|
||||||
tpl = doc.createElement('template'),
|
tpl = doc.createElement('template'),
|
||||||
|
clr = doc.createElement('input'),
|
||||||
|
|
||||||
getFragmentOfChildren = parent => {
|
getFragmentOfChildren = parent => {
|
||||||
let frag = doc.createDocumentFragment();
|
let frag = doc.createDocumentFragment();
|
||||||
|
@ -138,6 +139,10 @@ const doc = document,
|
||||||
return text;
|
return text;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
clr.type = "color";
|
||||||
|
clr.style.display = 'none';
|
||||||
|
doc.body.append(clr);
|
||||||
|
|
||||||
class SquireUI
|
class SquireUI
|
||||||
{
|
{
|
||||||
constructor(container) {
|
constructor(container) {
|
||||||
|
@ -179,13 +184,19 @@ class SquireUI
|
||||||
},
|
},
|
||||||
colors: {
|
colors: {
|
||||||
textColor: {
|
textColor: {
|
||||||
input: 'color',
|
html: 'A<sub>▾</sub>',
|
||||||
cmd: s => squire.setTextColour(s.value),
|
cmd: () => {
|
||||||
|
clr.onchange = () => squire.setTextColour(clr.value);
|
||||||
|
clr.click();
|
||||||
|
},
|
||||||
hint: 'Text color'
|
hint: 'Text color'
|
||||||
},
|
},
|
||||||
backgroundColor: {
|
backgroundColor: {
|
||||||
input: 'color',
|
html: '🎨', /* ▧ */
|
||||||
cmd: s => squire.setHighlightColour(s.value),
|
cmd: () => {
|
||||||
|
clr.onchange = () => squire.setHighlightColour(clr.value);
|
||||||
|
clr.click();
|
||||||
|
},
|
||||||
hint: 'Background color'
|
hint: 'Background color'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue