This commit is contained in:
Alexander Agnarson 2020-02-25 18:04:54 +01:00
parent 62def2a89b
commit 7ad333b360
167 changed files with 2955 additions and 2493 deletions

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/

File diff suppressed because it is too large Load diff

View file

@ -62,7 +62,6 @@ if ( _.isUndefined( window.kirkiSetSettingValue ) ) {
break;
case 'kirki-select':
case 'kirki-fontawesome':
$this.setSelectWoo( $this.findElement( setting, 'select' ), value );
break;
@ -1970,13 +1969,15 @@ wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicContr
id = 'kirki-editor-' + control.id.replace( '[', '' ).replace( ']', '' ),
editor;
wp.editor.initialize( id, {
tinymce: {
wpautop: true
},
quicktags: true,
mediaButtons: true
} );
if ( wp.editor && wp.editor.initialize ) {
wp.editor.initialize( id, {
tinymce: {
wpautop: true
},
quicktags: true,
mediaButtons: true
} );
}
editor = tinyMCE.get( id );
@ -1992,45 +1993,6 @@ wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicContr
}
}
} );
/* global fontAwesomeJSON */
wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend( {
initKirkiControl: function() {
var control = this,
element = this.container.find( 'select' ),
icons = jQuery.parseJSON( fontAwesomeJSON ),
selectValue,
selectWooOptions = {
data: [],
escapeMarkup: function( markup ) {
return markup;
},
templateResult: function( val ) {
return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text;
},
templateSelection: function( val ) {
return '<i class="fa fa-lg fa-' + val.id + '" aria-hidden="true"></i>' + ' ' + val.text;
}
},
select;
_.each( icons.icons, function( icon ) {
selectWooOptions.data.push( {
id: icon.id,
text: icon.name
} );
} );
select = jQuery( element ).selectWoo( selectWooOptions );
select.on( 'change', function() {
selectValue = jQuery( this ).val();
control.setting.set( selectValue );
} );
select.val( control.setting._value ).trigger( 'change' );
}
} );
wp.customize.controlConstructor['kirki-multicheck'] = wp.customize.kirkiDynamicControl.extend( {
initKirkiControl: function() {

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -7,7 +7,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.12
*/

View file

@ -8,7 +8,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.26
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.2.6
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.23
*/

View file

@ -8,7 +8,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.2.4
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.2
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.1
*/

View file

@ -7,7 +7,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -1,67 +0,0 @@
<?php
/**
* Customizer Control: kirki-fontawesome.
*
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Select control.
*/
class Kirki_Control_FontAwesome extends Kirki_Control_Base {
/**
* The control type.
*
* @access public
* @var string
*/
public $type = 'kirki-fontawesome';
/**
* Enqueue control related scripts/styles.
*
* @access public
*/
public function enqueue() {
parent::enqueue();
wp_enqueue_script( 'kirki-fontawesome-font', 'https://use.fontawesome.com/30858dc40a.js', array(), '4.0.7', false );
ob_start();
$json_path = wp_normalize_path( Kirki::$path . '/assets/vendor/fontawesome/fontawesome.json' );
include $json_path; // phpcs:ignore WPThemeReview.CoreFunctionality.FileInclude
$font_awesome_json = ob_get_clean();
wp_localize_script( 'kirki-script', 'fontAwesomeJSON', $font_awesome_json );
}
/**
* An Underscore (JS) template for this control's content (but not its container).
*
* Class variables for this control class are available in the `data` JS object;
* export custom variables by overriding {@see WP_Customize_Control::to_json()}.
*
* @see WP_Customize_Control::print_template()
*
* @access protected
*/
protected function content_template() {
?>
<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.inputAttrs }}} {{{ data.link }}}></select>
</label>
<?php
}
}

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.0
*/

View file

@ -8,7 +8,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.2.7
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -7,7 +7,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 1.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.23
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 2.0
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/
@ -24,7 +24,7 @@ data = _.defaults( data, {
} );
#>
<div class="kirki-input-container" data-id="{{ data['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>

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.34
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.27
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/

View file

@ -5,7 +5,7 @@
* @package Kirki
* @subpackage Controls
* @copyright Copyright (c) 2019, Ari Stathopoulos (@aristath)
* @license https://opensource.org/licenses/MIT
* @license https://opensource.org/licenses/MIT
* @since 3.0.17
*/