/**!
* wp-color-picker-alpha
*
* Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
* Only run in input and is defined data alpha in true
*
* Version: 3.0.0
* https://github.com/kallookoo/wp-color-picker-alpha
* Licensed under the GPLv2 license or later.
*/
( function( $, undef ) {
var wpColorPickerAlpha = {
'version' : 300
};
// Always try to use the last version of this script.
if ( 'wpColorPickerAlpha' in window && 'version' in window.wpColorPickerAlpha ) {
var version = parseInt( window.wpColorPickerAlpha.version, 10 );
if ( ! isNaN( version ) && version >= wpColorPickerAlpha.version ) {
return;
}
}
// Prevent multiple initiations
if ( Color.fn.hasOwnProperty( 'to_s' ) ) {
return;
}
// Create new method to replace the `Color.toString()` inside the scripts.
Color.fn.to_s = function( type ) {
type = ( type || 'hex' );
// Change hex to rgba to return the correct color.
if ( 'hex' === type && this._alpha < 1 ) {
type = 'rgba';
}
var color = '';
if ( 'hex' === type ) {
color = this.toString();
} else if ( ! this.error ) {
color = this.toCSS( type ).replace( /\(\s+/, '(' ).replace( /\s+\)/, ')' );
}
return color;
}
// Register the global variable.
window.wpColorPickerAlpha = wpColorPickerAlpha;
// Background image encoded
var backgroundImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==';
/**
* Iris
*/
$.widget( 'a8c.iris', $.a8c.iris, {
/**
* Alpha options
*
* @since 3.0.0
*
* @type {Object}
*/
alphaOptions: {
alphaEnabled: false,
},
/**
* Get the current color or the new color.
*
* @since 3.0.0
* @access private
*
* @param {Object|*} The color instance if not defined return the cuurent color.
*
* @return {string} The element's color.
*/
_getColor: function( color ) {
if ( color === undef ) {
color = this._color;
}
if ( this.alphaOptions.alphaEnabled ) {
color = color.to_s( this.alphaOptions.alphaColorType );
if ( ! this.alphaOptions.alphaColorWithSpace ) {
color = color.replace( /\s+/g, '' );
}
return color;
}
return color.toString();
},
/**
* Create widget
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_create: function() {
try {
// Try to get the wpColorPicker alpha options.
this.alphaOptions = this.element.wpColorPicker( 'instance' ).alphaOptions;
} catch( e ) {}
// We make sure there are all options
$.extend( {}, this.alphaOptions, {
alphaEnabled: false,
alphaCustomWidth: 130,
alphaReset: false,
alphaColorType: 'hex',
alphaColorWithSpace: false,
} );
this._super();
},
/**
* Binds event listeners to the Iris.
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_addInputListeners: function( input ) {
var self = this,
debounceTimeout = 100,
callback = function( event ){
var val = input.val(),
color = new Color( val ),
val = val.replace( /^(#|(rgb|hsl)a?)/, '' ),
type = self.alphaOptions.alphaColorType;
input.removeClass( 'iris-error' );
if ( ! color.error ) {
// let's not do this on keyup for hex shortcodes
if ( 'hex' !== type || ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) ) {
// Compare color ( #AARRGGBB )
if ( color.toIEOctoHex() !== self._color.toIEOctoHex() ) {
self._setOption( 'color', self._getColor( color ) );
}
}
} else if ( val !== '' ) {
input.addClass( 'iris-error' );
}
};
input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
// If we initialized hidden, show on first focus. The rest is up to you.
if ( self.options.hide ) {
input.one( 'focus', function() {
self.show();
});
}
},
/**
* Init Controls
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_initControls: function() {
this._super();
if ( this.alphaOptions.alphaEnabled ) {
// Create Alpha controls
var self = this,
stripAlpha = self.controls.strip.clone(false, false),
stripAlphaSlider = stripAlpha.find( '.iris-slider-offset' ),
controls = {
stripAlpha : stripAlpha,
stripAlphaSlider : stripAlphaSlider
};
stripAlpha.addClass( 'iris-strip-alpha' );
stripAlphaSlider.addClass( 'iris-slider-offset-alpha' );
stripAlpha.appendTo( self.picker.find( '.iris-picker-inner' ) );
// Push new controls
$.each( controls, function( k, v ) {
self.controls[k] = v;
} );
// Create slider
self.controls.stripAlphaSlider.slider( {
orientation : 'vertical',
min : 0,
max : 100,
step : 1,
value : parseInt( self._color._alpha * 100 ),
slide : function( event, ui ) {
self.active = 'strip';
// Update alpha value
self._color._alpha = parseFloat( ui.value / 100 );
self._change.apply( self, arguments );
}
} );
}
},
/**
* Create the controls sizes
*
* @since 3.0.0
* @access private
*
* @param {bool} reset Set to True for recreate the controls sizes.
*
* @return {void}
*/
_dimensions: function( reset ) {
this._super( reset );
if ( this.alphaOptions.alphaEnabled ) {
var self = this,
opts = self.options,
controls = self.controls,
square = controls.square,
strip = self.picker.find( '.iris-strip' ),
innerWidth, squareWidth, stripWidth, stripMargin, totalWidth;
/**
* I use Math.round() to avoid possible size errors,
* this function returns the value of a number rounded
* to the nearest integer.
*
* The width to append all widgets,
* if border is enabled, 22 is subtracted.
* 20 for css left and right property
* 2 for css border
*/
innerWidth = Math.round( self.picker.outerWidth( true ) - ( opts.border ? 22 : 0 ) );
// The width of the draggable, aka square.
squareWidth = Math.round( square.outerWidth() );
// The width for the sliders
stripWidth = Math.round( ( innerWidth - squareWidth ) / 2 );
// The margin for the sliders
stripMargin = Math.round( stripWidth / 2 );
// The total width of the elements.
totalWidth = Math.round( squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) );
// Check and change if necessary.
while ( totalWidth > innerWidth ) {
stripWidth = Math.round( stripWidth - 2 );
stripMargin = Math.round( stripMargin - 1 );
totalWidth = Math.round( squareWidth + ( stripWidth * 2 ) + ( stripMargin * 2 ) );
}
square.css( 'margin', '0' );
strip.width( stripWidth ).css( 'margin-left', stripMargin + 'px' );
}
},
/**
* Callback to update the controls and the current color.
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_change: function() {
var self = this,
active = self.active;
self._super();
if ( self.alphaOptions.alphaEnabled ) {
var controls = self.controls,
alpha = parseInt( self._color._alpha * 100 ),
color = self._color.toRgb(),
gradient = [
'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
],
target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
self.options.color = self._getColor();
// Generate background slider alpha, only for CSS3.
controls.stripAlpha.css( { 'background' : 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + backgroundImage + ')' } );
// Update alpha value
if ( active ) {
controls.stripAlphaSlider.slider( 'value', alpha );
}
if ( ! self._color.error ) {
self.element.removeClass( 'iris-error' ).val( self.options.color );
}
self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
var color = $( this ).data( 'color' );
if ( self.alphaOptions.alphaReset ) {
self._color._alpha = 1;
color = self._getColor();
}
self._setOption( 'color', color );
} );
}
},
/**
* Paint dimensions.
*
* @since 3.0.0
* @access private
*
* @param {string} origin Origin (position).
* @param {string} control Type of the control,
*
* @return {void}
*/
_paintDimension: function( origin, control ) {
var self = this,
color = false;
// Fix for slider hue opacity.
if ( self.alphaOptions.alphaEnabled && 'strip' === control ) {
color = self._color;
self._color = new Color( color.toString() );
self.hue = self._color.h();
}
self._super( origin, control );
// Restore the color after paint.
if ( color ) {
self._color = color;
}
},
/**
* To update the options, see original source to view the available options.
*
* @since 3.0.0
*
* @param {string} key The Option name.
* @param {mixed} value The Option value to update.
*
* @return {void}
*/
_setOption: function( key, value ) {
var self = this;
if ( 'color' === key && self.alphaOptions.alphaEnabled ) {
// cast to string in case we have a number
value = '' + value;
newColor = new Color( value ).setHSpace( self.options.mode );
// Check if error && Check the color to prevent callbacks with the same color.
if ( ! newColor.error && self._getColor( newColor ) !== self._getColor() ) {
self._color = newColor;
self.options.color = self._getColor();
self.active = 'external';
self._change();
}
} else {
return self._super( key, value );
}
},
/**
* Returns the iris object if no new color is provided. If a new color is provided, it sets the new color.
*
* @param newColor {string|*} The new color to use. Can be undefined.
*
* @since 3.0.0
*
* @return {string} The element's color.
*/
color: function( newColor ) {
if ( newColor === true ) {
return this._color.clone();
}
if ( newColor === undef ) {
return this._getColor();
}
this.option( 'color', newColor );
},
} );
/**
* wpColorPicker
*/
$.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
/**
* Alpha options
*
* @since 3.0.0
*
* @type {Object}
*/
alphaOptions: {
alphaEnabled: false,
},
/**
* Get the alpha options.
*
* @since 3.0.0
* @access private
*
* @return {object} The current alpha options.
*/
_getAlphaOptions: function() {
var el = this.element,
type = ( el.data( 'type' ) || this.options.type ),
color = ( el.data( 'defaultColor' ) || el.val() ),
options = {
alphaEnabled: ( el.data( 'alphaEnabled' ) || false ),
alphaCustomWidth: 130,
alphaReset: false,
alphaColorType: 'rgb',
alphaColorWithSpace: false,
};
if ( options.alphaEnabled ) {
options.alphaEnabled = ( el.is( 'input' ) && 'full' === type );
}
if ( ! options.alphaEnabled ) {
return options;
}
options.alphaColorWithSpace = ( color && color.match( /\s/ ) );
$.each( options, function( name, defaultValue ) {
var value = ( el.data( name ) || defaultValue );
switch ( name ) {
case 'alphaCustomWidth':
value = ( value ? parseInt( value, 10 ) : 0 );
value = ( isNaN( value ) ? defaultValue : value );
break;
case 'alphaColorType':
if ( ! value.match( /^(hex|(rgb|hsl)a?)$/ ) ) {
if ( color && color.match( /^#/ ) ) {
value = 'hex';
} else if ( color && color.match( /^hsla?/ ) ) {
value = 'hsl';
} else {
value = defaultValue;
}
}
break;
default:
value = !!value;
break;
}
options[name] = value;
} );
return options;
},
/**
* Create widget
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_create: function() {
// Return early if Iris support is missing.
if ( ! $.support.iris ) {
return;
}
// Set the alpha options for the current instance.
this.alphaOptions = this._getAlphaOptions();
// Create widget.
this._super();
},
/**
* Binds event listeners to the color picker and create options, etc...
*
* @since 3.0.0
* @access private
*
* @return {void}
*/
_addListeners: function() {
if ( ! this.alphaOptions.alphaEnabled ) {
return this._super();
}
var self = this,
el = self.element,
isDeprecated = self.toggler.is( 'a' );
this.alphaOptions.defaultWidth = el.width();
if ( this.alphaOptions.alphaCustomWidth ) {
el.width( parseInt( this.alphaOptions.defaultWidth + this.alphaOptions.alphaCustomWidth, 10 ) );
}
self.toggler.css( {
'position': 'relative',
'background-image' : 'url(' + backgroundImage + ')'
} );
if ( isDeprecated ) {
self.toggler.html( '' );
} else {
self.toggler.append( '' );
}
self.colorAlpha = self.toggler.find( 'span.color-alpha' ).css( {
'width' : '30px',
'height' : '100%',
'position' : 'absolute',
'top' : 0,
'background-color' : el.val(),
} );
// Define the correct position for ltr or rtl direction.
if ( 'ltr' === self.colorAlpha.css( 'direction' ) ) {
self.colorAlpha.css( {
'border-bottom-left-radius' : '2px',
'border-top-left-radius' : '2px',
'left' : 0
} );
} else {
self.colorAlpha.css( {
'border-bottom-right-radius' : '2px',
'border-top-right-radius' : '2px',
'right' : 0
} );
}
el.iris( {
/**
* @summary Handles the onChange event if one has been defined in the options.
*
* Handles the onChange event if one has been defined in the options and additionally
* sets the background color for the toggler element.
*
* @since 3.0.0
*
* @param {Event} event The event that's being called.
* @param {HTMLElement} ui The HTMLElement containing the color picker.
*
* @returns {void}
*/
change: function( event, ui ) {
self.colorAlpha.css( { 'background-color': ui.color.to_s( self.alphaOptions.alphaColorType ) } );
// fire change callback if we have one
if ( $.isFunction( self.options.change ) ) {
self.options.change.call( this, event, ui );
}
}
} );
/**
* Prevent any clicks inside this widget from leaking to the top and closing it.
*
* @since 3.0.0
*
* @param {Event} event The event that's being called.
*
* @return {void}
*/
self.wrap.on( 'click.wpcolorpicker', function( event ) {
event.stopPropagation();
});
/**
* Open or close the color picker depending on the class.
*
* @since 3.0.0
*/
self.toggler.click( function() {
if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
self.close();
} else {
self.open();
}
});
/**
* Checks if value is empty when changing the color in the color picker.
* If so, the background color is cleared.
*
* @since 3.0.0
*
* @param {Event} event The event that's being called.
*
* @return {void}
*/
el.change( function( event ) {
var val = $( this ).val();
if ( el.hasClass( 'iris-error' ) || val === '' || val.match( /^(#|(rgb|hsl)a?)$/ ) ) {
if ( isDeprecated ) {
self.toggler.removeAttr( 'style' );
}
self.colorAlpha.css( 'background-color', '' );
// fire clear callback if we have one
if ( $.isFunction( self.options.clear ) ) {
self.options.clear.call( this, event );
}
}
} );
/**
* Enables the user to either clear the color in the color picker or revert back to the default color.
*
* @since 3.0.0
*
* @param {Event} event The event that's being called.
*
* @return {void}
*/
self.button.click( function( event ) {
if ( $( this ).hasClass( 'wp-picker-default' ) ) {
el.val( self.options.defaultColor ).change();
} else if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
el.val( '' );
if ( isDeprecated ) {
self.toggler.removeAttr( 'style' );
}
self.colorAlpha.css( 'background-color', '' );
// fire clear callback if we have one
if ( $.isFunction( self.options.clear ) ) {
self.options.clear.call( this, event );
}
el.trigger( 'change' );
}
} );
},
} );
} ( jQuery ) );.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px;padding:1px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right;margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
=== ND Shortcodes ===
Contributors: nicdark
Tags: wp bakery page builder, components, elementor, shortcodes, elementor library, post-grid, elementor templates, elementor pages, elementor sections, services
Requires at least: 4.5
Tested up to: 6.7
Stable tag: 7.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
The plugin adds some useful components to your page builder ( Elementor or WP Bakery Page Builder ). All components are full responsive and retina ready.
== Description ==
= Some components in the preview below =
The plugin adds some useful components to your page builder ( Elementor or WP Bakery Page Builder ) that can be integrated very easily with your own theme.
== Installation ==
1. Install and activate the plugin.
2. Be sure that you have the plugin WP Bakery Page Builder or Elementor actived in your theme.
3. Go in your pages/posts and find the new components in the new tab of your Page Builder dashboard
4. Enjoy it ;)
== Screenshots ==
1. Example of WP Bakery Page Builder dashboard
== Changelog ==
= 7.8 =
* improving elementor demo importer
= 7.7 =
* added new css classes
= 7.6 =
* removed nd_options_enable_svg_media_upload() function for avoid svg image upload and improve sicurity
= 7.5 =
* improved css classes and some notices messages
= 7.4 =
* improved elementor import
= 7.3 =
* fixed undefined variable notices on imported elementor demo feature
= 7.2 =
* implemented import elementor demo
= 7.1 =
* fixed some warning messages on import elementor demo
= 7.0 =
* added wp_kses_post() function for sanitizes content on shortcodes
= 6.9 =
* added escaping variables on shortcodes folder
* added sanitize_key() function on layout variable inclusion
= 6.8 =
* introducing Library
= 6.7 =
* added data escaping on variables used on testimonial shortcode
= 6.6 =
* Improved plugin security ( added realpath(), Data Sanitization/Escaping variables )
= 6.5 =
* added new labels ( slide, new ) in Customizer - Header - Labels
* fixed double woo lightbox
* adjust woo product variable button css
= 6.4 =
* added compatibility with WordPress 5.9
= 6.3 =
* added header 6 for elementor
* added footer 6 for elementor
* added layout 2 for events calendar
* added layout 9 for page, post, archives and search pages
= 6.2 =
* Focus number component, added layouts 4 and 5
* Post grid component, added layout 15
* Focus component, added layout 7
= 6.1 =
* added some css classes
= 6.0 =
* added nonce on ajax calls
* improved post-search, import/export and locations features.
= 5.9.1 =
* sanitize, validate, and escape all datas on POST and GET requests
* improved plugins_url()
* removed post-search, import/export and locations features.
= 5.9 =
* Improved nd_options_import_settings_php_function function for security reasons
= 5.8 =
* added IDs on some elements
* added layout 14 on post grid components
= 5.7 =
* added compatibility with latest wp version
= 5.6 =
* add new fonts
* added some IDs on elements
* added new css classes
* added layout 3 for magic popup component
* added layout 6 for price component
* added new progress component
* added layout 6 for team component
= 5.5 =
* added new fonts
* added new layout 8 for pages,posts and archives
* added new layout for woocommerce
* fixed export content for wp 5.0
* convert title and spaces metabox options to select
= 5.4 =
* added ids on some elements
* added lightbox gallery on single product woo page
= 5.3 =
* added new layout 5 for header and footer
* added new css rules
* added new layout 3 for countdown element
* added new layout 3 for focus number element
* added new components ( menu and open sidebar )
* added new layout 12 and 13 on postgrid element
* added new layout 5 on price element
* added underline option on text element
= 5.2.9 =
* added new layout for post grid component
* added new page/post layout for header image
* removed some clenthemes references on source code
= 5.2.8 =
* added layout 10 for post grid component
* updated .pot file
* added new css rules
= 5.2.7 =
* added new css rules
= 5.2.6 =
* added new css rules
= 5.2.5 =
* deleted hidden settings in footer 4
* fixed notices warning on debug true for page/post/comment template on layout 5
* added new css rules
* fixe some w3c notices
= 5.2.4 =
* added layout-5 for post/page and comments
= 5.2.3 =
* Added some woocommerce css rules for layout-3
= 5.2.2 =
* Added some woocommerce css rules for layout-1
= 5.2.1 =
* Added few css rules on plugin style
= 5.2 =
* Added new layout-4 for archives, page, search, comments and posts template.
* Added new fonts
* Added Events Calendar compatibility
* Added new options for customizer forms
* Added new options in footer-4
= 5.1 =
* Added ID for all header and footer
* Browser compatibility for some components
= 5.0 =
* Added footer layout 4
* Added new layout on gmaps component ( layout 3 )
* Added new layout on magic pop-up component ( layout 2 )
* Added ID for header image on post/page/archives on layout 3
* Added ID on navigation 2 for hide the navigation/top header with css
* Added new classes on style.css
* Change the page template structure to fit some new w3c rules ( example: style tag in header )
= 4.9 =
* Edit breadcrumbs/index.php for new header layout
* Added new layout for page,post and archives
* Added new navigation layout ( header-4 ) with center logo
* Added new color option for vc location component
* Added new layout for woo commerce post grid component
* Added/Edit some css rules on style.css
* Added new List component on Violet Coll
* Added new layout on post grid component
* Added new layout on price component
* Added new layout on service component
* Added new layout on team component
* Added new layout on focus component
= 4.8 =
* Added new component Divider
* Added third font on customizer
* Fixed margin top/bottom metabox page on layout 2 (page template)
* Added third font on text component
* Fixed component magic popup font color and font family for title and button
= 4.7 =
* Added new css rules on style.css
* Create new layout for countdown components
* New component focus number
* New component magic popup
* New component service pro
= 4.6 =
* enable multiplies layout on archive template page
* enable multiplies layout on search template page
* enable multiplies layout on comments page template
* enable multiplies layout on page template
* enable multiplies layout on post template
* enable multiplies layout on archive and single product page for header img
* added custom style-2 for woo commerce ( part 1 )
* added woo commerce component on WP Bakery Page Builder on violet collection
* add new fonts
* added footer 3 layout
* added locations custom post type
* added new rules on admin style and style.css
* added new icons on img/icons
* added new components collection violet on WP Bakery Page Builder
* added new components collection orange on WP Bakery Page Builder
* added components toggle ( violet coll. )
* added new layout on testimonial comp.
* added new layout on team comp.
* added new layout on focus comp.
* added new layout on price comp.
* added new layout on post grid.
* added new layout on counter.
= 4.5.2 =
* Added possibility to add right/left sidebar on archive woocommerce products through customizer
* Added some woocommerce css rules on custom style 1 for sidebar compatibility
* Added custom woocommerce sidebar
= 4.5.1 =
* Fixed error on breadcrumbs caused by woo commerce function
= 4.5 =
* Added addons/woocommerce for custom compatibility with plugin ( part 1 )
* Edit breadcrumbs function for full compatibility with woo commerce
* Edit settings on wp dashboard for add woo commerce enable/disable
= 4.4 =
* Added new css rules
* Added table themes
= 4.3 =
* Edit color scheme function on settings folder
= 4.2 =
* Edit import export function ( bug fix )
= 4.1 =
* Added translate file
* Added some changes on theme options
= 4.0 =
* Added Id for footer
* Edit style.css
* Edit layout 6 for service
= 3.9 =
* Fix bug on layout 6 service
= 3.8 =
* Edit layout 2 for focus components
* Added new layout 6 for service components
= 3.7 =
* Edit header 3 on customizer
= 3.6 =
* Added layout for focus component
* Added header 3
= 3.5 =
* Added RTL features
* Added translation default.po
= 3.4 =
* Edit some responsive rules and browser bugs
= 3.3 =
* Edit some responsive rules
= 3.2 =
* Edit some responsive rules
= 3.1 =
* Edit page/single template
= 3.0 =
* Edit button components
= 2.9 =
* Edit some css rules on style.css
= 2.8 =
* Added breadcrumbs compatibility with nd-learning plugin
* Edit header layout 2 ( transparent mode )
= 2.7 =
* Added breadcrumbs
* Added layout 5 for service
* Edit price and post grid ( layout-1 ) components
= 2.6 =
* Added compatibility with plugin Learning Courses ( section calendar )
* Added new icons
* Enable shortcodes on text widget
* Edit single post template ( header img )
= 2.5 =
* Added Sidebar Management on post
* Edit custom/cf7 components
= 2.4 =
* Added Post Formats compatibility for post grid components layout 3
= 2.3 =
* Added Image Header settings on archives page and search
* Edit submit and errors form ( cf7 compatibility )
* Edit customizer Header
* Edit metabox on pages and posts
* Edit templates folder
* Edit cf7 counter, post grid, price, typewriter components
= 2.2 =
* Added forms fields management for password type fields
= 2.1 =
* Added forms fields management ( cf7 compatibility )
* Edit custom/post-grid components padding
= 2.0 =
* Fixed warning error on metabox.php file missing on custom/post-grid/index.php
= 1.9 =
* Removed metabox.php from custom/post grid components
= 1.8 =
* Added style.css for adding some rules for adding filter overlay on WP Bakery Page Builder parallax row.
* Edit font-size to 40px for countdown components
* Added strong tag for counter components
* Fixed alignment bug on badge components
* Added shortcode price_row for adding rows on components custom/price
* Edit components button
* Added post addons
* Added header image metabox for pages and posts
= 1.7 =
* Added bg parameter on spacer component
= 1.6 =
* Added components badge
* Added components button
* Added components image
= 1.5 =
* Edit components services, added layout-4
* Enable svg uploader media
= 1.4 =
* Edit components post-grid, responsive and image overflow problems, added order, id and orderby parameters
* Edit components text, added align parameter
= 1.3 =
* Added text components
= 1.2 =
* Added spacer components
= 1.1 =
* Added new components on shortcodes folder
* Added addons folder
* Added customizer folder on addons to manage fonts/footer/header theme, added furthermore examples folder to show the basic customizer types fields
* Added metabox folder on addons
* Added templates folder on addons
= 1.0 =
* Initial version