From: Alexander Ebert Date: Tue, 27 Feb 2018 11:15:24 +0000 (+0100) Subject: Implicit support for initial rgb()-values for the color picker X-Git-Tag: 3.1.0~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b25f85636fa7d44f16ced8d1624511700152c16e;p=GitHub%2FWoltLab%2FWCF.git Implicit support for initial rgb()-values for the color picker --- diff --git a/wcfsetup/install/files/js/WCF.ColorPicker.js b/wcfsetup/install/files/js/WCF.ColorPicker.js index 44324f52f7..57e72da0ca 100644 --- a/wcfsetup/install/files/js/WCF.ColorPicker.js +++ b/wcfsetup/install/files/js/WCF.ColorPicker.js @@ -182,6 +182,11 @@ if (COMPILER_TARGET_DEFAULT) { this._rgba.a.val(parseInt(element.data('alpha'))); } else { + // implicit support for initial rgb()-values + if (element.data('color').match(/^rgb\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)$/)) { + element.data('color', 'rgba(' + RegExp.$1 + ', ' + RegExp.$2 + ', ' + RegExp.$3 + ', 1)'); + } + if (this._rgbaRegExp === null) { this._rgbaRegExp = new RegExp("^rgba\\((\\d{1,3}), ?(\\d{1,3}), ?(\\d{1,3}), ?(1|1\\.00?|0|0?\\.[0-9]{1,2})\\)$"); }