f7a502b6fabd05aeea9a879605a4810d2c25ff4b
[Packages/TYPO3.CMS.git] / typo3 / sysext / backend / Resources / Public / JavaScript / ColorPicker.js
1 /*
2 * This file is part of the TYPO3 CMS project.
3 *
4 * It is free software; you can redistribute it and/or modify it under
5 * the terms of the GNU General Public License, either version 2
6 * of the License, or any later version.
7 *
8 * For the full copyright and license information, please read the
9 * LICENSE.txt file that was distributed with this source code.
10 *
11 * The TYPO3 project - inspiring people to share!
12 */
13
14 /**
15 * Module: TYPO3/CMS/Backend/ColorPicker
16 * contains all logic for the color picker used in FormEngine
17 */
18 define(['jquery', 'TYPO3/CMS/Core/Contrib/jquery.minicolors'], function($) {
19
20 /**
21 * @type {{selector: string}}
22 * @exports TYPO3/CMS/Backend/ColorPicker
23 */
24 var ColorPicker = {
25 selector: '.t3js-color-picker'
26 };
27
28 /**
29 * Initialize ColorPicker elements
30 */
31 ColorPicker.initialize = function() {
32 $(function () {
33 $(ColorPicker.selector).minicolors({
34 theme: 'bootstrap',
35 format: 'hex',
36 position: 'bottom left'
37 });
38 });
39 };
40
41 return ColorPicker;
42 });