Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
b73d8872
Commit
b73d8872
authored
Jul 04, 2015
by
Jess
Browse files
Issue
#2505721
by eiriksm, nod_, jhodgdon: JSDoc color module
parent
0e2ca036
Changes
2
Hide whitespace changes
Inline
Side-by-side
core/modules/color/color.js
View file @
b73d8872
...
...
@@ -8,7 +8,12 @@
"
use strict
"
;
/**
* Displays farbtastic color selector and initialize color administration UI.
*
* @type {Drupal~behavior}
*
* @prop {Drupal~behaviorAttach} attach
* Attach color selection behavior to relevant context.
*/
Drupal
.
behaviors
.
color
=
{
attach
:
function
(
context
,
settings
)
{
...
...
@@ -95,10 +100,14 @@
* @function Drupal.color~shift_color
*
* @param {string} given
* @param {Array} ref1
* @param {Array} ref2
* A hex color code to shift.
* @param {Array.<number>} ref1
* First HSL color reference.
* @param {Array.<number>} ref2
* Second HSL color reference.
*
* @return {string}
* A hex color, shifted.
*/
function
shift_color
(
given
,
ref1
,
ref2
)
{
var
d
;
...
...
@@ -143,9 +152,14 @@
* Callback for Farbtastic when a new color is chosen.
*
* @param {HTMLElement} input
* The input element where the color is chosen.
* @param {string} color
* The color that was chosen through the input.
* @param {bool} propagate
* Whether or not to propagate the color to a locked pair value
* @param {bool} colorScheme
* Flag to indicate if the user is using a color scheme when changing
* the color.
*/
function
callback
(
input
,
color
,
propagate
,
colorScheme
)
{
var
matched
;
...
...
@@ -201,6 +215,7 @@
* Focuses Farbtastic on a particular field.
*
* @param {jQuery.Event} e
* The focus event on the field.
*/
function
focus
(
e
)
{
var
input
=
e
.
target
;
...
...
core/modules/color/preview.js
View file @
b73d8872
...
...
@@ -8,17 +8,27 @@
"
use strict
"
;
/**
* Namespace for color-related functionality for Drupal.
*
* @namespace
*/
Drupal
.
color
=
{
/**
* The callback for when the color preview has been attached.
*
* @param {Element} context
* The context to initiate the color behaviour.
* @param {object} settings
* Settings for the color functionality.
* @param {HTMLFormElement} form
* The form to initiate the color behaviour on.
* @param {object} farb
* The farbtastic object.
* @param {number} height
* Height of gradient.
* @param {number} width
* Width of gradient.
*/
callback
:
function
(
context
,
settings
,
form
,
farb
,
height
,
width
)
{
var
accum
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment