MCPcopy Create free account
hub / github.com/TruthHun/BookStack / applyColorCss

Function applyColorCss

static/mergely/editor/editor.js:652–667  ·  view source on GitHub ↗
(cssText, changeBorder, changeBackground, addedBorder, addedBackground, deletedBorder, deletedBackground, saveState)

Source from the content-addressed store, hash-verified

650 applyColorCss(makeColorCss(cb, cg, ab, ag, db, dg), cb, cg, ab, ag, db, dg, saveState);
651 }
652 function applyColorCss(cssText, changeBorder, changeBackground, addedBorder, addedBackground, deletedBorder, deletedBackground, saveState) {
653 $('<style type="text/css">' + cssText + '</style>').appendTo('head');
654 ed.mergely('options', {
655 fgcolor:{a:addedBorder,c:changeBorder,d:deletedBorder}
656 });
657 var params = updateQueryStringParam('cb', changeBorder.replace(/#/g, ''), color_defaults.cb);
658 params = updateQueryStringParam('cg', changeBackground.replace(/#/g, ''), color_defaults.cg, params);
659 params = updateQueryStringParam('ab', addedBorder.replace(/#/g, ''), color_defaults.ab, params);
660 params = updateQueryStringParam('ag', addedBackground.replace(/#/g, ''), color_defaults.ag, params);
661 params = updateQueryStringParam('db', deletedBorder.replace(/#/g, ''), color_defaults.db, params);
662 params = updateQueryStringParam('dg', deletedBackground.replace(/#/g, ''), color_defaults.dg, params);
663
664 if (saveState) {
665 updateHistory(params);
666 }
667 }
668 function updateHistory(params) {
669 var baseUrl = [location.protocol, '//', location.host, location.pathname].join('');
670 window.history.pushState({}, null, baseUrl + params);

Callers 2

colorSettingsFunction · 0.70
applyParameterCssFunction · 0.70

Calls 3

updateQueryStringParamFunction · 0.70
updateHistoryFunction · 0.70
$Function · 0.50

Tested by

no test coverage detected