This commit is contained in:
Mirco Wittrien 2019-09-25 16:01:55 +02:00
parent e1aa11eb74
commit f57e04d2f0
2 changed files with 3 additions and 3 deletions

File diff suppressed because one or more lines are too long

View File

@ -3446,14 +3446,14 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
if (!swatches) return;
swatches.setAttribute('swatchnr', parseInt(container.querySelectorAll('.swatches[swatchnr]').length + 1));
var colorlist = [null, 'rgb(82,233,30)', 'rgb(46,204,113)', 'rgb(26,188,156)', 'rgb(52,152,219)', 'rgb(52,84,219)', 'rgb(134,30,233)', 'rgb(155,89,182)', 'rgb(233,30,99)', 'rgb(233,65,30)', 'rgb(231,76,60)', 'rgb(230,126,34)', 'rgb(241,196,15)', 'rgb(199,204,205)', 'rgb(112,128,136)', 'rgb(99,99,99)', 'rgb(255,255,255)', 'rgb(59,173,20)', 'rgb(31,139,76)', 'rgb(17,128,106)', 'rgb(32,102,148)', 'rgb(32,57,148)', 'rgb(109,20,173)', 'rgb(113,54,138)', 'rgb(173,20,87)', 'rgb(173,32,20)', 'rgb(153,45,34)', 'rgb(168,67,0)', 'rgb(194,124,14)', 'rgb(151,156,159)', 'rgb(93,104,109)', 'rgb(44,44,44)'];
var colorlist = [null, 'rgba(82,233,30,1)', 'rgba(46,204,113,1)', 'rgba(26,188,156,1)', 'rgba(52,152,219,1)', 'rgba(52,84,219,1)', 'rgba(134,30,233,1)', 'rgba(155,89,182,1)', 'rgba(233,30,99,1)', 'rgba(233,65,30,1)', 'rgba(231,76,60,1)', 'rgba(230,126,34,1)', 'rgba(241,196,15,1)', 'rgba(199,204,205,1)', 'rgba(112,128,136,1)', 'rgba(99,99,99,1)', 'rgba(255,255,255,1)', 'rgba(59,173,20,1)', 'rgba(31,139,76,1)', 'rgba(17,128,106,1)', 'rgba(32,102,148,1)', 'rgba(32,57,148,1)', 'rgba(109,20,173,1)', 'rgba(113,54,138,1)', 'rgba(173,20,87,1)', 'rgba(173,32,20,1)', 'rgba(153,45,34,1)', 'rgba(168,67,0,1)', 'rgba(194,124,14,1)', 'rgba(151,156,159,1)', 'rgba(93,104,109,1)', 'rgba(44,44,44,1)'];
var colorrows = [colorlist.slice(0, parseInt(colorlist.length/2)), colorlist.slice(parseInt(colorlist.length/2))];
colorlist.shift();
swatches.appendChild(BDFDB.htmlToElement(`<div class="${BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.margintop8}" style="flex: 1 1 auto;"><div class="${BDFDB.disCN.marginreset}" style="flex: 0 0 auto;"><div aria-label="" class=""><button type="button" class="${BDFDB.disCNS.colorpickerswatch + BDFDB.disCNS.colorpickerswatchcustom + BDFDB.disCN.colorpickerswatchnocolor}" style="margin-left: 0;"><svg class="${BDFDB.disCN.colorpickerswatchdropper}" width="14" height="14" viewBox="0 0 16 16"><g fill="none"><path d="M-4-4h24v24H-4z"/><path class="${BDFDB.disCN.colorpickerswatchdropperfg}" fill="#ffffff" d="M14.994 1.006C13.858-.257 11.904-.3 10.72.89L8.637 2.975l-.696-.697-1.387 1.388 5.557 5.557 1.387-1.388-.697-.697 1.964-1.964c1.13-1.13 1.3-2.985.23-4.168zm-13.25 10.25c-.225.224-.408.48-.55.764L.02 14.37l1.39 1.39 2.35-1.174c.283-.14.54-.33.765-.55l4.808-4.808-2.776-2.776-4.813 4.803z"/></g></svg></button></div></div><div class="${BDFDB.disCNS.flex + BDFDB.disCNS.vertical + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.nowrap + BDFDB.disCN.flexmarginreset}" style="flex: 1 1 auto;">${colorrows.map(row => '<div class="' + BDFDB.disCNS.flex + BDFDB.disCNS.horizontal + BDFDB.disCNS.justifystart + BDFDB.disCNS.alignstretch + BDFDB.disCNS.wrap + BDFDB.disCN.colorpickerrow + '">' + row.map(c => '<button type="button" class="' + BDFDB.disCN.colorpickerswatch + (c ? "" : (" " + BDFDB.disCN.colorpickerswatchnocolor)) + '" style="background-color: ' + c + ';"></button>').join('') + '</div>').join('')}</div></div>`));
if (currentcolor && !BDFDB.colorCOMPARE(currentcolor, [0, 0, 0, 0])) {
var selection = colorlist.indexOf(BDFDB.colorCONVERT(currentcolor, 'RGB'));
var selection = colorlist.indexOf(BDFDB.colorCONVERT(currentcolor, 'RGBA'));
setSwatch(selection > -1 ? swatches.querySelectorAll(BDFDB.dotCNS.colorpickerrow + BDFDB.dotCN.colorpickerswatch + BDFDB.notCN.colorpickerswatchnocolor)[selection] : swatches.querySelector(BDFDB.dotCN.colorpickerswatch + BDFDB.dotCN.colorpickerswatchcustom), currentcolor, true);
}
else setSwatch(swatches.querySelector(BDFDB.dotCNS.colorpickerrow + BDFDB.dotCN.colorpickerswatch + BDFDB.dotCN.colorpickerswatchnocolor), null, true);