Initial commit

This commit is contained in:
Alexander Agnarson 2020-03-11 14:44:42 +01:00
commit b0607606ae
369 changed files with 85494 additions and 0 deletions

View file

@ -0,0 +1,36 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<#
data = _.defaults( data, {
id: '',
label: '',
description: '',
input_attrs: {}
});
<# var elementIdPrefix = 'el' + String( Math.random() ); #>
<div class="kirki-input-container" data-id="{{ data.id }}">
<# if ( data.label ) { #>
<label for="{{ elementIdPrefix }}_editor" class="customize-control-title">
{{{ data.label }}}
</label>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-notifications-container"></div>
<textarea id="{{ elementIdPrefix }}_editor"
<# _.each( _.extend( { 'class': 'code' }, data.input_attrs ), function( value, key ) { #>
{{{ key }}}="{{ value }}"
<# }); #>
></textarea>
</div>

View file

@ -0,0 +1,47 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<#
data = _.defaults( data, {
label: '',
description: '',
mode: 'full',
inputAttrs: '',
'data-palette': data['data-palette'] ? data['data-palette'] : true,
'data-default-color': data['data-default-color'] ? data['data-default-color'] : '',
'data-alpha': data['data-alpha'] ? data['data-alpha'] : false,
value: '',
'data-id': ''
} );
#>
<div class="kirki-input-container" data-id="{{ data['data-id'] }}" data-has-alpha="{{ data['data-alpha'] }}">
<label>
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
</label>
<input
type="text"
data-type="{{ data.mode }}"
{{{ data.inputAttrs }}}
data-palette="{{ data['data-palette'] }}"
data-default-color="{{ data['data-default-color'] }}"
data-alpha="{{ data['data-alpha'] }}"
value="{{ data.value }}"
class="kirki-color-control"
data-id="{{ data['data-id'] }}"
/>
</div>

View file

@ -0,0 +1,43 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<#
element = ( data.choices.element ) ? data.choices.element : 'input';
data = _.defaults( data, {
label: '',
description: '',
inputAttrs: '',
value: '',
'data-id': '',
choices: {}
} );
#>
<div class="kirki-input-container" data-id="{{ data.id }}">
<label>
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-content">
<{{ element }}
data-id="{{ data['data-id'] }}"
{{{ data.inputAttrs }}}
value="{{ data.value }}"
<# _.each( data.choices, function( val, key ) { #>
{{ key }}="{{ val }}"
<# } ); #>
<# if ( data.choices.content ) { #>>{{{ data.choices.content }}}</{{ element }}><# } else { #>/><# } #>
</div>
</label>
</div>

View file

@ -0,0 +1,67 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.34
*/
?>
<#
data = _.defaults( data, {
id: '',
label: '',
description: '',
input_attrs: {},
choices: {}
});
var saveAs = 'url';
if ( ! _.isUndefined( data.choices.save_as ) ) {
saveAs = data.choices.save_as;
}
url = data.value;
if ( _.isObject( data.value ) && ! _.isUndefined( data.value.url ) ) {
url = data.value.url;
}
data.choices.labels = _.isObject( data.choices.labels ) ? data.choices.labels : {};
data.choices.labels = _.defaults( data.choices.labels, {
select: '<?php esc_html_e( 'Select image', 'kirki' ); ?>',
change: '<?php esc_html_e( 'Change image', 'kirki' ); ?>',
'default': '<?php esc_html_e( 'Default', 'kirki' ); ?>',
remove: '<?php esc_html_e( 'Remove', 'kirki' ); ?>',
placeholder: '<?php esc_html_e( 'No image selected', 'kirki' ); ?>',
frame_title: '<?php esc_html_e( 'Select image', 'kirki' ); ?>',
frame_button: '<?php esc_html_e( 'Choose image', 'kirki' ); ?>',
} );
#>
<label>
<span class="customize-control-title">
{{{ data.label }}}
</span>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
</label>
<div class="image-wrapper attachment-media-view image-upload">
<# if ( data.value['url'] || '' !== url ) { #>
<div class="thumbnail thumbnail-image">
<img src="{{ url }}"/>
</div>
<# } else { #>
<div class="placeholder">{{ data.choices.labels.placeholder }}</div>
<# } #>
<div class="actions">
<button class="button image-upload-remove-button<# if ( '' === url ) { #> hidden <# } #>">{{ data.choices.labels.remove }}</button>
<# if ( data.default && '' !== data.default ) { #>
<button type="button" class="button image-default-button"<# if ( data.default === data.value || ( ! _.isUndefined( data.value.url ) && data.default === data.value.url ) ) { #> style="display:none;"<# } #>>{{ data.choices.labels['default'] }}</button>
<# } #>
<button type="button" class="button image-upload-button">{{ data.choices.labels.select }}</button>
</div>
</div>

View file

@ -0,0 +1,37 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.27
*/
?>
<#
data = _.defaults( data, {
label: '',
description: '',
inputAttrs: '',
value: '',
'data-id': ''
} );
#>
<div class="kirki-input-container" data-id="{{ data['data-id'] }}">
<label>
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-content">
<input {{{ data.inputAttrs }}} type="text" value="{{ data.value }}" data-id="{{ data['data-id'] }}"/>
<div class="quantity button minus">-</div>
<div class="quantity button plus">+</div>
</div>
</label>
</div>

View file

@ -0,0 +1,48 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<# data = _.defaults( data, {
choices: {},
label: '',
description: '',
inputAttrs: '',
value: '',
'data-id': '',
'default': ''
} );
#>
<div class="kirki-input-container" data-id="' + data.id + '">
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<# _.each( data.choices, function( val, key ) { #>
<label>
<input
{{{ data.inputAttrs }}}
type="radio"
data-id="{{ data['data-id'] }}"
value="{{ key }}"
name="_customize-radio-{{ data['data-id'] }}"
<# if ( data.value === key ) { #> checked<# } #>
/>
<# if ( _.isArray( val ) ) { #>
{{{ val[0] }}}<span class="option-description">{{{ val[1] }}}</span>
<# } else { #>
{{ val }}
<# } #>
</label>
<# } ); #>
</div>

View file

@ -0,0 +1,72 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<#
data = _.defaults( data, {
label: '',
description: '',
inputAttrs: '',
'data-id': '',
choices: {},
multiple: 1,
value: ( 1 < data.multiple ) ? [] : '',
placeholder: false
} );
if ( 1 < data.multiple && data.value && _.isString( data.value ) ) {
data.value = [ data.value ];
}
#>
<div class="kirki-input-container" data-id="{{ data.id }}">
<label>
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<select
data-id="{{ data['data-id'] }}"
{{{ data.inputAttrs }}}
<# if ( 1 < data.multiple ) { #>
data-multiple="{{ data.multiple }}" multiple="multiple"
<# } #>
>
<# if ( data.placeholder ) { #>
<option value=""<# if ( '' === data.value ) { #> selected<# } #>></option>
<# } #>
<# _.each( data.choices, function( optionLabel, optionKey ) { #>
<#
selected = ( data.value === optionKey );
if ( 1 < data.multiple && data.value ) {
selected = _.contains( data.value, optionKey );
}
if ( _.isObject( optionLabel ) ) {
#>
<optgroup label="{{ optionLabel[0] }}">
<# _.each( optionLabel[1], function( optgroupOptionLabel, optgroupOptionKey ) { #>
<#
selected = ( data.value === optgroupOptionKey );
if ( 1 < data.multiple && data.value ) {
selected = _.contains( data.value, optgroupOptionKey );
}
#>
<option value="{{ optgroupOptionKey }}"<# if ( selected ) { #> selected<# } #>>{{{ optgroupOptionLabel }}}</option>
<# } ); #>
</optgroup>
<# } else { #>
<option value="{{ optionKey }}"<# if ( selected ) { #> selected<# } #>>{{{ optionLabel }}}</option>
<# } #>
<# } ); #>
</select>
</label>
</div>

View file

@ -0,0 +1,41 @@
<?php
/**
* Customizer controls underscore.js template.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
?>
<#
data = _.defaults( data, {
label: '',
description: '',
inputAttrs: '',
value: '',
'data-id': '',
choices: {}
} );
#>
<div class="kirki-input-container" data-id="' + data.id + '">
<label>
<# if ( data.label ) { #>
<span class="customize-control-title">{{{ data.label }}}</span>
<# } #>
<# if ( data.description ) { #>
<span class="description customize-control-description">{{{ data.description }}}</span>
<# } #>
<div class="customize-control-content">
<textarea
data-id="{{ data['data-id'] }}"
{{{ data.inputAttrs }}}
<# _.each( data.choices, function( val, key ) { #>
{{ key }}="{{ val }}"
<# }); #>
>{{{ data.value }}}</textarea>
</div>
</label>
</div>