mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 14:57:26 +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 + ',
|
||||
|
||||
tpl = doc.createElement('template'),
|
||||
clr = doc.createElement('input'),
|
||||
|
||||
getFragmentOfChildren = parent => {
|
||||
let frag = doc.createDocumentFragment();
|
||||
|
@ -138,6 +139,10 @@ const doc = document,
|
|||
return text;
|
||||
};
|
||||
|
||||
clr.type = "color";
|
||||
clr.style.display = 'none';
|
||||
doc.body.append(clr);
|
||||
|
||||
class SquireUI
|
||||
{
|
||||
constructor(container) {
|
||||
|
@ -179,13 +184,19 @@ class SquireUI
|
|||
},
|
||||
colors: {
|
||||
textColor: {
|
||||
input: 'color',
|
||||
cmd: s => squire.setTextColour(s.value),
|
||||
html: 'A<sub>▾</sub>',
|
||||
cmd: () => {
|
||||
clr.onchange = () => squire.setTextColour(clr.value);
|
||||
clr.click();
|
||||
},
|
||||
hint: 'Text color'
|
||||
},
|
||||
backgroundColor: {
|
||||
input: 'color',
|
||||
cmd: s => squire.setHighlightColour(s.value),
|
||||
html: '🎨', /* ▧ */
|
||||
cmd: () => {
|
||||
clr.onchange = () => squire.setHighlightColour(clr.value);
|
||||
clr.click();
|
||||
},
|
||||
hint: 'Background color'
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue