forked from extern/egroupware
Get rid of jQuery.Color from jquery-ui
This commit is contained in:
parent
8df2a2fc49
commit
a8bcdd88b0
@ -28,7 +28,7 @@ import {
|
|||||||
egwActionObjectInterface
|
egwActionObjectInterface
|
||||||
} from "../egw_action/egw_action.js";
|
} from "../egw_action/egw_action.js";
|
||||||
import {Et2Dialog} from "./Et2Dialog/Et2Dialog";
|
import {Et2Dialog} from "./Et2Dialog/Et2Dialog";
|
||||||
|
import {ColorTranslator} from 'colortranslator';
|
||||||
/**
|
/**
|
||||||
* Class which implements the UI of a Portlet
|
* Class which implements the UI of a Portlet
|
||||||
*
|
*
|
||||||
@ -399,7 +399,7 @@ export class et2_portlet extends et2_valueWidget
|
|||||||
{
|
{
|
||||||
this.options.color = color;
|
this.options.color = color;
|
||||||
this.header.css("backgroundColor", color);
|
this.header.css("backgroundColor", color);
|
||||||
this.header.css('color', jQuery.Color(this.header.css("backgroundColor")).lightness() > 0.5 ? 'black':'white');
|
this.header.css('color', (new ColorTranslator(this.header.css("backgroundColor"))).L > 50 ? 'black':'white');
|
||||||
this.content.css("backgroundColor", color);
|
this.content.css("backgroundColor", color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,6 +28,7 @@ import {holidays} from "../../api/js/etemplate/Et2Date/Holidays";
|
|||||||
import {et2_calendar_view} from "./et2_widget_view";
|
import {et2_calendar_view} from "./et2_widget_view";
|
||||||
import flatpickr from "flatpickr";
|
import flatpickr from "flatpickr";
|
||||||
import {formatDate} from "../../api/js/etemplate/Et2Date/Et2Date";
|
import {formatDate} from "../../api/js/etemplate/Et2Date/Et2Date";
|
||||||
|
import {ColorTranslator} from "colortranslator";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which implements the "calendar-timegrid" XET-Tag for displaying a single days
|
* Class which implements the "calendar-timegrid" XET-Tag for displaying a single days
|
||||||
@ -856,7 +857,7 @@ export class et2_calendar_daycol extends et2_valueWidget implements et2_IDetache
|
|||||||
{
|
{
|
||||||
// Avoid white, which is hard to see
|
// Avoid white, which is hard to see
|
||||||
// Use border-bottom-color, Firefox doesn't give a value with border-color
|
// Use border-bottom-color, Firefox doesn't give a value with border-color
|
||||||
const color = jQuery.Color(event.div.css('background-color')).toString() !== jQuery.Color('white').toString() ?
|
const color = (new ColorTranslator(event.div.css('background-color'))).RGB !== 'rgb(255,255,255)' ?
|
||||||
event.div.css('background-color') : event.div.css('border-bottom-color');
|
event.div.css('background-color') : event.div.css('border-bottom-color');
|
||||||
if(color !== 'rgba(0, 0, 0, 0)')
|
if(color !== 'rgba(0, 0, 0, 0)')
|
||||||
{
|
{
|
||||||
|
@ -27,6 +27,7 @@ import {et2_selectbox} from "../../api/js/etemplate/et2_widget_selectbox";
|
|||||||
import {et2_container} from "../../api/js/etemplate/et2_core_baseWidget";
|
import {et2_container} from "../../api/js/etemplate/et2_core_baseWidget";
|
||||||
import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
|
import {Et2Dialog} from "../../api/js/etemplate/Et2Dialog/Et2Dialog";
|
||||||
import {formatTime} from "../../api/js/etemplate/Et2Date/Et2Date";
|
import {formatTime} from "../../api/js/etemplate/Et2Date/Et2Date";
|
||||||
|
import {ColorTranslator} from "colortranslator";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class for a single event, displayed in either the timegrid or planner view
|
* Class for a single event, displayed in either the timegrid or planner view
|
||||||
@ -375,11 +376,11 @@ export class et2_calendar_event extends et2_valueWidget implements et2_IDetached
|
|||||||
.append('<span class="calendar_calEventTitle">' + title + '</span>');
|
.append('<span class="calendar_calEventTitle">' + title + '</span>');
|
||||||
|
|
||||||
// Colors - don't make them transparent if there is no color
|
// Colors - don't make them transparent if there is no color
|
||||||
// @ts-ignore
|
const bg_color = new ColorTranslator(this.div.css('background-color'));
|
||||||
if (jQuery.Color("rgba(0,0,0,0)").toRgbaString() != jQuery.Color(this.div, 'background-color').toRgbaString())
|
if (bg_color.RGBA != 'rgb(0,0,0,0)')
|
||||||
{
|
{
|
||||||
// Most statuses use colored borders
|
// Most statuses use colored borders
|
||||||
this.div.css('border-color', this.div.css('background-color'));
|
this.div.css('border-color', bg_color.RGBA);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.icons.appendTo(this.title)
|
this.icons.appendTo(this.title)
|
||||||
|
6128
package-lock.json
generated
6128
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -65,7 +65,8 @@
|
|||||||
"@shoelace-style/shoelace": "^2.0.0-beta.73",
|
"@shoelace-style/shoelace": "^2.0.0-beta.73",
|
||||||
"blueimp-gallery": "^3.4.0",
|
"blueimp-gallery": "^3.4.0",
|
||||||
"lit-flatpickr": "^0.3.0",
|
"lit-flatpickr": "^0.3.0",
|
||||||
"sortablejs": "^1.14.0"
|
"sortablejs": "^1.14.0",
|
||||||
|
"colortranslator": "^1.9.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
|
Loading…
Reference in New Issue
Block a user