*}value="{$field->getValue()}"{*
*}>
- <script data-relocate="true">
- require(['WoltLabSuite/Core/Language', 'WoltLabSuite/Core/Ui/Color/Picker'], (Language, UiColorPicker) => {
- Language.addObject({
- 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
- 'wcf.style.colorPicker.alpha': '{jslang}wcf.style.colorPicker.alpha{/jslang}',
- 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
- 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
- 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
- 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
- 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
- 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
- });
+ {include file='colorPickerJavaScript'}
+ <script data-relocate="true">
+ require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
UiColorPicker.fromSelector("#{@$field->getPrefixedId()}_colorPickerButton");
});
</script>
--- /dev/null
+<script data-relocate="true">
+require(["WoltLabSuite/Core/Language"], (Language) => {
+ Language.addObject({
+ 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
+ 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
+ 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
+ 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
+ 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
+ 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
+ 'wcf.style.colorPicker.hue': '{jslang}wcf.style.colorPicker.hue{/jslang}',
+ 'wcf.style.colorPicker.lightness': '{jslang}wcf.style.colorPicker.lightness{/jslang}',
+ 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
+ 'wcf.style.colorPicker.saturation': '{jslang}wcf.style.colorPicker.saturation{/jslang}',
+ });
+});
+</script>
"checkboxesOptionType",
"checkboxesSearchableOptionType",
"codeMetaCode",
+ "colorPickerJavaScript",
"fontAwesomeJavaScript",
"formError",
"formNotice",
import UiDialog from "../../../Ui/Dialog";
import * as UiStyleFontAwesome from "../../../Ui/Style/FontAwesome";
import { DialogCallbackObject, DialogCallbackSetup } from "../../../Ui/Dialog/Data";
+import * as ColorPicker from "../../../Ui/Color/Picker";
interface Rgba {
r: number;
picker.click();
});
- const colorPicker = new window.WCF.ColorPicker(".jsColorPicker");
- colorPicker.setCallbackSubmit(() => this.renderIcon());
+ document.querySelectorAll(".jsColorPicker").forEach((element: HTMLElement) => {
+ new ColorPicker(element, { callbackSubmit: () => this.renderIcon() });
+ });
const submitButton = context.querySelector(".formSubmit > .buttonPrimary") as HTMLElement;
submitButton.addEventListener("click", (ev) => this.save(ev));
*}value="{$field->getValue()}"{*
*}>
- <script data-relocate="true">
- require(['WoltLabSuite/Core/Language', 'WoltLabSuite/Core/Ui/Color/Picker'], (Language, UiColorPicker) => {
- Language.addObject({
- 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
- 'wcf.style.colorPicker.alpha': '{jslang}wcf.style.colorPicker.alpha{/jslang}',
- 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
- 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
- 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
- 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
- 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
- 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
- });
+ {include file='colorPickerJavaScript'}
+ <script data-relocate="true">
+ require(['WoltLabSuite/Core/Ui/Color/Picker'], (UiColorPicker) => {
UiColorPicker.fromSelector("#{@$field->getPrefixedId()}_colorPickerButton");
});
</script>
--- /dev/null
+<script data-relocate="true">
+require(["WoltLabSuite/Core/Language"], (Language) => {
+ Language.addObject({
+ 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
+ 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
+ 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
+ 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
+ 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
+ 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
+ 'wcf.style.colorPicker.hue': '{jslang}wcf.style.colorPicker.hue{/jslang}',
+ 'wcf.style.colorPicker.lightness': '{jslang}wcf.style.colorPicker.lightness{/jslang}',
+ 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
+ 'wcf.style.colorPicker.saturation': '{jslang}wcf.style.colorPicker.saturation{/jslang}',
+ });
+});
+</script>
<link href="{@$__wcf->getPath()}acp/style/acpStyleEditor.css" type="text/css" rel="stylesheet">
{js application='wcf' acp='true' file='WCF.ACP.Style'}
-{js application='wcf' file='WCF.ColorPicker' bundle='WCF.Combined'}
+{include file='colorPickerJavaScript'}
+
<script data-relocate="true">
- require(['WoltLabSuite/Core/Acp/Ui/Style/Editor'], function(AcpUiStyleEditor) {
+ require(["WoltLabSuite/Core/Acp/Ui/Style/Editor", "WoltLabSuite/Core/Ui/Color/Picker"], (AcpUiStyleEditor, ColorPicker) => {
AcpUiStyleEditor.setup({
isTainted: {if $isTainted}true{else}false{/if},
styleId: {if $action === 'edit'}{@$style->styleID}{else}0{/if},
styleRuleMap: styleRuleMap
});
+
+ ColorPicker.fromSelector(".jsColorPicker");
});
$(function() {
- new WCF.ColorPicker('.jsColorPicker');
-
- WCF.Language.addObject({
- 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
- 'wcf.style.colorPicker.alpha': '{jslang}wcf.style.colorPicker.alpha{/jslang}',
- 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
- 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
- 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
- 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
- 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
- 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
- });
-
{if $action == 'edit'}
new WCF.ACP.Style.CopyStyle({@$style->styleID});
{include file='header' pageTitle='wcf.acp.menu.link.trophy.'|concat:$action}
-{js application='wcf' file='WCF.ColorPicker' bundle='WCF.Combined'}
+{include file='colorPickerJavaScript'}
{include file='fontAwesomeJavaScript'}
<script data-relocate="true">
require(['Language', 'WoltLabSuite/Core/Acp/Ui/Trophy/Badge'], function (Language, BadgeHandler) {
Language.addObject({
- 'wcf.style.colorPicker': '{jslang}wcf.style.colorPicker{/jslang}',
- 'wcf.style.colorPicker.alpha': '{jslang}wcf.style.colorPicker.alpha{/jslang}',
- 'wcf.style.colorPicker.button.apply': '{jslang}wcf.style.colorPicker.button.apply{/jslang}',
- 'wcf.style.colorPicker.color': '{jslang}wcf.style.colorPicker.color{/jslang}',
- 'wcf.style.colorPicker.current': '{jslang}wcf.style.colorPicker.current{/jslang}',
- 'wcf.style.colorPicker.error.invalidColor': '{jslang}wcf.style.colorPicker.error.invalidColor{/jslang}',
- 'wcf.style.colorPicker.hexAlpha': '{jslang}wcf.style.colorPicker.hexAlpha{/jslang}',
- 'wcf.style.colorPicker.new': '{jslang}wcf.style.colorPicker.new{/jslang}',
'wcf.acp.style.image.error.invalidExtension': '{jslang}wcf.acp.style.image.error.invalidExtension{/jslang}',
'wcf.acp.trophy.badge.edit': '{jslang}wcf.acp.trophy.badge.edit{/jslang}',
'wcf.acp.trophy.imageUpload.error.notSquared': '{jslang}wcf.acp.trophy.imageUpload.error.notSquared{/jslang}',
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @module WoltLabSuite/Core/Acp/Ui/Trophy/Badge
*/
-define(["require", "exports", "tslib", "../../../Language", "../../../Ui/Dialog", "../../../Ui/Style/FontAwesome"], function (require, exports, tslib_1, Language, Dialog_1, UiStyleFontAwesome) {
+define(["require", "exports", "tslib", "../../../Language", "../../../Ui/Dialog", "../../../Ui/Style/FontAwesome", "../../../Ui/Color/Picker"], function (require, exports, tslib_1, Language, Dialog_1, UiStyleFontAwesome, ColorPicker) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.init = void 0;
Language = tslib_1.__importStar(Language);
Dialog_1 = tslib_1.__importDefault(Dialog_1);
UiStyleFontAwesome = tslib_1.__importStar(UiStyleFontAwesome);
+ ColorPicker = tslib_1.__importStar(ColorPicker);
/**
* @exports WoltLabSuite/Core/Acp/Ui/Trophy/Badge
*/
const picker = badgeColorContainer.querySelector(".jsColorPicker");
picker.click();
});
- const colorPicker = new window.WCF.ColorPicker(".jsColorPicker");
- colorPicker.setCallbackSubmit(() => this.renderIcon());
+ document.querySelectorAll(".jsColorPicker").forEach((element) => {
+ new ColorPicker(element, { callbackSubmit: () => this.renderIcon() });
+ });
const submitButton = context.querySelector(".formSubmit > .buttonPrimary");
submitButton.addEventListener("click", (ev) => this.save(ev));
},